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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Grouping Caption Text

Thread ID:

Created:

Updated:

Platform:

Replies:

48624 Aug 31,2006 12:58 PM UTC Sep 1,2006 04:50 PM UTC Windows Forms 2
loading
Tags: Grouping
Ajay Bhalegar
Asked On August 31, 2006 12:58 PM UTC

Hi,

I am using a GGC, in it i am grouping by a date.When i am grouping by date i want to show the display date in different format

i have added below code

gridColumnDescriptor = grdMeetInvHistory.TableDescriptor.Columns.FindByMappingName(CalendarModelUpdater.MeetingResultDateColumnName);

gridColumnDescriptor.TableDescriptor.GroupedColumns.Add(MeetingResultDateColumnName);
grdMeetInvHistory.ChildGroupOptions.CaptionText = "{Category}";
gridColumnDescriptor.Appearance.GroupCaptionCell.Format = "dddd dd MMMM yyyy";


but it is not working
is there any way to show the date in different format

Thanks & Regards
Ajay

Administrator [Syncfusion]
Replied On September 1, 2006 06:58 AM UTC

Hi Ajay,

You can handle the QueryCellStyleInfo event to solve this. See the below code snippet for more details.

//form load event.
this.gridGroupingControl1.TableDescriptor.GroupedColumns.Add("MeetingResultDateColumnName" ,ListSortDirection.Ascending);
this.gridGroupingControl1.TableDescriptor.Columns["MeetingResultDateColumnName"].GroupByOptions.CaptionText = "{Category}";

//QueryCellStyleInfo
if(e.TableCellIdentity.TableCellType==GridTableCellType.GroupCaptionCell)
{
GridCaptionRow gcr = e.TableCellIdentity.DisplayElement as GridCaptionRow;
//get value of first group

if(gcr.ParentGroup !=null && gcr.ParentGroup.Category !=null && gcr.ParentGroup.Name == "MeetingResultDateColumnName")
{
e.Style.CellValueType = typeof(System.DateTime);
e.Style.Format = "dddd dd MMMM yyyy";
e.Style.Text = string.Format( "{0}",e.Style.CellValue) ;
}
}

Thanks,
Haneef

Ajay Bhalegar
Replied On September 1, 2006 04:50 PM UTC

Hi Hanif,

Thanks a lot, the code given by you is working fine.

Thanks & Regards
Ajay

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

;