Formatting the Grid...

8 posts, 0 answers
  1. mark
    mark avatar
    44 posts
    Member since:
    Mar 2009

    Posted 28 Jul 2009 Link to this post

    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

  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2461 posts
    Member since:
    Oct 2012

    Posted 29 Jul 2009 Link to this post

    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.

  3. Download a free trial of UI for WPF
  4. Laurel Carpenter
    Laurel Carpenter avatar
    4 posts
    Member since:
    Jul 2009

    Posted 29 Jul 2009 Link to this post

    Thank you very much.

    mark

  5. mark
    mark avatar
    44 posts
    Member since:
    Mar 2009

    Posted 29 Jul 2009 Link to this post

    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

  6. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2461 posts
    Member since:
    Oct 2012

    Posted 30 Jul 2009 Link to this post

    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.

  7. Rudolf Bösch
    Rudolf Bösch avatar
    25 posts
    Member since:
    Jun 2009

    Posted 29 Sep 2009 Link to this post

    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.

  8. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2018 posts
    Member since:
    Sep 2012

    Posted 05 Oct 2009 Link to this post

    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.

  9. Rudolf Bösch
    Rudolf Bösch avatar
    25 posts
    Member since:
    Jun 2009

    Posted 05 Oct 2009 Link to this post

    Hello Pavel,

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

    Regards,
    Rudolf

Back to Top
Download a free trial of UI for WPF