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

Formatting Columns in GridGrouping Control

Thread ID:





56753 Feb 20,2007 03:37 PM UTC Feb 22,2007 09:28 PM UTC ASP.NET Web Forms (Classic) 5
Tags: GridGroupingControl
Administrator [Syncfusion]
Asked On February 20, 2007 03:37 PM UTC

I am trying to format various columns in the GridGrouping Control but have not been able to. In the sample code enclosed I have a ViewGrid working the way I would like it to work (via code). I basically remove all the columns first in the grid, create a datatable and populate the data, then I go through the colums and create a BoundColumn for each column in the grid. In the BoundColumn I can specify the DataFormatString and quickly format the data. Does the GridGrouping Control handle something like this. I found an sample on the web site but it was not too clear to me how the columns were being formatted.



Gokul B [Syncfusion]
Replied On February 21, 2007 06:56 PM UTC

Hi David,

Sorry for the delay in getting back to you.

Attached is the sample which is the modified version of "FillGrid.zip"


* In our sample we bind the GridGroup with the Datatable.
* We format the data and display name of the column header using QuerycellStyleInfo event. Could you please update us is this the one you are mentioning?

Please have a look at our attached sample for your references.

Let us know if you have any other queries.

Thanks for using Syncfusion product.


David A. Gonzales
Replied On February 22, 2007 05:19 PM UTC

Thanks. This works like a charm.


David A. Gonzales
Replied On February 22, 2007 06:12 PM UTC

Well, I tried to use the QueryCellStyleInfo to add formatting but now all my buttons will stop firing any events. Anybody have this type of problem? If I take the code out that does the formatting the buttons work again.


David A. Gonzales
Replied On February 22, 2007 08:20 PM UTC

After playing around I came up with a solution to my problem with using the QueryCellStyleInfo event. Instead of defining the formats at that stage I did the following:

protected void SetGridColumnFormat()
NotitiaLoginManager l = new NotitiaLoginManager(cConnect);
NotitiaUser nu = l.GetUser(sUser);
NotitiaDataManager nDM = new NotitiaDataManager(nu);
Guid g = new Guid(gStr);

GridEngine engine = GridGroupingControl1.Engine;
GridTableDescriptor parent = (GridTableDescriptor)engine.TableDescriptor;

String sField;
String sFormat;

sFormat = "N4"; // default format
for (int i = 0; i < parent.Columns.Count; i++)
sField = parent.Columns[i].MappingName.ToString();
if (sField != "RowID")
sFormat = nDM.GetFieldInfo(g, sField, "Format");
parent.Columns[i].Appearance.AnyCell.Format = sFormat;



This is called after I set the DataSource but before I call GridGroupingControl.DataBind().

Works with our custom paging, client-side work and all the rest. Plus it's 3 or 4 times faster than the other method.


Gokul B [Syncfusion]
Replied On February 22, 2007 09:28 PM UTC

Hi David,

Glad that you got it working!.

Let us know if you have any other 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