Got a question about ComboBoxes in a DataBound Grid. I have a column that depending on a value in another column, the user is able to either type in a value (ie have a regular textbox cell) or select a value from a drop down ComboBox (which table populates this combo box is dependent on the value in that other column). Is this possible in a DataBoundGrid? Can you provide a VB example?
ADAdministrator Syncfusion Team September 19, 2003 05:51 AM
Here is a KB article that has a sample.
There are other ways to do this if the technique is not what you need, ask again....
ADAdministrator Syncfusion Team September 19, 2003 10:16 AM
I believe this would work, thank you. I do have one question, can you have the empty combo box display as a textbox instead. I think it be easier for the user to see what fields they need to type something in, and which fields need to have a value selected.
ADAdministrator Syncfusion Team September 19, 2003 11:23 AM
You can use the GridStyleInfo.ShowButtons property to determine when a button is visible.
But if you want some buttons in the column to show, and other buttons in the same column not to show, then you would have to handle the grid.Model.QueryCellInfo event. In your handler, test e.ColIndex and e.RowIndex to see if they point to your combobox column. If they do, you would conditionally set e.Style.ShowButtons depending on whether you want to see the button. You might be able to use e.Style.Text.Length to decide when the button should show.