We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Changing Multiple Cell Values in Code on a GDBG

In my WinForms app I'm displaying the results of a search in a GDBG. The specs call for giving users the ability to update a column (integer value) in the results individually or in bulk. Where I'm encountering a problem is how to handle the bulk update. I loop through the grid like so...
 
Dim RowCnt As Integer = gridMain.Model.RowCount
For Cntr = 1 To RowCnt
   
gridMain(Cntr, 6).CellValue = CInt(textQuantity.Text)
Next
 
But, the row goes into edit mode and only the first row is updated. The edit icon is showing on the row. How do I tell the grid to ignore row editing functionality when the bulk update is occurring?

1 Reply

RB Ragamathulla B Syncfusion Team May 20, 2013 05:33 AM UTC

Hi Frank,

 

Thank you for your interest in sync fusion products,

 

You can update the bulk data’s in to the grid. Please refer to the following code. Which illustrates the same.

 

 

                   grid.Binder.DirectSaveCellInfo = true;

                    try

                    {

                        foreach (GridRangeInfo range in ranges)

                        {

                            for (int i = range.Top; i <= range.Bottom; i++)

                            {

                                double currentValue = Convert.ToDouble(grid[i, range.Left].CellValue);

                                currentValue += value;

                                grid[i, range.Left].CellValue = Convert.ChangeType(currentValue, grid[i, range.Left].CellValueType);

                            }

                        }

                    }

                    finally

                    {

                        grid.Binder.DirectSaveCellInfo = false;

                    }

 

 

Hope this will be helpful for your reference.

 

http://help.syncfusion.com/ug/windows%20forms/grid/Documents/currentcellevents.htm

 

Let me know if you have any further concerns.

 

Regards,

Ragamathullah B.


Loader.
Live Chat Icon For mobile
Up arrow icon