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

[Solved] Change Auto-Generated Column ColumnType

2 Answers 866 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Neil
Top achievements
Rank 1
Neil asked on 19 Mar 2013, 09:17 PM
I have a grid being bound to a datasource (which comes from a stored procedure) - when a column contains a datetime, such as 01/01/2000 00:00:00, the column type correctly becomes a GridDateTimeColumn (and my filter changes to a DatePicker).  However, when my data is in the format of 01/01/2000, it acts as a normal GridBoundColumn and I get the textbox for a filter.  How can I (programmatically) change the column type?  ColumnType is read-only, and since all of my grids are auto-generated, I am having trouble with this.  

I need to have a DatePicker in the filter is all.  I have seen column.FilterTemplate, but am not sure if this is a solution.

Thanks.

2 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 20 Mar 2013, 05:31 AM
Hello,

RadGrid will automatically set columnType based on DataType.

http://www.telerik.com/help/aspnet-ajax/grid-customizing-autogenerated-columns.html


Please set datatype in your StoredProcuder.

You can achieve this thing by using Cast and Convert in Sql.

Thanks,
Jayesh Goyani
0
Shinu
Top achievements
Rank 2
answered on 20 Mar 2013, 05:34 AM
Hi,

With reference to this forum thread, The auto-generated columns feature of RadGrid does not support changing the type of the columns.

Thanks,
Shinu
Tags
Grid
Asked by
Neil
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Shinu
Top achievements
Rank 2
Share this question
or