I''ve got a grouping grid with 3 bound columns and 1 unbound.
The 2nd column and the unbound column celltype is a combobox with a bound dataset.
I''d like for when the unbound column changes, for it to filter the 2nd column''s combobox resultset.
So effectively, every row could have a different filter.
Here''s what i''ve got now.
But it doesn''t seem to do anything.
Private Sub ExpensesGroupDG_TableControlCurrentCellChanged(ByVal sender As Object, ByVal e As Grouping.GridTableControlEventArgs) Handles ExpensesGroupDG.TableControlCurrentCellChanged
Dim colIndex As Integer = e.TableControl.CurrentCell.ColIndex
Dim rowIndex As Integer = e.TableControl.CurrentCell.RowIndex
'' UnBound ComboBox
Dim currComboBox As Grouping.GridTableCellStyleInfo = e.TableControl.Model(rowIndex, colIndex)
'' Desired column to be filtered
Dim currSubAccount As Grouping.GridTableCellStyleInfo = e.TableControl.Model(rowIndex, colIndex - 2)
currSubAccount.CellType = "ComboBox"
'' Call stored procedure with unbound combobox value
'' return the datatable
currSubAccount.DataSource = RemoteFactory.PropertyService.VOExpenseGroupSubAccountList(currComboBox.CellValue).VORecoverableExpenseGroupSubAccountsList
currSubAccount.ValueMember = "GLAccountId"
currSubAccount.DisplayMember = "SubAccountCode"
currSubAccount.DropDownStyle = GridDropDownStyle.Exclusive
ADAdministrator Syncfusion Team November 14, 2004 07:05 PM
Here is a little sample where the datasource for the combobox in "Col2" is filtered by the value in the ComboBox within the "unbound" column.
BHBernard HerrokNovember 14, 2004 08:46 PM
I don''t quite understand the QueryValue and SaveValue handlers.
Why do you call them and why would i need to call them.
Apart from what i can see (the unbound combobox doesn''t hold the selected value) how would i change it to use my dataset?
ADAdministrator Syncfusion Team November 15, 2004 02:07 AM
QueryValue and SaveValue is how the sample is providing the unbound data to the unbound column. Comment them out and you will see that the unbound column does not display/save any data.
Here is the code that sets up the unbound column to hold a combobox. You would use your DataSource/DisplayMember/ValueMember here.
GridTableCellStyleInfo style = this.gridGroupingControl1.TableDescriptor.Columns["unbound"].Appearance.AnyRecordFieldCell;
style.CellType = "ComboBox";
//.... get the DataSource datatable into dt1
style.DataSource = dt1; // a datatable
style.DisplayMember = "value"; //column in datatable
style.ValueMember = "value"; //column in datatable
In the sample, if you change the value in the combobox on the right, and then drop the combobox in the middle, the dropped list has been filtered by the value from the right combobox.