This is a migrated thread and some comments may be shown as answers.

[Solved] Working with Grid and Window of telerik for Asp.net mvc

1 Answer 71 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Karim
Top achievements
Rank 1
Karim asked on 10 Jan 2012, 09:15 PM
HI,
we have recently bought the Telerik Ultimate Collection for .NET in our company.
i have a small problem with telerik Grid for Asp.net MVC.
I have a grid Binded from my DB, in my Grid i have an action column that contains an update button to load the information of each row in a Window that contain a form with the needed fields, after doing the modifcation i validate my form by clicking on a validate button that will send a request to the DB to update the row informations. Now there is my question, after binding my grid i would like to get the updated row selected (I have the Id of the row).I 'd like to do the same thing when adding a new record that means i will get the added row selected after binding my grid.
I hope my request was clear.
Thank you.  

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 13 Jan 2012, 01:54 PM
Hi Karim,

I am not sure what binding are you using.
If you are using Server Binding then I think the Server Selection demo will help you with your scenario.
If you are using Ajax Binding, there aren't any supported methods for selecting a row on the client. However, triggering a click event on the row you wish to select will have the same effect. The OnRowDataBound event could be used to check which row should be selected. For example:
function onRowDataBound(e) {       
    var id = 'The id of the updated/inserted item'.
    if (e.dataItem.ID == id) {
        $(e.row).click();
    }
}


Greetings,
Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
General Discussions
Asked by
Karim
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or