Generic Conditional Cell/Row Styling

2 posts, 1 answers
  1. TripDev
    TripDev avatar
    3 posts
    Member since:
    Jul 2012

    Posted 17 Jul 2013 Link to this post

    Hey, I am attempting to evaluate a Condition for each Cell of each Row. I am aware of OnItemDataBound and plan to use this, however I need the conditions to be more generic.

    The setup I am looking to achieve is:
    A Conditions Data Base Table with the Columns:
    • [TableName]
    • [ColumnName]
    • [Condition]
    • [StyleID]

    When I query the Data Base for any Data I want to also gather all conditions for each column of that table.
    When a row is data bound to the grid I want to evaluate the condition for each cell. If the condition passes I apply the associated style to that cell based on StyleID (Which would be another data base table with BackColor, ForColor, Bold, ect..).

    I would like to be able to pass any data to the Grid and have it run all conditions and apply styles without ever hard coding column names or conditions in the application.

    I am attempting to achieve this because the conditions and styling will be user created by another application.


    Taylor Devereaux
  2. Answer
    Eyup avatar
    2942 posts

    Posted 23 Jul 2013 Link to this post

    Hi Taylor,

    Thank you for contacting us.

    I have prepared a sample RadGrid web site to demonstrate how you can achieve the requested functionality. Please run the attached application and let me know if it helps you.

    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top