Hi:
I have a xamdatagrid, and I want to show different editor depending the data value form a column, it can be combobox, calendarcontrol etc. . and the combobox value it dynamics in get it runtime from an unbound array.
How to do it?
Regards,
Joel
Hello Joe,
To the best of my knowledge, you will not be able to do that without rebinding the XamDataGrid. The ValueEditors in a cell cannot be changed runtime. You can do that by rebinding it and handling the InitializeRecord event and change the EditorType of the specific field.
Hope this helps.
Hi Actually I am doing this in UltraWinGrid, now i want to port to WPF, and I can do it in WinForm.
void ugSelField_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e) { ValueList valuelist; string theValue = e.Row.Cells["Type"].Value.ToString().Substring(0,4); switch (theValue.ToUpper()) { case "ENUM": string[] ItemList = e.Row.Cells["TypeString"].Value.ToString().Split(':'); valuelist = new ValueList(); for (int p = 0; p < ItemList.Length; p=++ ) { valuelist.ValueListItems.Add(ItemList[p]); } e.Row.Cells["D"].ValueList = valuelist; e.Row.Cells["D"].Editor = new EditorWithCombo();
break; case "DATE": e.Row.Cells["D"].Editor = new DateTimeEditor(); break;
} }
Anyone can do it?