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
ADAdministrator Syncfusion Team March 4, 2003 03:31 AM
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.
ADAdministrator Syncfusion Team March 4, 2003 03:36 AM
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.
RARajaramanMarch 4, 2003 05:26 AM
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 ?
ADAdministrator Syncfusion Team March 4, 2003 07:31 AM
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";