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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

grouping grid

Thread ID:

Created:

Updated:

Platform:

Replies:

96825 Oct 7,2010 09:03 PM UTC Oct 14,2010 08:25 PM UTC WinForms 4
loading
Tags: GridControl
harshini
Asked On October 7, 2010 09:03 PM UTC

in grouping grid column how do i chnage the format

currently it is showing

-Issuer: something - 2 Items

I want this to display as

-Something 2 Items




harshini
Replied On October 8, 2010 08:00 PM UTC

grdDisplayItems.TableDescriptor.Columns[strColumnName].GroupByOptions.CaptionText = "{Category} {RecordCount} Items";

when i changed it to the above code..i dont see my changes it always display in this format

{CategoryCaption}: {Category} - {RecordCount} Items


Nirmal Raja [Syncfusion]
Replied On October 13, 2010 01:15 PM UTC

Hi Harshini,

Thank you for your interest in Syncfusion products.

The Caption text of the GroupedCaption can be changed using the QueryCellStyleInfo, and the grouped value can be retrieved using the Category of the DisplayElement.

Please refer the code below to implement this behavior:
void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.TableCellType == Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellType.GroupCaptionCell)
{
e.Style.Text = e.TableCellIdentity.DisplayElement.ParentGroup.Category.ToString();
}
}


Also refer the attached sample which showcases the behavior:
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=CaptionText-2077938227.zip

Let me know if you have any queries.

Regards,
Nirmal


harshini
Replied On October 13, 2010 02:38 PM UTC

thanks nirmal..

it works if we have to display category-no of items items text
example

bankname - 2 items

should we concatenate with

e.Style.Text = e.TableCellIdentity.DisplayElement.ParentGroup.Category.ToString();

as

e.style.Text += e.TableCellIdentity.DisplayElement.ParentGroup.GetRecordCount();

e.STYLE.tEXT += "Items";




Rajadurai C [Syncfusion]
Replied On October 14, 2010 08:25 PM UTC

Hi Harshini,

Thanks for your update.

The effect of following code will be viewed only when that column is grouped.

this.gridGroupingControl1.TableDescriptor.Columns["Sport"].GroupByOptions.CaptionText = "{Category} {RecordCount} Items";


If you would like to set the caption format for the toplevelgroup(main group), the following setting have to be handled.

this.gridGroupingControl1.TopLevelGroupOptions.CaptionText = "{Category} {RecordCount} Items";


Similarly, for child groups,
this.gridGroupingControl1.ChildGroupOptions.CaptionText = "{Category} {RecordCount} Items";

and for nested tables,
this.gridGroupingControl1.NestedTableGroupOptions.CaptionText = "{Category} {RecordCount} Items";


Please let us know if you have any further concerns.

Regards,
Rajadurai


CONFIRMATION

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.

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

;