Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
865
Highlight newly added row
posted

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

Parents
No Data
Reply
  • 865
    posted

    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();

    rowAdding._commitRow();

    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

Children