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

Change css style for row client side

2 Answers 117 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard Boarman
Top achievements
Rank 1
Richard Boarman asked on 02 Sep 2010, 02:45 PM
I have a RadGrid where i need to change the css style for a row for all selected items when a certain button is clicked (client-side)

The style for the row is originally set in ItemDataBound:

If

 

 

dataItem("Printed").Text = "False" Then

 

e.Item.CssClass =

 

"rgRow unViewedEval"

 

 

 

End If

 


I want to change the cssclass for the row to "rgRow viewedEval" once a button is clicked
The button triggers the javascript below:

function

 

 

GetSelectedItems(theGrid) {

 

 

 

var grid = $find(theGrid);

 

 

 

if (grid) {

 

 

 

var MasterTable = grid.get_masterTableView();

 

 

 

var selectedRows = MasterTable.get_selectedItems();

 

 

 

for (var i = 0; i < selectedRows.length; i++) {

 

 

 

var row = selectedRows[i];

 

row.className =

 

'rgRow viewedEval';

 

}

}

}

How do I access the style for each row? Obviously "row.className = " is not it.

2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 02 Sep 2010, 02:54 PM
Hello Richard,

Use

row.get_element().className

Greetings,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Richard Boarman
Top achievements
Rank 1
answered on 02 Sep 2010, 03:30 PM
That's it!, Thanks
Tags
Grid
Asked by
Richard Boarman
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Richard Boarman
Top achievements
Rank 1
Share this question
or