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

Grouping Grid - filter Combo boxes

Hi, 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?

3 Replies

AD Administrator Syncfusion Team February 16, 2005 10:21 AM UTC

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. http://www.syncfusion.com/Support/article.aspx?id=567

AD Administrator Syncfusion Team March 1, 2005 03:36 AM UTC

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?

AD Administrator Syncfusion Team March 1, 2005 04:43 PM UTC

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");

Live Chat Icon For mobile
Up arrow icon