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

GridView string format

2 Answers 278 Views
GridView
This is a migrated thread and some comments may be shown as answers.
leapopotomus
Top achievements
Rank 1
leapopotomus asked on 01 May 2008, 12:53 AM
Hi,
since i've upgraded to the Q1 2008 GridView, any type of value formatting has been broken. For example:


1. In the grid view column definition I have set the format as follows:


gridViewDateTimeColumn1.FormatString = "{0:dd/MM/yyyy}";


When the data loads, this format is ignored and the date is shown with the default ToString() value.


2. I have a GroubBy expression declared as follows:


gvMatter.MasterGridViewTemplate.GroupByExpressions.Add("[System] as [s] Group By [s]", "{1}");


When the grid loads, it shows the summary header as s:Something even though it should only be showing the "Something" part of the text.


Can anyone shed some light on this problem?

thanks

2 Answers, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 01 May 2008, 08:45 AM
Hello Bart,

Thank you for reporting those issues. We located the issues reported.
  1. The columns' format string is reset on data binding. As a workaround, I propose setting the format string after binding the grid.
  2. The format string parameter of the GroupByExpressions.Add method is currently ignored. To overcome this issue, set the format string in the group-by expression itself:
    gvMatter.MasterGridViewTemplate.GroupByExpressions.Add("[System] as [s] format '{1}' Group By [s]");  
Your Telerik points have been updated.

Regards,
Evtim
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
leapopotomus
Top achievements
Rank 1
answered on 01 May 2008, 11:07 PM
Thank you,

those solutions worked perfectly!
Tags
GridView
Asked by
leapopotomus
Top achievements
Rank 1
Answers by
Dwight
Telerik team
leapopotomus
Top achievements
Rank 1
Share this question
or