WebGrid: Batch update bug

2 replies. Last post: November 15, 2010 3:42 AM by Yudi
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hi,

   I’ve spent one complete day to find the cause of this nasty bug.

I’ve a GRID, with option of AllowBatchUpdate="True"

So I had a problem, when I was updating the batch and sending it to the server it was throwing an error message unhandled error null object….etc

And this is the only grid have that error, the rest were ok updating the batch.

After spending good time to find out what is wrong, here is the error root cause:

I had this column definition:

<ISWebGrid:WebGridColumn Caption="Discount" DataMember="PromotionDiscount"

                                                                    Name="Discount"Width="70px"DataType="System.Decimal">

                                                                    <HeaderStyleCursor="Hand"Font-Italic="True"Font-Underline="True"HorizontalAlign="Center"/>

                                                                </ISWebGrid:WebGridColumn>

So as you can see, the DataMember = “PromotionDiscount” while  the Name=”Discount” and that for some reason causing a problem to the batch update, they have to be exactly the same, and when I changed it to:

<ISWebGrid:WebGridColumn Caption="Discount" DataMember="PromotionDiscount"

                                                                    Name="PromotionDiscount"Width="70px"DataType="System.Decimal">

                                                                    <HeaderStyleCursor="Hand"Font-Italic="True"Font-Underline="True"HorizontalAlign="Center"/>

                                                                </ISWebGrid:WebGridColumn>

It worked fine!

I guess your developers instead of reading the DataMember field to set and read from the datasource, they used the Name field instead!!

 

That doesn't happen when we don't use the batch update!! I mean go normal and update the data instantly.


My work around fix the issue by renaming the name to match the DataMember, but other people may not be able to find that fix!


Thanks,

Maged

 

All times are GMT -5. The time now is 10:56 PM.
Previous Next