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
close icon

Working With GridGroupControl

Hi,

I am new to Syncfusion and using v7.2.0.37, I want to do following things with GGC. Kindly Help

1. Add Multiple Header Rows
2. Auto-Resize Columns to fit contents
3. Right Align Numeric Columns (I am using Predefined Formating)
4. I have add summary but it is not summarizing first two out of 12 columns
5. When there is no data in Grid, The GGC Moves at bottom of page
6. I am trying to export GGC to excel, word and it is not working. following is the code

protected void Button3_Click(object sender, EventArgs e)
{
GridExcelExport excel = new GridExcelExport(this.GridGroupingControl1, "export.xls");
excel.ExportNestedTable = true;
excel.Export();
}
protected void Button4_Click(object sender, EventArgs e)
{
GridWordExport word = new GridWordExport(this.GridGroupingControl1, "export.doc");
word.ExportNestedTable = true;
word.Export();
}

7. I also want to Print grid from my own command button, is there any to do it?

7 Replies

MR Muhammad Rizwan Idrees June 24, 2009 04:00 AM UTC

Anyone there who is using v 7.2.0.37 or Support person?????????


RP Rekha P Syncfusion Team June 24, 2009 07:23 AM UTC

Hi Rizwan,

Thank you for your interest in Syncfusion Products.

1. Add Multiple Header Rows

GridGroupingControl allows the user to span a column across multiple grid rows or columns. This is possible through the GridColumnSpanDescriptor, which provides information about a column that can span multiple grid rows or columns. GridColumnSpanDescriptor Collection Editor is used to span the columns, which are returned by the ColumnSets property from the TableDescriptor.

Please refer a code snippet below to achieve this.

















This feature has also been illustrated in the online sample,
http://samples.syncfusion.com/ASPNET/7.2.0.37/web/grid.grouping.web/samples/3.5/MergedRows/MultiEmployeeRecords/cs/multiemprecords.aspx

2. Auto-Resize Columns to fit contents

By default, GridGroupingControl fits with the column contents by enabling the property AutoFit. If this property is set to false (AutoFit="False"), then Grid contents are displayed with 100% width dependent on the browser. You can also set column width for the Grid columns dynamically like,

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.GridGroupingControl1.AutoFit=true;
}
foreach (GridColumnDescriptor gcd in this.GridGroupingControl1.TableDescriptor.Columns)
{
gcd.Width = 90;
}
}


3. Right Align Numeric Columns

The property HorizontalAlignment is used to specify horizontal alignment (Right, Left, Center) of text in the cell using QueryCellStyleInfo event handler, as it occurs for each cell before this control renders it and lets users customize the display of cells.. Please refer the code snippet below to achieve this.

void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell ||
e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell ||
e.TableCellIdentity.TableCellType == GridTableCellType.AnyGroupCell ||
e.TableCellIdentity.TableCellType == GridTableCellType.RowHeaderCell)
{
if (e.TableCellIdentity.Column.Name == "Total")
{
e.Style.HorizontalAlignment = Syncfusion.Windows.Forms.Grid.GridHorizontalAlignment.Right;
e.Handled = true;
}
}
}


4. I have add summary but it is not summarizing first two columns

I am afraid that I am unable to reproduce this reported issue. I have created a simple sample to test this issue and the sample is available from below link.
http://files.syncfusion.com/support/GGC.Web/7.2.0.37/57259/main.htm

Code Snippet:





SummaryType="Count">

SummaryType="DoubleAggregate">

Format="{Sum}" Name="Value 3" SummaryType="DoubleAggregate">






Have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample so that we could sort out the cause of the issue and provide you a solution?

Also, please find the above sample illustrating the solutions for first three queries and let me know if these helps you out.

5. When there is no data in Grid, The GGC Moves at bottom of page

I am afraid that I am unable to reproduce the reported issue. I have created a simple sample to test this issue and I am able to export the Grid data successfully and the sample is available from below link.
http://files.syncfusion.com/support/GGC.Web/7.2.0.37/F83042/main.htm

6. I am trying to export GGC to excel, word and it is not working

I am afraid that I am unable to reproduce the reported issue. I have created a simple sample to test this issue and I am able to export the Grid data successfully and the sample is available from below link.
http://files.syncfusion.com/support/GGC.Web/7.2.0.37/57257/main.htm

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample so that we could sort out the cause of the issue and provide you a solution?

7. I also want to Print grid from my own command button, is there any to do it?

We regret to let you know that currently we do not provide support for this feature and it is achieved only through ButtonBars Navigation item in our code library. This feature has been already confirmed as a feature request and we have logged a request in our feature management system. We will get back to you once this feature is implemented.

Please let me know if you have any other concerns.

Thanks,
Rekha


DC Domnic Coutinho August 29, 2009 10:05 AM UTC

I am facing the same problem regarding null values when bound to the grid group control


I recieve this error message -

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Exception has been thrown by the target of an invocation.


RP Rekha P Syncfusion Team September 3, 2009 01:32 PM UTC

Hi Domnic,

I am afraid that I am not able to reproduce this issue. Also I have created a simple sample and tested this issue and it is available in the below link:

http://files.syncfusion.com/support/GGC.Web/7.3.0.20/F83042/main.htm


Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample so that we could sort out the cause of the issue and provide you a solution?

Thanks,
Rekha


DC Domnic Coutinho September 4, 2009 12:00 PM UTC

Well I was discussing about GridGroupControl That doesnt have any records.

When my datasource is bound to count of 0 i get an invocation error

In the below code Im returning objServiceSearchResponse.ServiceSearchResponseData as 0, ie the Count is 0 ,

but it displays fine for records having count>0.



SynGGCServiceSearch.DataSource = objServiceSearchResponse.ServiceSearchResponseData;


Thanks


DC Domnic Coutinho September 16, 2009 05:29 AM UTC

Any Updates ?


MW Melba Winshia Syncfusion Team September 16, 2009 10:25 AM UTC

Hi Domnic,

Thank you for the update.

I am afraid that I am not able to reproduce this issue if datasource is bound to count of 0 also. Please refer the test sample from the following link that I have used to test this issue:

http://files.syncfusion.com/support/GGC.Web/7.3.0.20/83042_Grid/main.htm

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample so that we could sort out the cause of the issue and provide you a solution?

Thanks,
Melba


Loader.
Live Chat Icon For mobile
Up arrow icon