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
close icon

More combobox related questions

Hey Clay, 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; } } Cheers, JF

4 Replies

AD Administrator Syncfusion Team February 2, 2005 10:48 AM UTC

Hi Jim, 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. Stefan

JF Jim Frapper February 2, 2005 01:10 PM UTC

Hey Stefan, 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. Cheers, JF

AD Administrator Syncfusion Team February 2, 2005 01:57 PM UTC

Jim, CurrentCellActivated should be what you look for. Just move the code for populating the list from CurrentCellShowingDropDown to CurrentCellActivated. Stefan

JF Jim Frapper February 2, 2005 07:19 PM UTC

Stefan, Your suggestion worked great... JF

Live Chat Icon For mobile
Up arrow icon