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

Window / Edit Grid For RadGrid

1 Answer 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 10 Jul 2011, 04:53 PM
Hello,

I am trying to edit data in a RadGrid by using RadWindow.  I have been using the demo Window/Edit Grid For RadGrid as a sample.  The code appears to be working except that the record that is edited is the first record from the table, not the one I have selected to edit.  Where i am failing is that I am not able to the cell values from the grid source which correspond to the primary key from the query string as mentioned in the demo.  How is this done?

Scott

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 13 Jul 2011, 01:36 PM
Hello Scott,

I tested in the demo, updating after editing is working for the right item. Could you tell us what are the differences in your code?
In the demo, this code is using for setting onclick attribute to the links on ItemCreated event:

editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EmployeeID"], e.Item.ItemIndex);
Here e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EmployeeID"] is returning the primary key, in your case "EmployeeID" should be changed to right corresponding column name.

Greetings,
Vasil
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Grid
Asked by
Scott
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Share this question
or