How to get the value of a caption summary collumn

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.


5 Replies

HA haneefm Syncfusion Team December 27, 2007 09:12 PM UTC

Hi Wills,

Please refer to the below forum threads and let me know if this helps.
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=24926
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=49480

Best regards,
Haneef



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


Loader.
Up arrow icon