Hi,
I am facing this problem from quite some time Please help me out.
I have a ultraweb grid , i have some of the controls. When i select the row in datagrid ,resptively the values will be shown in the controls. And the grid is uneditable.
So i am trying to save a person by giving the values in my controls. So that i will get my person id. After that i will be getting all my persons and bind to grid. intially the grid selected row will be very first row in the grid.
But i want to select a row by passing the personid to the gird .
That means that is there a way to select row in ultraweb gird by passing an id which is binded to grid.
Please help me on this.
Thanks in advace..!
Sreenivas
Hi Sreenivas,
I apologize for the lengthy delay in answering your request.
On the server handle the InitializeRow event. Compare the PersonID column value for the row to the ID you want to select (probably looking at the DataKey of the row if the PersonID is your DataKeyField). If they match set e.Row.Selected = true (also you can do Grid.DisplayLayout.SelectedRows.Add(e.Row) if you prefer).
I think you want the Row to be the ActiveRow though and not the selected Row from reading your request. If so just replace e.Row.Selected = true with e.Row.Activate().
For a closer look at Activation vs. Selection check out: http://help.infragistics.com/NetAdvantage/ASPNET/2010.2/CLR4.0/?page=WebGrid_Activation_Object.html.