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

DataFormatString based on Row not Column

1 Answer 65 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ingólfur
Top achievements
Rank 1
Ingólfur asked on 13 May 2013, 02:57 PM
So I have a basic DataFormatString based on columns but there will be rows that are a exception (they show percentage between the other rows) and I need to format those rows as a percentage number.

I've took a look into both Row- and CellStyleSelector and CellTemplateSelector but not sure any of these can do the trick because they don't seem to manage the DataFormatString.

RowStyle with  <Setter Property="ContentStringFormat" Value="P" /> does nothing, probably because he tries to apply that to the whole row which of course is not a string.

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 13 May 2013, 03:33 PM
Hello,

You could use a CellTemplateSelector and return a DataTemplate with TextBlock which you have formatted appropriately. Does this work for you?
 

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Ingólfur
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or