Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MmRadGrid Row Updates
Message
 
To
30/04/2008 17:11:54
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01314357
Message ID:
01315502
Views:
12
>I am really struggling with row updates using the mmRadGrid. I have used the following code as provided in the MM Developer’s Guide as a starting point:
>
>protected void MmRadGrid1_UpdateCommand(object source, GridCommandEventArgs e)
>{
> // Get the item to be updated
> this.MmRadGrid1.ItemIndex = e.Item.ItemIndex;
>
> // Retrieve the previous Order Detail DataSet
> DataSet dsOrderDetail = (DataSet)Session["dsOrderDetail"];
>
> // Save the DataSet (the GridView automatically binds back)
> this.Save(this.oOrderDetail, dsOrderDetail);
>
> // Reset the edited item and rebind the GridView
> this.MmRadGrid1.ItemIndex = -1;
>}
>
>I am having a problem with the save line. The save attempts to save the data to the database, but I do not have a primary key defined for the parent record because I do not want to save the parent business object at this time. All I want to do is update the child object’s dataset using some of that automagically binding stuff. Is there a way to replace the save method with a method that just updates the dataset and automatically binds the data from the grid? I will save the parent and child data later when the user clicks a different button.

If you just want to update the values and rebind, then you can manually raise the business object’s StateChange event like this:
this.CallStateChange(mmBusinessState.Bind);
This raises the StateChange event and tells any listener UI controls to rebind.

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Reply
Map
View

Click here to load this message in the networking platform