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

Column Format?

1 Answer 12 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 02 Dec 2015, 02:02 PM

Hi:

I am building a RadGrid programatically from data read from a backend CRM system. The codebehind file builds a dataset and binds to the Radgrid. Can anyone provide an example on how I can set the format of the columns in the Codebehind file? I need some columns formatted as currency, some as percentage, etc. I tried using

RadGrid1_ColumnCreated

RadGrid1_ItemDataBound

but neither worked.

Thanks for any and all input.

John.

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 07 Dec 2015, 12:24 PM
Hi,

You can use the RadGrid PreRener event to modify the autogenerated columns settings. For example:

protected void RadGrid1_PreRender(object sender, EventArgs e)
 {
 
     RadGrid1.MasterTableView.GetColumn("ColumnUniqueName").DataType = typeof(Decimal);
 
 }

I hope this helps.

Regards,
Maria Ilieva
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or