Hi Team,
I am adding a new row to webdata grid via client side like this:
var editing = grid.get_behaviors().get_editingCore(); var rowAdding = editing.get_behaviors().get_rowAdding();
rowAdding._commitRow();
What I want to do is as soon as new row gets added, the background color of the row should be yellow.
I tried setting AddNewRowCssClass to a class where background is getting set to yellow but it is not working..
Pelase help
Varun
Hi, Update on this.
I have modified the AddRow client side method to add new row and highlight the same like this
function AddRow()
{
var grid = $find('<%= webdatagrid1="" clientid="">');
var editing = grid.get_behaviors().get_editingCore();
var rowAdding = editing.get_behaviors().get_rowAdding();
var row = grid.get_rows().get_row(grid.get_rows().get_length()-1);
for (var k = 0; k < row.get_cellCount() ; k++)
row.get_cell(k).get_element().style.backgroundColor = "Yellow";
}
Am I doing it right or there is any other better way to do so?
Regards Varun
Hello Varun,
Thank you for contacting Infragistics Developer Support!
You can achieve by handling the RowAdded event of EditingCore behavior. In order to change the background color of the row, you can set a new background to each cell. Each cell has a default color of white, which should be overridden.
function WebDataGrid_Editing_RowAdded(sender, eventArgs) { var row = eventArgs.get_row(); var rowElement = row.get_element(); for (var i = 0; i < rowElement.children.length; i++) { rowElement.children[i].style.backgroundColor = "yellow"; } }
Let me know if you need further assitance