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
170
Using a library should be easier than NOT using a library.
posted

But it seems to me that using the WebDataGrid is much more difficult than NOT using it. :D

Does 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

Parents
No Data
Reply
  • 49378
    posted

    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.
    WDGSelection.zip
Children