TableItem / DetailsItem

6 posts, 1 answers
  1. Christian Pardun
    Christian Pardun avatar
    112 posts
    Member since:
    May 2010

    Posted 13 Oct 2009 Link to this post

    Hello Telerik-Support team

    I create a report with a table control and some conrols in the details section.

    Currently I want to implement that each table item and each details section item
    get a defined color. This color is defined in the database,

    So the table shows for example 5 items from an table which also has the RGB-Color
    definition. So on showing this items in the report each table row(item) must get this
    color as background.

    The same i want to implement on the details section (items).

    Is this posible and when how? :)

    Greetings
    Christian
  2. Answer
    Steve
    Admin
    Steve avatar
    10941 posts

    Posted 14 Oct 2009 Link to this post

    Hi Christian,

    Consider the following code:

    private void detail_ItemDataBound(object sender, EventArgs e)
           {
               Telerik.Reporting.Processing.DetailSection procDetail = (Telerik.Reporting.Processing.DetailSection)sender;
               Telerik.Reporting.Processing.TextBox txt = (Telerik.Reporting.Processing.TextBox)procDetail.ChildElements.Find("myHexColorDataTextBox", true)[0];
               string hexValue = txt.Text;
               System.Drawing.Color myColor = System.Drawing.ColorTranslator.FromHtml(hexValue);
               txt.Style.BackgroundColor = myColor;
           }

    where myHexColorDataTextBox is a textbox in the detail section bound to your column with HEX values. If you store your values in RGB, then use System.Drawing.Color.FromArgb() instead. Traversing all textbox items in a table would be a bit more of a pain, but it should work.


    Sincerely yours,
    Steve
    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.
  3. DevCraft banner
  4. Christian Pardun
    Christian Pardun avatar
    112 posts
    Member since:
    May 2010

    Posted 14 Oct 2009 Link to this post

    Hi Steve,

    thanks for teh fast reply and this really great idea and solution. Thanks alot for this.:)

    I have an other question about CSS and the skins. I greate a new thread for this. It
    was really nice if you have time to take a look on it.

    Skin Problem

    Thanks alot again.

    Greeting
    Christian
  5. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 15 Oct 2009 Link to this post

    Hi Uwe,

    I'm glad my suggestion helped. However I am not able to open the link in your last post for some reason. Would you provide us with a valid URL so we can review your next question?

    Regards,
    Steve
    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.
  6. Christian Pardun
    Christian Pardun avatar
    112 posts
    Member since:
    May 2010

    Posted 15 Oct 2009 Link to this post

    Hi Steve,

    Unfortunaly I can't it open, too. :(

    Here is the link to the Demo-Website I create for this skin CSS problem:
    CSS Skin Problem (Web)

    You can only see the problem if you start the website in a Browser.

    There is a scope/boarder/scape arround the RadMenu rootitem. This occurs
    after I update my user skin from Q2 2008 to Q2 2009. I'll take the Office 2007
    Skin from telerik an modierd it in the same way I done it with the skin from Q2 2008,

    Hopefully you can remove the boarder arroung the RadMenu rootitem :)

    Thanks again
    Christian
  7. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 15 Oct 2009 Link to this post

    Hello Uwe,

    The problem you talk about is about our ASP.NET web controls and is not relevant to the Telerik Reporting product. We kindly ask you to open a forum/support thread for the exact product (in this case RadMenu control) you have problems with and we would assist you accordingly.

    Kind regards,
    Steve
    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.
Back to Top
DevCraft banner