Hi Everbody,
I need some help from you all. I am using a WinGrid in C#.NET 2005. I need to customize only one column to be as a DropDownList. I have set it using the UltraGridDesigner in the Style options and also dynamically using the code, but when i bind the data dynamically it just gets reflected as it is in the table. I dont no where i have gone wrong. Please help me.
I have the code to be like this
(((Infragistics.Win.UltraWinGrid.UltraGridBase)(Information)).DisplayLayout.Bands.All[0]))
.Columns.All[3])).Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDown;
Information.DataSource = DtableInformation;
Thanks
Ferdin
I'm not entirely sure why you're doing all of this casting. It probably isn't necessary. If you handle the grid's InitializeLayout event (which is raised as the layout is created, which is right after it is databound), you'll likely get the same result:
e.Layout.Bands[0].Columns[3].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDown;
If you need to set up a column as a DropDownList in code, you need to tell it what you want in the dropdown area, as well as setting the column's Style to DropDown (or DropDownList or DropDownValidate). The following article from our online Knowledge Base is a good reference for the options you have for this:HOWTO: What is the best way to place a DropDown list in a grid cell?