Drop down list in the datagrid.

hi,

i've a datagrid(GDBG) colummn which celltype is a "GridListControl".

how to i get the selected value and store the value to another column?

Is there any event like "SelectionChangeCommitted"?






1 Reply

HA haneefm Syncfusion Team May 24, 2007 02:50 PM UTC

Hi Lim,

You can access the GridDropDownGridListControlCellRenderer and subscribe to the SelectedValueChanged event which, is analogous to the SelectionChangeCommitted event. Below is a code snippet

//Form Load....
GridDropDownGridListControlCellRenderer cr = this.grid.CellRenderers["GridListControl"] as GridDropDownGridListControlCellRenderer;
if( cr != null)
{
cr.ListBoxPart.SelectedValueChanged+=new EventHandler(ListBoxPart_SelectedValueChanged);
}

private void ListBoxPart_SelectedValueChanged(object sender, EventArgs e)
{
ListBox list = sender as ListBox;
DataRowView row = list.SelectedItem as DataRowView;
if( row != null)
Console.WriteLine(row[1]);
}

Best regards,
Haneef

Loader.
Up arrow icon