Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding a ComboBox to a DataGrid
Message
De
07/01/2004 10:26:39
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00863988
Message ID:
00864663
Vues:
9
>>To make the error go away, I had to change PropertyDescriptorCollection to System.ComponentModel.PropertyDescriptorCollection
There have been a couple other times when I had to do things like that.
What am I missing that causes me to add these prefixes?<


Rick,

You're missing an Imports statement. You should include
Imports System.ComponentModel;
~~Bonnie


>Terry,
>I've found the GridTableStylesCollection example you mentioned.
>When I tried to implement it I got an error on the line
>
>        ' Use a PropertyDescriptor to create a formatted
>        ' column. First get the PropertyDescriptorCollection
>        ' for the data source and data member.
>        Dim pcol As PropertyDescriptorCollection = _
>        Me.BindingContext(myDataSet, "Customers.custToOrders"). _
>        GetItemProperties()
>
>The error is
>Type 'PropertyDescriptorCollection' is not defined.
>
>To make the error go away, I had to change PropertyDescriptorCollection to
>System.ComponentModel.PropertyDescriptorCollection
>
>There have been a couple other times when I had to do things like that.
>What am I missing that causes me to add these prefixes?
>
>Rick
>_______________________________
>>I have tested several implementations of adding a combobox to a datagrid and I have found the one by George Sheperd from Syncfusion to be the best performing and easiest to implement.
>>
>>The key to understanding and using this class is knowing how to write code to add a tablestyle to the grid. This can be done from a wizard in the form’s grid property sheet but I recommend you learn how to do this in code because the designer does not assist in adding a combobox and trying to use it in conjuction with the DataGridComboBoxColumn class is very confusing. You can find a good example of adding a tablestyle in the help by doing a search on “GridTableStylesCollection Class “.
>>
>>
>>There are several basics you need to know and from your message I’m not sure how far along you are so the first step I suggest is to add a method to your form to define and add a tablestyle to you grid and put a call to this method following the forms InitializeComponent() method call.
>>
>>The other basic is knowing how to generate and bind data to a combobox.
>>
>>If you already know how to do this or when you become familiar with these steps I will be happy to follow-up and help you implement the DataGridComboBoxColumn class.
>>
>>I hope this gets you started.
>>
>>Regards,
>>
>>Terry Carroll
>>
>>>---------------------------------
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform