This post is a continuation of our discussion in this post: http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=23449
I have implemented your suggested solution involving using a datatable as the datasource and filtering the data for the combobox with a dataview.
During the testing cycle, it seems my testers were able to "break" this solution. Filtering the second combobox in with the CurrentCellShowingDropDown event works great the user is clicking on the combobox column. But during testing the user were navigating between columns with the keyboard and trying to select the data in the combo by using the keyboard. This last part is my problem, by typing to select a value in the combo they are getting the data for the entire list and not the filtered set that I would like them to get.
For reference, here is my event handler:
private void gridData_CurrentCellShowingDropDown(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellShowingDropDownEventArgs e)
GridCurrentCell cc = this.gridData.CurrentCell;
if (cc.ColIndex == 4)
int categoryID = Convert.ToInt32(this.gridData[cc.RowIndex, 3].Text);
DataView dv = new DataView(this.items);
dv.RowFilter = "PracticalCategoryID = " + categoryID;
GridComboBoxCellRenderer render = (GridComboBoxCellRenderer)cc.Renderer;
GridComboBoxListBoxPart part = (GridComboBoxListBoxPart)render.ListBoxPart;
part.DataSource = dv;
ADAdministrator Syncfusion Team February 2, 2005 05:48 AM
Clay is on vacation until next week. I am not 100% familiar with the other post but here are some general pointers:
Try moving the code from CurrentCellShowingDropDown to CurrentCellActivated event.
CurrentCellShowingDropDown is only called when you dropdown the list.
CurrentCellActivated on the othise is called after the current cell was moved and before the user presses a key.
If CurrentCellActivated is too early for you you could also try CurrentCellKeyPress.
JFJim FrapperFebruary 2, 2005 08:10 AM
Thanks for letting me know Clay is on vacation.
Well the functional requirements for what I am asking for is the first post in : http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=23449
A recap of the functional requirements are: Basically I have two combo box columns in a databound grid. When you select a value in column one, I need column two to be dynmaically populated or filtered based on the value from column one.
Clay''s previous suggestion was to populate column two with all possible values. Then, when the user selects the combo column two, dynamically filter this column in the CurrentCellShowingDropDown event. This works when the user clicks on the column but doesn''t when the user is on the cell and types a value(the user will get the whole list)
Please let me know if you need any more info.
ADAdministrator Syncfusion Team February 2, 2005 08:57 AM
CurrentCellActivated should be what you look for. Just move the code for populating the list from CurrentCellShowingDropDown to CurrentCellActivated.