But it seems to me that using the WebDataGrid is much more difficult than NOT using it. :DDoes anyone know how to select a row in a webdatagrid prorammatically. I'm very sure that this question has been raised at least a thousand times before, but so far not so good. I searched the Internet and could not find a single solution except someone keeps yelling, "go back to ultragrid." Well, I have no choice of dumping the webdatagird. I searched for it in this forum, and only find myself disappointed.
In my imagination, it should be easy as setting the current row to X.
Thanks
Hello DQ ninh,
I am attaching a sample demonstrating how rows may be programmatically selected in WebDataGrid both on the server and client.
In order to achieve selection in WDG/WHDG, the desired rows are to be added to the selected rows collection which may be accessed through the Selection behavior object:
WebDataGrid1.Behaviors.Selection.SelectedRows.Add(WebDataGrid1.Rows[0]);
function selectd3rdRow() { var grid = $find("WebDataGrid1"); grid.get_behaviors().get_selection().get_selectedRows().add(grid.get_rows().get_row(3)); }
Hope this helps. Please do not hesitate to contact me if you have any questions.
Please do not hesitate to contact me if you have any further questions regarding this matter.