I currently have a GridDateTimeColumn with PickerType = DateTimePicker. I want to change the timeview to display in 2 columns instead of the default 3. I've searched the forums and found what I thought should be solutions but the code seems to have no effect.
(http://www.telerik.com/community/forums/aspnet-ajax/grid/many-grid-questions.aspx ; http://www.telerik.com/community/forums/aspnet-ajax/grid/how-to-localize-datetimepicker-s-tooltip-in-filter-menu.aspx )
In the RadGrid1_ItemDataBound event I have the following code:
The column is declared as:
While debugging, these statements do get executed and the Columns value is updated to 2. When I test the result in the browser the TimeView still pops up with a 3 column layout - so the code appears to have had no effect.
Is the itemDataBound event the wrong event for such a change? I've tried to add similar code to the ItemCreated event but not been able to access the editor there at all.
(http://www.telerik.com/community/forums/aspnet-ajax/grid/many-grid-questions.aspx ; http://www.telerik.com/community/forums/aspnet-ajax/grid/how-to-localize-datetimepicker-s-tooltip-in-filter-menu.aspx )
In the RadGrid1_ItemDataBound event I have the following code:
GridEditableItem item = (GridEditableItem)e.Item;
RadDateTimePicker expiresTimePicker = (RadDateTimePicker)item["Expires"].Controls[0];
expiresTimePicker.TimeView.Columns = 2;
GridDateTimeColumnEditor colEd = (item.EditManager.GetColumnEditor("Expires") as GridDateTimeColumnEditor);
(colEd.PickerControl as RadDateTimePicker).TimeView.Columns = 2;
The column is declared as:
<
telerik:GridDateTimeColumn
DataField
=
"Expires"
DataFormatString
=
"{0:g}"
ReadOnly
=
"false"
PickerType
=
"DateTimePicker"
HeaderText
=
"Expires"
UniqueName
=
"Expires"
SortExpression
=
"Expires"
AllowFiltering
=
"false"
ConvertEmptyStringToNull
=
"true"
>
</
telerik:GridDateTimeColumn
>
While debugging, these statements do get executed and the Columns value is updated to 2. When I test the result in the browser the TimeView still pops up with a 3 column layout - so the code appears to have had no effect.
Is the itemDataBound event the wrong event for such a change? I've tried to add similar code to the ItemCreated event but not been able to access the editor there at all.