Hi,
.NET2003,Syncfustion 3.2.1.0
I try to get the value of a caption summary collumn.but can't get the rowindex of it(it return -1 for a summary row on caption).
how to do it.
need your help.
Thanks.
HA
haneefm
Syncfusion Team
December 27, 2007 09:12 PM UTC
WJ
Wills Jiang
December 30, 2007 07:17 AM UTC
Thanks for your reply.
I have went through the articles.It is useful.
But Actrually what I want to do is:
Mouse click a cell of the GroupingControl,and get the value from a raw data row and a summary row on caption.
I can get value of raw data row ,but cann't for summary row on caption
HA
haneefm
Syncfusion Team
January 4, 2008 07:02 PM UTC
Hi Wills,
To get get the CaptionText in TableControlCellClick event, please try these code.
void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
{
GridTableCellStyleInfo Style = e.TableControl.Table.GetTableCellStyle(e.Inner.RowIndex, e.Inner.ColIndex) as GridTableCellStyleInfo;
Element el = Style.TableCellIdentity.DisplayElement;
if (el.Kind == DisplayElementKind.Caption)
{
string CaptionText = el.GetCaptionSection().ParentGroup.CategoriesToString();
Console.WriteLine(CaptionText);
}
}
Best regards,
Haneef
WJ
Wills Jiang
January 14, 2008 08:46 AM UTC
Hi Haneef,
Thanks for your reply.
I tried the code,
but it prompts a message:
'Syncfusion.Grouping.Element' does not contain a definition for 'GetCaptionSection'
hot to solve it?
Thanks a lot.
Regards
Wills
HA
haneefm
Syncfusion Team
January 22, 2008 10:52 PM UTC
Hi Wills,
You can use the below code snippet to get the caption section from the element.
public CaptionSection GetCaptionSection(Element el)
{
CaptionSection cs = el as CaptionSection;
if (cs == null && el != null)
cs = el.ParentSection as CaptionSection;
return cs;
}
Best regards,
Haneef