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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to insert new blank row in gridgrouping control?

Thread ID:

Created:

Updated:

Platform:

Replies:

117591 Nov 13,2014 06:29 AM UTC Nov 17,2014 10:33 AM UTC Windows Forms 3
loading
Tags: GridGroupingControl
Paurnima
Asked On November 13, 2014 06:29 AM UTC

Hi,
I want to insert new blank row after multiple records are deleted from grid grouping control,
I am using ,
this.gridGroupingControl1.TopLevelGroupOptions.ShowAddNewRecordAfterDetails = true;
after Delete() but it doesn't work.
When I click on row it gives "Object reference not set to an instance of an object".
Is any solution regarding this?


Regards,
Paurnima.

Muthukumar Kalyanasundaram [Syncfusion]
Replied On November 13, 2014 06:46 PM UTC

Hi Paurnima,

 

Thank you for your interest in Syncfusion products.

 

If you want to insert a new blank row after multiple records are deleted in gridgroupingcontrol, you can enabled the “AllowNew” property as true. Please refer the below code,

 

Code:

 

private void buttonAdv1_Click(object sender, EventArgs e)

   {

     foreach (var tbl in this.gridGroupingControl1.Table.SelectedRecords)   // delete multiple record

      {

         tbl.Record.Delete();

      }

       this.gridGroupingControl1.TableDescriptor.AllowNew = true;           

   }

 

Please let us know if you have any concern.

 

Regards,

Muthukumar K


Paurnima
Replied On November 15, 2014 09:14 AM UTC

Hello,
I tried the code but it can't help.
I am trying to delete multiple records at a time from grid grouping control using
  this.gridgroupingcontrol.TableModel.Options.SelectCellsMouseButtonsMask = MouseButtons.Left;
  this.gridgroupingcontrol.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended;
  this.gridgroupingcontrol.TableOptions.AllowSelection = GridSelectionFlags.None;
And then want to insert new row in gridgroupingcontrol but it gives me object reference error.
Please give me any solution.
Regards,
Paurnima.


Muthukumar Kalyanasundaram [Syncfusion]
Replied On November 17, 2014 10:33 AM UTC

Hi Paurnima,

 

If you want to insert new blank row in the bottom section of the group, you can set the “ShowAddNewRecordAfterDetails” property  to true. Please refer the below code,

 

Code:

 

Suggestion 1 :

 

private void buttonAdv1_Click(object sender, EventArgs e)

        {

            foreach (var tbl in this.gridGroupingControl1.Table.SelectedRecords)

            {

                tbl.Record.Delete();

             

            }

               this.gridGroupingControl1.TopLevelGroupOptions.ShowAddNewRecordAfterDetails = true;

               this.gridGroupingControl1.TableDescriptor.AllowNew = true;

               this.gridGroupingControl1.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = false; 

        }

 

Please let us know if you have any concern.

 

Regards,

Muthukumar K


Attachment: MultirecordSelection_Delect_f92aec20.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;