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

Comboboxes in databound grid not showing values

Hi, I am using databound grid. 1. I am handling QueryCellInfo event and switching the control in a column to combobox based on the column in the row. The combobox is shown in the cell. Drop down part comes up with my values. But the value in the cell is not selected in the combobox. If I use a text box instead of combobox it is showing my value (2)properly. My value(2) exists in my datasource. ---------------------------- grid.Model.IgnoreReadOnly = true; // is this needed?? e.Style.CellType = "Combobox"; e.Style.DisplayMember = "MyDisplayMember"; e.Style.ValueMember = "MyValueMember"; e.Style.DataSource = myValuesArrayList; // force a change -- no luck here either ObjectObj = e.Style.CellValue; e.Style.CellValue = obj; grid.Model.IgnoreReadOnly = false; ---------------------------- 2. I have another databound grid where I am handling the query cell info to show different controls in the same column. Sometimes if I click the drop down button of the combobox ina cell, it does not drop down. If I type a character in the cell it shows the dropdown part of the combobox. That combobox's datasource has just 40 items. Can you please point in the right direction to fix these problems thanks, - Reddy

4 Replies

AD Administrator Syncfusion Team November 3, 2003 09:18 PM UTC

Attached is a sample that attempts what I think you described in 1. It seems to behave as expected. What are you doing differently? Is the value from the datasource of your GridDataBoundGrid a valid ValueMember property for the ArrayList of objects? Can you see the problems in the attached sample?

AD Administrator Syncfusion Team November 4, 2003 04:34 PM UTC

Clay, Thank you for the sample. You are right about the first question. I was getting string value from my backend and the valuemember in my datasource is an integer. So, now I am converting the strng to int and setting back into e.Style.CellValue. It is working. Is there something I can check/look into for my second problem? thanks, - Reddy

AD Administrator Syncfusion Team November 5, 2003 10:09 AM UTC

Without more info or some sample showing the problem, I am at a loss. Does it happen when the grid (or another grid cell) does not have focus orginally? Say you click on a button, and the handler does not set the focus back to the grid. Then if you try to click on the combobox cell, is that when the list does not drop? Are you handling CurrentCellActivating or CurrentCellMoving? These events might affect activation of the current cell. You might be able to force the dropping of the cell by handling CurrentCellMoved.
private void gridDataBoundGrid1_CurrentCellMoved(object sender, GridCurrentCellMovedEventArgs e)
	GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
	if(cc.Renderer is GridComboBoxCellRenderer)

AD Administrator Syncfusion Team November 5, 2003 11:42 AM UTC

Clay, It happens when I am in a combobox cell. The combobox cell is acitve. It shows the text field and the combo button. When I click on the button to drop down the combobox, nothing happens. But when I start typing in, it is auto completing the text. After that point, if I click the button, it is showing the drop down. It happens only to a few comboboxes. thanks, - Reddy

Live Chat Icon For mobile
Up arrow icon