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

Apply style at code behind for last Row

2 Answers 208 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Saran kumar
Top achievements
Rank 1
Saran kumar asked on 15 Jan 2010, 07:48 AM
hi i need to apply style cssclass at code behind for the last row in the rad grid. the grid may be binding the data dynamically.

any idea? please help

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 15 Jan 2010, 08:18 AM
Hello Saran,

The following code will set the style for last row in grid.
CS:
 
    protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        RadGrid1.MasterTableView.Items[RadGrid1.MasterTableView.Items.Count-1].CssClass = "MyClass"
    } 

CSS:
 
    <style type="text/css"
    .MyClass 
    { 
        background-color: Green; 
    }     
    </style> 

-Shinu.
0
Jose Montero
Top achievements
Rank 1
answered on 26 Mar 2010, 11:43 PM
Hello Shinu:

Do you have a similar example for the MVC Grid?

Thanks in advance!
Jose
Tags
Grid
Asked by
Saran kumar
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jose Montero
Top achievements
Rank 1
Share this question
or