Unable to get the id of the selected item in the ultra combo'
i have a win grid, wherein there are several columns containing 3 combo boxes and other text editor columns.
The valueList for each combo is a class that gets it data from the specific columns in the db.
When i use grid.activerow.cells["ColumnName"].value, i am getting a null value.
Have any reason why this is the case?
nakash said:When i use grid.activerow.cells["ColumnName"].value, i am getting a null value.
So.. just to be clear.. you are saying that you selected a value from the list and you can see the text in the cell, but the Value of the cell is still returning null?
What event are you using the check the Value? My guess is that you are probably using an event that is firing when the cell's text has been update, but the value has not yet been committed to the data source, such as the CellChange event.
Yes @ mike, the even that i am using is afterRowUpdate. The code below should provide some clarity, cbo.SelectedRow is null. I first click on the combo box, select an item and the text property is showing in th combo box. I would like to know how is it that cbo.SelectedRow is null.
id1 = TourCombo.GetId(grdCombo, "TourId").ToString();
public static int GetId(UltraCombo cbo, string columnName)
{
UltraGridRow row;
UltraGridCell cell;
int id = 0;
row = cbo.SelectedRow;
if (row != null)
cell = row.Cells[columnName];
if (cell != null)
id = (int)cell.Value;
}
return id;