Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding a ComboBox to a DataGrid
Message
 
À
07/01/2004 10:26:39
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00863988
Message ID:
00864738
Vues:
9
Thank you....that took care of that.

I now have the AddCustomDataTableStyle() in my sample app.
My DataGrid now has alternating color rows and my Northwind.Orders.Freight field now displays formated as currency.
I'd like to make the Northwind.Orders.ShipVia field use a ComboBox.
The field refers to the Northwind.Shippers table.
1=Speedy Express
2=United Package
3=Federal Shipping
For now, getting a ComboBox to display 1, 2, 3, would be fine.
Ultimately I want to get it to display the Northwind.Shippers.CompanyName field associated with the Northwind.Orders.ShipVia

What would be my next step to get this ComboBox to display in my DataGrid?
Rick
----------------
>>>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
>>>
>>>>---------------------------------
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform