Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Displaying Error Icon in GridView
Message
From
17/09/2010 14:56:39
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
17/09/2010 14:06:28
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01481137
Message ID:
01481661
Views:
34
>>>>>>Hi,
>>>>>>
>>>>>>I've got an ASP.NET form with an mmGridView showing the many side of a one to many relationship between two tables. When a value in this grid is changed to one that causes a business rule to fail the error icon does not get displayed in the grid. How can I achieve this?
>>>>>
>>>>>Am I doing something out of the norm here that no one has encountered this?
>>>>
>>>>Hi Frank,
>>>>
>>>>I don't think so and I have had others with this challenge. To be honest, editing in a grid can be complicated real easy. I rarely do it only because I don't like dealing with editing in grids. I prefer to provide editing forms. How do you have your in place editing setup? Are you using edit templates?
>>>>Tim
>>>
>>>So you display a separate web page when the user edits each row of the many side of a one to many relationship?.
>>
>>Not necessarily. Since I am using Telerik, I can use a User Control form within the grid. Check these out.
>>http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultcs.aspx
>>
>>>
>>>Yes I am using item and edit item templates in the grid
>>Then if the save fails are you preventing the edit mode from finishing?
>>
>>
>>protected void grdStuff_UpdateCommand(object source, GridCommandEventArgs e)
>>{
>>     // Get your dataset back and do whatever work you need to do before the save
>>     //
>>     // See if the data gets saved and check for broken rules.
>>     if(this.Save(this.oBizObj, dsMyData)  ==  mmSaveDataResult.RulesBroken)
>>     {
>>           e.Canceled = true;
>>           e.Item.Edit = true;
>>     }
>>     //  Reset the edited item and rebind
>>     this.grdStuff.ItemIndex = -1;
>>}
>>
>
>
>Tim,
>
>I just had a look at the telerik demo. Does that mean that in a one to many situation you let the user edit the many side, and then save just that record? What happens if the user makes a change on the many side and saves it, then wants to discard the overall changes?

You can still treat that however the situation dictates. If you allow them to create an order, then add order items you then save the whole order and detail at the same time. If you wish the records to be added to the grid doesn't mean it has to be added to the table until you are ready.
Tim
Timothy Bryan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform