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

[Solved] How do I set the background image on the first row of the radgrid?

1 Answer 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
quang vo
Top achievements
Rank 1
quang vo asked on 02 Nov 2009, 09:39 AM
I have try everything but I could not set the background image of the first row of the grid. can some please help?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 02 Nov 2009, 11:27 AM
Hi,

You can set the background image for a row in the grid using the following code from server side:
c#:  
protected void RadGrid1_PreRender(object sender, EventArgs e)  
    {  
        RadGrid1.MasterTableView.Items[0].CssClass = "myRow";  
    }  

OR set it on client as shown below:
js:
var row = $find('<%= RadGrid1.ClientID %>').get_masterTableView().get_dataItems()[0];  
row._element.className = "myRow"

and then set the following css code:
css:
.myRow 
    { 
       background-image:url('Images/Image1.png');     
    } 

Thanks
Shinu.
Tags
Grid
Asked by
quang vo
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or