Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
640
WinGrid Customization
posted

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.UltraGridColumn)(((Infragistics.Win.UltraWinGrid.UltraGridBand)

(((Infragistics.Win.UltraWinGrid.UltraGridBase)(Information)).DisplayLayout.Bands.All[0]))

.Columns.All[3])).Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDown;

Information.DataSource = DtableInformation;

 

Thanks

Ferdin

  • 45049
    posted

    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?