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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Dynamic adding a row to GridGroupingControl in ASP.Net

Thread ID:





99341 May 13,2011 01:32 PM UTC May 25,2011 05:28 AM UTC ASP.NET Web Forms (Classic) 2
Tags: Grouping
Santosh U
Asked On May 13, 2011 01:32 PM UTC

Hi. I am trying to figure out how to dynamically add a record with 3 columns, one of which is a DropDownList, to a GridGroupingControl in ASP.Net. Does a GridGroupingControl in Web support this feature? First record will be hard-coded and others thereafter will be dynamically added.

Thanks in advance.

Christopher Issac Sunder K [Syncfusion]
Replied On May 24, 2011 03:33 PM UTC

Hi Santhosh,

Regret for the delay.

Your query belongs to ASP.Net Grid Team and we have forwarded your query to that team. They will update you the details further.

Appreciate your patience.


Sridhar N [Syncfusion]
Replied On May 25, 2011 05:28 AM UTC

Hi Santhosh,

Thanks for your interest in Syncfusion products.

Query #1"I am trying to figure out how to dynamically add a record with 3 columns, one of which is a DropDownList"

Your requirement can be achieved by adding the record to grid in button click event using AddNewRecord dynamically. The value for the record is set using SetValue() method.DropDownList can be added as ItemTemplate in QueryCellStyleInfo. Please refer the below code snippet.

[Code behind - C#]

void GridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Web.UI.WebControls.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
if (e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell || e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell)
if (e.TableCellIdentity.Column.MappingName == "Category")
{// ItemTemplate Creation.
DropDownList ddl = new DropDownList();
string[] controls = { "Level1", "Level2", "Level3" };
ddl.DataSource = controls;
ddl.SelectedValue = Convert.ToString(e.Style.CellValue);
TemplateClass temp = new TemplateClass(ddl);
e.TableCellIdentity.Column.ItemTemplate = temp;
//Add button click event for adding record
protected void RecordAdd(object sender, EventArgs e)
this.GridGroupingControl1.CurrentTable.AddNewRecord.SetValue("ID", 2);
this.GridGroupingControl1.CurrentTable.AddNewRecord.SetValue("Name", "Company2");
this.GridGroupingControl1.CurrentTable.AddNewRecord.SetValue("Category", "Level2");

For your convenience, we have created sample and the same can be downloaded from the following link.


Please let me know if you have any other questions or concerns.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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