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

isn't grid columns shows string ?

4 Answers 62 Views
GridView
This is a migrated thread and some comments may be shown as answers.
noman nadeem
Top achievements
Rank 1
noman nadeem asked on 02 Sep 2009, 04:59 AM
hi!
i am using telerik grid i have a data in the column is string like john but its showing this 000000john i dont understand why by default it should be string , when i want to show my data in decimal then its should format it in decimal or number type please tell me short way to make it string any format string that is used in grid columns ?
regards

noman

4 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 02 Sep 2009, 07:09 AM
Hello noman nadeem,

Typically RadGridView  would display any string as it is , without applying any additional formatting unless formatting is explicitly set.

Can you please paste the XAML related to RadGridView definition. Maybe there is a format string accidently left or something like that.

Greetings,
Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
noman nadeem
Top achievements
Rank 1
answered on 02 Sep 2009, 07:56 AM
hi pavel,
this is the xaml for column

if i used DataFormatString="{}{0:G}"  then the heading "Career" shows like that "000000Career"
<telerik:GridViewDataColumn HeaderText="Heading" DataMemberBinding="{Binding headingname3}" DataFormatString="{}{0:G}"  />

if i used without DataFormatString="{}{0:G}"  then the heading "Career" shows like that "000000Career"
<telerik:GridViewDataColumn HeaderText="Heading" DataMemberBinding="{Binding headingname3}" />

no difference
which dataformatstring should i used please tell me i have only string not number type data.

i want to show my heading or data as it is like "Career" shows "Career" not "0000000Career"


Regards,
noman











0
Vlad
Telerik team
answered on 02 Sep 2009, 11:47 AM
Hi noman,

The grid is using standard String.Format to apply DataFormatString property - I'm not sure about standard format to handle your case. You can use IValueConverter instead!

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
noman nadeem
Top achievements
Rank 1
answered on 04 Sep 2009, 12:17 PM
hi!
how to use IValueConverter , i never use it , please tell me how to use in my code.

<telerik:GridViewDataColumn HeaderText="Heading" DataMemberBinding="{Binding headingname3}" DataFormatString="{}{0:G}"  />

thanks
Regards,
noman

Tags
GridView
Asked by
noman nadeem
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
noman nadeem
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or