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

Formatting the Grid...

7 Answers 129 Views
GridView
This is a migrated thread and some comments may be shown as answers.
mark
Top achievements
Rank 1
mark asked on 28 Jul 2009, 10:47 PM
I was wondering if I could ask a couple of formatting questions.  I can bind the data to the grid but...

1.  For the Header, I want to make the column skinnier, but have the Header twice as fat because it is two words...Can I do that?  How...
2.  For a column with negative numbers, if a number is negative, I want to make the value have () around the value and show as red...How can I achieve that?
3.  Last one...For datetime columns...I don't want the time to show up, just the date.  I know how to do this in ASP.net grids, but not your grid...help?

thanks

mark

7 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 29 Jul 2009, 11:25 AM
Hello mark,

1. You should use the HeaderCellStyle property of the column to redefine the style for header cells. Then in the Style you should override the Template for the header style, preferably  with Blend. Here are some forum threads that discuss something similar:

How to Style RadGridView row style.
Wrap Header Text.
Wrap Text Across Columns

2. You can attach to the RowLoaded event of the grid and paint the desired cell. Please examine the attached project in order to see how to do that. As for the "()" you should use an IValueConverter in the column's binding and reformat the value in the converter in whatever way you like. For an example of using a converter please see the following forum post (the idea is exactly the same):

How to display cell content in upper / lower case.

3. You should use the DataFormatString property of the column and specify the appropriate format for the value, for example "{}{0:MM/dd/yyyy}".

A bit off topic, please ask the purchase holder in your company to add you as a License Developer to the purchase the company holds. This will give you full access to our support ticketing system and the support resources we offer. In addition, you will get guaranteed lower response times in accordance with your license. More on license developers you can find on www.telerik.com/account/faqs.aspx. Thank you for your cooperation.

Kind regards,
Ross
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Laurel Carpenter
Top achievements
Rank 1
answered on 29 Jul 2009, 03:53 PM
Thank you very much.

mark
0
mark
Top achievements
Rank 1
answered on 29 Jul 2009, 06:11 PM
2 things.  The "Wrap Header Text" link above doesn't work or I can't get to it.

second, I have requested to be added as the "licensed developer" for your product.  Sorry about that.

thanks

mark
0
Rossen Hristov
Telerik team
answered on 30 Jul 2009, 06:54 AM
Hello mark,

My mistake -- here is the real one. Please, excuse me,

Sincerely yours,
Ross
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Rudolf Bösch
Top achievements
Rank 1
answered on 29 Sep 2009, 07:04 AM
Hi there,
has someone sucessfuly implemented the HeaderText-Wrapping Sample using SL3?

I just tried to use the one from the link above (which works fine with the shipped dll's), but not with Silverlight version 3.0.40723.0 and GridView version 2009.2.812.1030, I get a AG_E_PARSER_BAD_PROPERTY_VALUE error.
0
Pavel Pavlov
Telerik team
answered on 05 Oct 2009, 08:33 AM
Hello Rudolf ,

I have tested the solution with the specified version. It seems you have hit a known issue  - there was a bug in RadGridView which caused exception in certain cases when FrameworkElement is placed as a Header to the column. The issue was fixed. My recommendation is to download the dlls from the  latest internal build and give it a try.  It should be available for download in your Client.NET account. Please excuse us for the inconvenience caused.

Sincerely yours,
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
Rudolf Bösch
Top achievements
Rank 1
answered on 05 Oct 2009, 10:52 AM
Hello Pavel,

Using the latest dev-version did in fact the trick, thanks for your help.

Regards,
Rudolf
Tags
GridView
Asked by
mark
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Laurel Carpenter
Top achievements
Rank 1
mark
Top achievements
Rank 1
Rudolf Bösch
Top achievements
Rank 1
Pavel Pavlov
Telerik team
Share this question
or