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

Generic Conditional Cell/Row Styling

1 Answer 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
TripDev
Top achievements
Rank 2
TripDev asked on 17 Jul 2013, 12:50 PM
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.

Thanks,

Taylor Devereaux

1 Answer, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 23 Jul 2013, 12:54 PM
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.

Regards,
Eyup
Telerik
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.
Tags
Grid
Asked by
TripDev
Top achievements
Rank 2
Answers by
Eyup
Telerik team
Share this question
or