Hello,
i have a GridDropDownColumn connected to a DataSource and i get an error when i try to set the ListTextField property like this: ListTextField = "Field1, Field2". How can i achieve this programmatically in radgrid view mode?
I have written the following code to achieve this in radgrid edit mode:
if
(e.Item
is
GridEditableItem && e.Item.IsInEditMode)
{
GridEditableItem editItem = (GridEditableItem)e.Item;
RadComboBox combo = (RadComboBox)editItem[
"Field1"
].Controls[0];
combo.ItemDataBound +=
new
RadComboBoxItemEventHandler(combo_ItemDataBound);
}
void
combo_ItemDataBound(
object
sender, RadComboBoxItemEventArgs e)
{
RadComboBoxItem item = (RadComboBoxItem)e.Item;
DataRowView dr = (DataRowView)e.Item.DataItem;
item.Text = item.Text +
" ( "
+ dr[
"Field2"
].ToString() +
" "
+ dr[
"Field3"
].ToString() +
" ) "
;
}
Thank you very much.