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

Create GridGroupingControl at runtime

Hi,
Is it possible to create GridGroupingControl in code behind page?




5 Replies

RS Rajarajeswari S Syncfusion Team September 23, 2008 08:22 AM UTC

Hi Satish,

Thanks for using Syncfsuion products.

Yes, you can create GridGroupingControl at runtime. Please refer the below code snippet which illustrates this:

protected void Page_Load(object sender, EventArgs e)
{
Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl ggc = new Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl();
ggc.ID = "GridGroupingControl1";
ggc.DataSource = emp1;
this.form1.Controls.Add(ggc);

}

Please refer the sample from the below link, which illustrates the above:

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

Please let me know if this helps you out.

Regards,
Raji





AD Administrator Syncfusion Team September 23, 2008 10:32 AM UTC

Hi,
If record cell value is NULL , How to set NULL value for particular cell.

Thank you
Satish



RS Rajarajeswari S Syncfusion Team September 29, 2008 07:04 AM UTC

Hi Satish,

Sorry for the delay in getting back to you.

We are going to bind the GridGroupingControl with a datasource, which is a collection of records. The below code snippet is used for it:

ggc.DataSource = emp1;

If the DataSource contains null values for the records, Grid is automatically binded with null record. then it shows empty values for those record.

emp1.Add(new Empclass1(001, "xxx", "USA", 23456));
emp1.Add(new Empclass1(002, "www", "USA", 21436));
emp1.Add(new Empclass1(003, "yyy", "UK", 35456));
emp1.Add(new Empclass1(004, "zzz", "USA", 53456));
emp1.Add(null);
emp1.Add(new Empclass1(006, "aaa", "UK", 73756));


In the above snippet, the 5th record contains null value. while binding this with Grid. it shows empty for the 5th record.

Could you please try this with the previously updated sample? and let us know if this helps you out.

Regards,
Raji




MY Muneeb Younsi October 29, 2008 04:33 PM UTC

Hi,

I am working in Deutsche Bank and using SyncFusion. I want to change the cell value at run time. Could you tell me how to do it?

thanx

regards

Muneeb Youns.

>Hi Satish,

Sorry for the delay in getting back to you.

We are going to bind the GridGroupingControl with a datasource, which is a collection of records. The below code snippet is used for it:

ggc.DataSource = emp1;

If the DataSource contains null values for the records, Grid is automatically binded with null record. then it shows empty values for those record.

emp1.Add(new Empclass1(001, "xxx", "USA", 23456));
emp1.Add(new Empclass1(002, "www", "USA", 21436));
emp1.Add(new Empclass1(003, "yyy", "UK", 35456));
emp1.Add(new Empclass1(004, "zzz", "USA", 53456));
emp1.Add(null);
emp1.Add(new Empclass1(006, "aaa", "UK", 73756));


In the above snippet, the 5th record contains null value. while binding this with Grid. it shows empty for the 5th record.

Could you please try this with the previously updated sample? and let us know if this helps you out.

Regards,
Raji






MS Mohamed Suhaib Fahad A. Syncfusion Team November 1, 2008 02:02 AM UTC

Hi Muneeb,

Thanks for using Syncfusion products.

You can use the QueryCellStyleInfo event that gets trigerred for each element / cell when it gets generated. Use the Style parameter to modify your inner text value.

e.Style.Text = "Hello";
e.Handled = true;

Please let me know if you want any more details.

Thanks,
Fahad
ASP.NET Grid Team
Syncfusion Inc.,


Loader.
Live Chat Icon For mobile
Up arrow icon