Hi,
I am using RadGrid ASP.NET Ajax 2008 Q2. Is that possible to change EditForm Controls dynamically on Edit Command depends on current dataType? I have a simple Grid with three columns as follows:
Name Value Type
Installation date 12.12.2008 DateTime
newModemRequired false Boolean
installation by myEmployee String
Purpose:
1. Select item to Edit.
2. Get the DataType on selecttion
3. Render EditForms on CreateColumnEditor
That Code compiles but on runtime if I Click Edit Button I get an error like 'Message from server can not be parsed...'
Thanks for any help
I am using RadGrid ASP.NET Ajax 2008 Q2. Is that possible to change EditForm Controls dynamically on Edit Command depends on current dataType? I have a simple Grid with three columns as follows:
Name Value Type
Installation date 12.12.2008 DateTime
newModemRequired false Boolean
installation by myEmployee String
Purpose:
1. Select item to Edit.
2. Get the DataType on selecttion
3. Render EditForms on CreateColumnEditor
protected void RadGrid1_CreateColumnEditor(object sender, GridCreateColumnEditorEventArgs e) |
{ |
//string getDataTypeAtIndex(int index) => Extract Values from Grid item. |
string myType=getDataTypeAtIndex(RadGrid1.SelectedItems[0].ItemIndex); |
if (e.Column.UniqueName == "Value") |
{ |
if (myType =="Boolean") |
{ |
Telerik.Web.UI.GridCheckBoxColumnEditor boolFieldEditor = new Telerik.Web.UI.GridCheckBoxColumnEditor(); |
e.ColumnEditor = boolFieldEditor; |
} |
else if (myType == "DateTime") |
{ |
Telerik.Web.UI.GridDateTimeColumnEditor dateFieldEditor = new GridDateTimeColumnEditor(); |
e.ColumnEditor = dateFieldEditor; |
} |
//String or Integer |
else |
{ |
Telerik.Web.UI.GridTextBoxColumnEditor textFieldEditor = new Telerik.Web.UI.GridTextBoxColumnEditor(); |
e.ColumnEditor = textFieldEditor; |
} |
} |
} |
That Code compiles but on runtime if I Click Edit Button I get an error like 'Message from server can not be parsed...'
Thanks for any help