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
315
Row Keys Client Side
posted

I'm using alot of javascript to interact with my grid, but I'm finding a problem and no solution, which I hope I can get some help with.

So here's the problem, the creation of my row is done on the codebehind, where I assign a "key" value to the row, for example, the last row added will have something on the line of "grid.Rows[grid.Rows.Count].Key = 'Row' + grid.Rows[grid.Rows.Count];", when I debug the codebehind I can see that it's adding the Key correctly, but when I go to the javascript that needs to acess the key of the row, there doesn't seem to be any property with it, I need to know if this "key" value is kept on somewhere else in the row, or if in fact there's no way to get it in the clientside.

 Thanks,

Cláudio Correia

Parents
No Data
Reply
  • 813
    posted

    instead of setting key you can do this thing.

    add a new hidden column and add your key in this column. so in javascript you will be able to access it easily.

    for your problem have you tried this function?

    row.getDataKey()

    I am not sure wheather it returns the key you have added on server side or not but it might help.

    also there is a property called DataKey. if that helps.

Children