In my database I have a column called "Current_Due" which is set as a numeric datatype (Oracle). When I autogenerate my grid, the column is being typed as a GridBoundColumn instead of a GridNumericColumn.
1.) Do I need to change something to have it bind as a different column type?
2.) In my RadGrid1_ColumnCreated event, I try to cast it as a GridNumericColumn and get an error. Anyone know how to cast as a different column type? I'm doing - GridNumericColumn numericColumn = e.Column as GridNumericColumn;
7 Answers, 1 is accepted
0
Hi Richard,
When the columns in RadGrid control are autogenerated, please have in mind that you can not change their type. In order to achieve your goal you can dynamically create GridNumericColumn in code behind on Page_Init / RadGrid1_ColumnCreated event.
Find more information in this help article.
Best wishes,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
When the columns in RadGrid control are autogenerated, please have in mind that you can not change their type. In order to achieve your goal you can dynamically create GridNumericColumn in code behind on Page_Init / RadGrid1_ColumnCreated event.
Find more information in this help article.
Best wishes,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Richard
Top achievements
Rank 2
answered on 06 Jul 2009, 12:15 PM
Thank you for your response Pavlina. Can you tell me why data which is of Numeric Type to begin with is not being bound as a GridNumericColumn type in the first place? If the data type is set as numeric in the data source, the grid should know that and automatically select the GridNumericColumn type when constructing the grid. Any ideas?
0
Hello Richard,
Attached to this message is a simple runnable application, that demonstrates the needed approach. Please give it a try and let me know if it helps.
Greetings,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Attached to this message is a simple runnable application, that demonstrates the needed approach. Please give it a try and let me know if it helps.
Greetings,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mark Galbreath
Top achievements
Rank 2
answered on 08 Oct 2009, 04:56 PM
This is ridiculous. Why is there not a single example or explanation of how to programatically assign the datatype to a column?
0
Hello Mark,
Please review the following help topic on how to create RadGrid programmatically.
http://www.telerik.com/help/aspnet-ajax/grdprogrammaticcreation.html
I hope this helps.
Regards,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Please review the following help topic on how to create RadGrid programmatically.
http://www.telerik.com/help/aspnet-ajax/grdprogrammaticcreation.html
I hope this helps.
Regards,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Terry
Top achievements
Rank 1
answered on 08 Mar 2019, 01:46 AM
Pavlina,
I've been searching for the same things for a week now, 10 years after this post, and the article you mentioned says nothing about setting the datatype to a programmatically generated GridBoundColumn.
0
Hello Terry,
You can use the ColumnCreated event handler to modify the settings of auto-generated columns:
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/columns/working-with-autogenerated-columns#customizing-auto-generated-columns
I hope this will prove helpful.
Regards,
Eyup
Progress Telerik
You can use the ColumnCreated event handler to modify the settings of auto-generated columns:
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/columns/working-with-autogenerated-columns#customizing-auto-generated-columns
I hope this will prove helpful.
Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.