The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
we are using a GGC. Assuming we are grouping with a column called "City". This column is removed from the VisibleColumns of the grid.
Now we have multiple entries with different city groups. Now when a user deletes all rows with a city called "San Diego" (e.g.) then the group disappears.
Now what I want is to stay the group even if the last row with "San Diego" was deleted. Because later on the user is able to add a new row for the "San Diego" group again.
ADAdministrator Syncfusion Team August 8, 2006 02:38 PM UTC
Hi,
I thought of empty groups to solve that issue, but I have just read in the forum that empty groups are not possible - that''s fatal for me.
I don''t wanna implement that with multiple tables in a dataset. The grouping feature with just one table seems fairly enough for my needs. So is there a workaround to solve my problem (with hidden rows or something like that)?
Need help please!
Cheers, Franz
ADAdministrator Syncfusion Team August 9, 2006 06:29 AM UTC
Hi Franz,
Could you try this code to cancel the grid''s RecordDeleting event when the parentgroup having one record andthen set the record height to zero. Here is a code snippet.
private void gridGroupingControl1_RecordDeleting(object sender, Syncfusion.Grouping.RecordEventArgs e) { GridGroupingControl grid = sender as GridGroupingControl; Group group = e.Record.ParentGroup; if(group.GetRecordCount() == 1) { int RowIndex = grid.Table.DisplayElements.IndexOf(e.Record); ((IGridRowHeight)grid.TableControl.GetTableViewStyleInfo(RowIndex,0).TableCellIdentity.DisplayElement).RowHeight = 0; e.Cancel = true; grid.Refresh(); } }
Here is a sample. http://www.syncfusion.com/Support/user/uploads/GGCAutoHeightAndResize_92b0b30e.zip
Please let me know if this helps. Best Regards, Haneef
ADAdministrator Syncfusion Team August 9, 2006 01:13 PM UTC
Hi Haneef,
this seems to be a good approach to solve the issue. Another one could be to use multiple tables (with the same columns and so on) in one dataset to simulate the grouping with one table. The only problem with that approach is the different width of the tables (the group cells) in the GGC. For example:
-------------------------------- | Table A | --------------------------------------- | Table B | --------------------------------------- | Table C | -----------------------
But all tables have the same columns (but with different cell content length). Is it possible to make all tables (table groups) the same length to simulate a single table with grouping enabled? So something like this would be great:
--------------------------------------- | Table A | --------------------------------------- | Table B | --------------------------------------- | Table C | ---------------------------------------
Any ideas?
Cheers, Franz
ADAdministrator Syncfusion Team August 10, 2006 07:04 AM UTC
Hi Franz,
Try setting the AllowCalculateMaxColumnWidth property to false to resolve this.
//sets the maximum number of characters found in record field cells should be calculated for columns. this.grid.TableDescriptor.AllowCalculateMaxColumnWidth = false;