We are using a grouping grid with combo boxes in it, our data source has 2 columns, a value member and a display member, we are doing it like this.
grid1.TableDescriptor.Columns[strColName].Appearance.AnyRecordFieldCell.CellType = "ComboBox";
grid1.TableDescriptor.Columns[strColName].Appearance.AnyRecordFieldCell.DataSource = dataTable;
grid1.TableDescriptor.Columns[strColName].Appearance.AnyRecordFieldCell.DisplayMember = strDisplayMember;
grid1.TableDescriptor.Columns[strColName].Appearance.AnyRecordFieldCell.ValueMember = strValueMember;
grid1.TableDescriptor.Columns[strColName].Appearance.AnyRecordFieldCell.ShowButtons = GridShowButtons.ShowCurrentCellEditing;
my question is, how can we filter the dropdowns, to show subsets of the data source based on the group they fall within?
ADAdministrator Syncfusion Team February 16, 2005 05:21 AM
You can try handling this.gridGroupingControl1.TableControlCurrentCellShowingDropDown and provide filtered DataSources to the droplist at that point. Here is a KB link that discusses this for GridDataBoundGrid, but I think something similar should work here as well.
ADAdministrator Syncfusion Team February 28, 2005 10:36 PM
from the example, it appears that it retrieve the key for the slave table using colindex (numeric). if i drag and change the order of the column, i will not be able to retrieve. how to i access using the column name instead?
ADAdministrator Syncfusion Team March 1, 2005 11:43 AM
Try code like this to get an arbitray value in that event using a column name.
GridCurrentCell cc = e.TableControl.CurrentCell;
GridTableCellStyleInfo style = e.TableControl.Model[cc.RowIndex, cc.ColIndex] as GridTableCellStyleInfo;
Record rec = style.TableCellIdentity.DisplayElement.ParentRecord as Record;
object someValue = rec.GetValue("SomeColumName");