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

[Solved] Applying multiple styles to a RadGrid

1 Answer 198 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Anthony asked on 15 Oct 2009, 01:56 PM
Hi,

I was wondering if it is possible to apply more than one style to rows in a RadGrid. What I mean by this is I have 2 lists I am grabbing information from and adding it to a DataTable which I then bind to the RadGrid. I enumerate through the first list adding the items to the DataTable then the second and and adding the items to the same DataTable. In the rad grid I set the style property as follows:

_theListGrid.MasterTableView.ItemStyle.CssClass =

"listItemBg";

but this applies the style to all of my items.
Is it possible to set the style somewhere else so that my first list has one style and my second list has a different style and for these items to all be in the same RadGrid? If not is there a different approach I can take to have multiple styles?

Thank You

 

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 16 Oct 2009, 02:43 PM
Hi Anthony,

Applying different styles to different data items in RadGrid is possible in the ItemCreated and ItemDataBound server events. I suggest you to try ItemDataBound. You will have to find a way to distinguish from which list the data item is.

http://www.telerik.com/help/aspnet-ajax/grdconditionalformatting.html

Sincerely yours,
Dimo
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.
Tags
Grid
Asked by
Anthony
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or