This is a migrated thread and some comments may be shown as answers.

Dynamic Column Editor Based on Cell value

1 Answer 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tyler
Top achievements
Rank 1
Tyler asked on 30 Jun 2010, 05:07 PM
I am attempting to dynamically change the ColumnEditor of a RadGrid based on if the value for that row is a TimeDate value or not.  As it stands right now, I am doing this in the OnEditCommand event by getting the value stored, checking if it can be parsed as a Date time, then either assigning the ColumnEditor to a custom TimePickerEditor or a custom TextColumnEditor.  This meaning that different rows can have different editors.

The issue is that when I switch from on row that has a timepicker to a row that has a texteditor, the viewstate is no longer valid and an exception is raised.  If I set EnableViewState to false, I cannot find a way to access those controls to get the new selected values from them.

At this point I am running in circles, any help or instruction on the proper way to adjust the columneditor per row would be appreciated.

Thanks,  Tyler

1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 06 Jul 2010, 06:33 AM
Hi Tyler,

You should be using the CreateColumnEditor event:
http://www.telerik.com/support/kb/aspnet-ajax/grid/using-custom-editors-in-radgrid.aspx

Regards,
Tsvetoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Tyler
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or