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

GroupCaption Name

Thread ID:

Created:

Updated:

Platform:

Replies:

34184 Sep 6,2005 07:21 AM UTC Oct 6,2007 02:54 PM UTC WinForms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On September 6, 2005 07:21 AM UTC

I have got a gridgroupingcontrol which is bound to a dataset (which contains multiple tables). Now when I display the grid I see for each group caption the name of the table. How can I change that name without influencing the real table names or the nested table names of the grid. I only want to change the displayed name? I tried it with the RelationDescriptor name but this has also influence on the NestedTable name of the grid. Cheers, Markus

Administrator [Syncfusion]
Replied On September 6, 2005 08:12 AM UTC

Property-wise, you set these properties to control what is shown in the CaptionText. this.gridGroupingControl1.TopLevelGroupOptions.CaptionText = "x"; this.gridGroupingControl1.NestedTableGroupOptions.CaptionText = "x"; This gives you a chance to specify the caption content through a string containing specific tokens. If you cannot show what you want using this tokenized string property, then you can handle the TableControlDrawCellDisplayText event and there dynamically swap out some marker you put into th CaptionText property (or do whatever you need to do to display what you want).
private void gridGroupingControl1_TableControlDrawCellDisplayText(object sender, GridTableControlDrawCellDisplayTextEventArgs e)
{
	if(e.Inner.DisplayText == "x")
	{
		GridTableCellStyleInfo style = e.Inner.Style as GridTableCellStyleInfo;
		e.Inner.DisplayText = style.TableCellIdentity.Table.TableDescriptor.Name;;
	}
}

Administrator [Syncfusion]
Replied On September 6, 2005 08:43 AM UTC

Thanks Clay that works!! Cheers, Markus

Titus Cheung
Replied On October 6, 2007 02:18 PM UTC

Hello,

Sorry but I'm a bit lost here. Can someone please provide all the code required to do this? For example, I don't understand specifically the following:
1) Am I supposed to declare and code the class GridTableControlDrawCellDisplayTextEventArgs?
2) What is e.Inner.DisplayText? Like what does Inner mean?
3) What if I want to use the actual value in the cells of a specific column of a table instead of the table's name? What should I use?style.TableCellIdentity.Table.TableDescriptor.Column1.Cell.Value????

>Property-wise, you set these properties to control what is shown in the CaptionText.
>
>this.gridGroupingControl1.TopLevelGroupOptions.CaptionText = "x";
>this.gridGroupingControl1.NestedTableGroupOptions.CaptionText = "x";
>

>
>This gives you a chance to specify the caption content through a string containing specific tokens.
>
>If you cannot show what you want using this tokenized string property, then you can handle the TableControlDrawCellDisplayText event and there dynamically swap out some marker you put into th CaptionText property (or do whatever you need to do to display what you want).
>

>private void gridGroupingControl1_TableControlDrawCellDisplayText(object sender, GridTableControlDrawCellDisplayTextEventArgs e)
>{
> if(e.Inner.DisplayText == "x")
> {
> GridTableCellStyleInfo style = e.Inner.Style as GridTableCellStyleInfo;
> e.Inner.DisplayText = style.TableCellIdentity.Table.TableDescriptor.Name;;
> }
>}
>

Titus Cheung
Replied On October 6, 2007 02:54 PM UTC

Hello,

Never mind. Just found out that I can goto the Designer, select Properties, Table Descriptor, Grouped Columns and select the column that I want to group by.

I was loading data from a join SQL statement. Initially I used the foreign key which is an integer value to do the sorting.

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

;