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

[Solved] Grid Column format not working when using the dynamic type in the grid

1 Answer 81 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ravindra
Top achievements
Rank 1
Ravindra asked on 26 Apr 2011, 08:29 PM
Hi,
When grid type is dynamic, the column format, currency, is not getting applied to the grid. It is just showing as a normal number.
If i mention the appropriate type, then the currency format is being applied properly.
Is this a bug? or any issue with my approach? below is the code for both the options

Html.Telerik().Grid<dynamic>()

Html.Telerik().Grid<SampleGridData>()

columns.Bound(item.Key).Title(item.Header).Filterable(item.Filterble).Sortable(item.Sortable).Groupable(item.Groupable).Format(item.Format).Visible(item.IsVisible).HtmlAttributes(new {@style ="text-align:left"});

item.Format will carry "{0:C"}

this is working as expected if i use the specific binding and not working if choose the dynamic option.
attached are screenshots of both cases

1 Answer, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 27 Apr 2011, 07:25 AM
Hi Ravindra,

In order format to work you should specify the field's type:

columns.Bound(typeof(decimal), item.Key)//.... rest of the declaration

Regards,
Rosen
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Ravindra
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or