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

convert between Grid column data Type

1 Answer 93 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Hamza
Top achievements
Rank 1
Hamza asked on 21 Jul 2011, 08:12 AM
Iam using Telerik Gridview  tin my project , the grid have alote of columns of type textbox Now I need to convert the  GridViewTextBoxcolumn to 
GridViewDecimalcolumn  . 

I can Do that by delete the GridViewTextBoxcolumn  and add the new one GridViewDecimalcolumn  
 
but it's taking    time  becuse I have more than 30 grid 

My Question is  its there is any way to do that  away from deleteing and adding  ? 

1 Answer, 1 is accepted

Sort by
0
Svett
Telerik team
answered on 26 Jul 2011, 03:14 PM
Hello Hamza,

If the column is not auto-generated from data source binding, you should go through the code and replace it. If the column is generated when you set your data source, you can simply change the data type of the property in your data source from string to integer. This will force the grid to generate GridViewDecimalColumn instead of GridViewTextBoxColumn for this property.

Best wishes,
Svett
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
GridView
Asked by
Hamza
Top achievements
Rank 1
Answers by
Svett
Telerik team
Share this question
or