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.

Insert and Append row in GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

74620 Jun 23,2008 06:08 AM Jun 30,2008 09:00 AM ASP.NET Web Forms (Classic) 3
loading
Tags: GridGroupingControl
Kallyani Lanje
Asked On June 23, 2008 06:08 AM

Hi
How can we insert and append the New Row in code behind page using GridGroupingControl.

Kindly provide samples if you have.

Thank you
Kallyani




Rajarajeswari S [Syncfusion]
Replied On June 23, 2008 03:35 PM


Hi,

Thanks for using Syncfusion products.

For inserting or appending a record to the Grid, we have to access the DataSource of the Grid as DataTable and we can add a new row in that, and again we can binded it to the Grid.


Please refer the below code snippet which illustartes this:

DataTable dt = this.GridGroupingControl1.DataSource as DataTable;
DataRow dr5 = dt.NewRow();
dr5[0] = "6";
dr5[1] = " rachel";
dr5[2] = "1";
dt.Rows.Add(dr5);
this.GridGroupingControl1.DataSource = dt;

Please refer the sample from the below link which illustartes this:

http://websamples.syncfusion.com/samples/Grid.Web/6.2.0.40/Grid_Web_AddNewRow/main.htm


Please let me know if you have any other concerns.


Regards,
Raji





Kallyani Lanje
Replied On June 24, 2008 12:35 AM

HI Raji,

Thank you for your response. I am able to add new row using Datatable. but my problem is

we have 2 buttons

1. Insert row button
first we select any of the row in the Grid. then we click the insert button. the empty row will be insert on any of the
grid row position.

2. Append Row button
should be add in the after last row of the grid.


Kindly give some examples.
Thank you,



Rajarajeswari S [Syncfusion]
Replied On June 30, 2008 09:00 AM


Hi Kallyani,


Sorry for the delay in responding you,

You can insert a row in the Grid, if you binded it with ArrayList. Please refer the below code snippet for Inserting and Appending a row in the Grid:

Insertion:

ArrayList arr1 = this.GridGroupingControl1.DataSource as ArrayList;
arr1.Insert(3, new MyClass(007, "Nancy", "UK"));
this.GridGroupingControl1.DataSource = arr1;


Append:

ArrayList arr2 = this.GridGroupingControl1.DataSource as ArrayList;
arr2.Add(new MyClass(008, "Jeorge", "AUS"));
this.GridGroupingControl1.DataSource = arr2;

Please refer the sample from the below link which illustrates this:

http://www.syncfusion.com/support/user/uploads/Insertion_60117936.zip

Please let me know if this helps you out.

Regards,
Raji


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.

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.

;