Query |
Response |
I want to remove that top header which says 6 Items. |
You can hide the caption text by using ShowCaption property of grid.
Code snippet:
//To disable caption for parent table
this.gridGroupingControl1.TopLevelGroupOptions.ShowCaption = false;
//To disable caption for nested tables
this.gridGroupingControl1.NestedTableGroupOptions.ShowCaption = false; |
I want to remove that new line * comes up. |
The ShowAddNewRecordBeforeDetails property can be used to remove the AddNewRecordRow.
Code snippet:
//For parent table
this.gridGroupingControl1.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = false;
//For nested table
this.gridGroupingControl1.NestedTableGroupOptions.ShowAddNewRecordBeforeDetails = false; |
Is there any way I can show only ItemName and ItemPrice in the child Notes Ex If i Expand the InvoicID i can only display Itemname and itemprice |
We have checked that given screenshot, it seems like the records are grouped by “InvoiceId” column.
If the parent table and child table are related by unique column, the child table will show its columns only. We are little bit unclear about the way of adding relations between two tables in your sample project. Here we have provided the simple sample with “RelatedMasterDetails” relation.
Code snippet:
this.gridGroupingControl1.Engine.SourceListSet.Add("InvoiceMaster", parentTable);
this.gridGroupingControl1.Engine.SourceListSet.Add("InvoiceSubDetails", childTable);
GridRelationDescriptor rd = new GridRelationDescriptor();
rd.ChildTableName = "InvoiceSubDetails";
rd.RelationKind = Syncfusion.Grouping.RelationKind.RelatedMasterDetails;
rd.RelationKeys.Add("InvoiceID", "invoiceID");
this.gridGroupingControl1.TableDescriptor.Relations.Add(rd);
UG link:
Please let us know if we missed anything from this scenario. |
As you can see it shows invoiceid, custid, totalamount, discount, NetAmount,payment for each row by invoiceID. Can i merge them so that it can show only once? |
You can merge the cells which having same values in rows of a column and in columns of a row. Please refer to the below code snippet,
Code snippet
//Merging in ParentTable
this.gridGroupingControl1.TableDescriptor.Appearance.AnyRecordFieldCell.MergeCell = GridMergeCellDirection.Both;
this.gridGroupingControl1.TableModel.Options.MergeCellsMode = GridMergeCellsMode.OnDemandCalculation | GridMergeCellsMode.MergeRowsInColumn;// | GridMergeCellsMode.MergeColumnsInRow;
this.gridGroupingControl1.TableModel.Options.MergeCellsLayout = GridMergeCellsLayout.Grid;
this.gridGroupingControl1.TableModel.MergeCells.EvaluateMergeCells(this.gridGroupingControl1.TableControl.GridCellsRange);
//Merging in ChildTable
this.gridGroupingControl1.GetTableDescriptor("InvoiceSubDetails").Appearance.AnyRecordFieldCell.MergeCell = GridMergeCellDirection.Both;
this.gridGroupingControl1.GetTableModel("InvoiceSubDetails").Options.MergeCellsMode = GridMergeCellsMode.OnDemandCalculation | GridMergeCellsMode.MergeRowsInColumn;// | GridMergeCellsMode.MergeColumnsInRow;
this.gridGroupingControl1.GetTableModel("InvoiceSubDetails").Options.MergeCellsLayout = GridMergeCellsLayout.Grid;
this.gridGroupingControl1.GetTableModel("InvoiceSubDetails").MergeCells.EvaluateMergeCells(this.gridGroupingControl1.GetTableControl("InvoiceSubDetails").GridCellsRange);
UG link:
|
I need a way to export data into Excel. I can easily do that by exporting DataTable but it will not be formatted as I want it as looks like in GGC. |
You can export the grid data into excel by using GridGroupingExcelConverter.ExportToExcel method (or) GroupingGridExcelConverterControl.GroupingGridToExcel method.
Code snippet:
GridGroupingExcelConverterControl excelConverter = new GridGroupingExcelConverterControl();
ExcelExportingOptions exportingOptions = new ExcelExportingOptions();
//Export the contents of the grid to Excel.
excelConverter.ExportToExcel(this.gridGroupingControl1, "Sample.xlsx", exportingOptions);
Process.Start("Sample.xlsx");
UG link:
Note:
To avail this export support, please add the below assemblies in your project,
|
Hi Piruthiviraj,
Thank you so much for your help. Yess it did worked.
How ever I've one confusion Is there any option I can create columns at design time for nested or child tables (Design Times)?
Basically I want to create columns for both the views on design time so that I will be only binding data from DB.
For Main View we have options of Columns through which we can create it.
Query |
Response |
However I've one confusion Is there any option I can create columns at design time for nested or child tables (Design Times)? |
We regret to let you know that the GridGroupingControl does not have the support to add the columns for nested tables at design time. The columns for a nested table can be added programmatically by using the Columns property of respective GridTableDescriptor. You can get the correspondind table descriptor of the table by using GetTableDescriptor(). Please make use of below code and sample,
//To add the columns for child table
this.gridGroupingControl1.GetTableDescriptor("MyChildTable").Columns.Add("Category", "Category");
|