We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid Combo Dispvalue & Dispmember different scenario

Hi I am a having some different requirment in using GridCOmboBox with Items comes Fixed. For example, I am having a Dataset1, Datagrid1 I am having a Column1 which contains a Flag "F" or "K" or "M" which is there in dataset. Depending on the value in the dataset i want to show some value in the grid column. (which is available in the combo) Is it possible? That column has a Combo associated in the Column. While Selecting i can show (dispvalue)F for Flat(dispname) (dispvalue)K for Kernal(dispname) (dispvalue)M for Medium(dispname) If my requirment is not clear please let me know regs Rajaraman

5 Replies

AD Administrator Syncfusion Team March 4, 2003 08:31 AM UTC

The column with the combobox is another column in the same row. Correct? If you handle the PrepareViewStyleInfo event you can specify at runtime the DataSource for the other column that is depending on first column's value. Stefan


AD Administrator Syncfusion Team March 4, 2003 08:36 AM UTC

Actually, it is better to handle the QueryCellInfo event. Not PrepareViewStyleInfo. This is safer in that specific case. Let me know if you have problems. Stefan


RA Rajaraman March 4, 2003 10:26 AM UTC

hi i have attached the screen shot, costtype column having a Combo, but is stored in the database as "F", "U", so if i set the dataset to grid, it shows only "F", i want to show "Flat" for "F" am i clear ? regards rajaraman


AD Administrator Syncfusion Team March 4, 2003 12:31 PM UTC

Try this. Create a class named MyValue with two public properties DispValue and DispName. Then create an ArrayList holding three of these MyValue objects, with the values you want them to have. Then for the column, have code similar to this: GridBoundColumn.StyleInfo.DataSource = arrayList; GridBoundColumn.StyleInfo.CellType = "ComboBox" GridBoundColumn.StyleInfo.DisplayMember = "DispName"; GridBoundColumn.StyleInfo.ValueMember = "DispValue";


RA Rajaraman March 5, 2003 01:21 AM UTC

Thanks got it working Regards Rajaraman

Loader.
Up arrow icon