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

very basic question

Thread ID:

Created:

Updated:

Platform:

Replies:

56020 Feb 8,2007 03:25 PM UTC Feb 9,2007 09:16 PM UTC Windows Forms 3
loading
Tags: Tools
Shachar Shimshon
Asked On February 8, 2007 03:25 PM UTC

hi all.
i have a very basic question:
in my ggc, when the user click on a row i want to get the value of the first column.
what is the event and do i get the value?

Administrator [Syncfusion]
Replied On February 8, 2007 06:17 PM UTC

Hi Shachar,

This can be achieved by handling the TableControlMouseDown event of th grid and get the value of the required column in record using the record.GetValue() method. Please refer to the attached sample for implementation and let me know if this helps.

private void gridGroupingControl1_TableControlMouseDown(object sender, GridTableControlMouseEventArgs e)
{
GridTableCellStyleInfo style = e.TableControl.PointToTableCellStyle(new Point(e.Inner.X,e.Inner.Y));
if( style != null )
{
Element el = style.TableCellIdentity.DisplayElement;
if( el.Kind == DisplayElementKind.Record )
{
GridRecordRow rec = el as GridRecordRow;
if( rec != null
&& rec.ParentRecord != null )
MessageBox.Show("FirstColumn Value = " + rec.ParentRecord.GetValue("FirstColumnName") );
}
}
}

Sample : GGCGetRecord.zip

Best regards,
Haneef

Shachar Shimshon
Replied On February 9, 2007 12:12 PM UTC

this grid is very complicated.
to get this simple task, you need to write so much code!
in the standard ms.datagridview it's so much easier!
why dont you have a simple click or select event that's being fired when the user click/select's a row, and then simply takes the row values?

>Hi Shachar,

This can be achieved by handling the TableControlMouseDown event of th grid and get the value of the required column in record using the record.GetValue() method. Please refer to the attached sample for implementation and let me know if this helps.

private void gridGroupingControl1_TableControlMouseDown(object sender, GridTableControlMouseEventArgs e)
{
GridTableCellStyleInfo style = e.TableControl.PointToTableCellStyle(new Point(e.Inner.X,e.Inner.Y));
if( style != null )
{
Element el = style.TableCellIdentity.DisplayElement;
if( el.Kind == DisplayElementKind.Record )
{
GridRecordRow rec = el as GridRecordRow;
if( rec != null
&& rec.ParentRecord != null )
MessageBox.Show("FirstColumn Value = " + rec.ParentRecord.GetValue("FirstColumnName") );
}
}
}

Sample : GGCGetRecord.zip

Best regards,
Haneef

Administrator [Syncfusion]
Replied On February 9, 2007 09:16 PM UTC

Hi Shachar,

Also you can use the TableCotrolCellClick event of the grid to get the first column value in a grid. In the GridGroupingControl, there are couple of Slection mechanisms. One is inherited from the GridControlBase and has no knowledge of any specific functionalities of the GridGroupingControl. The second selection support is a record based selection support that is specific to the GridGroupingControl. Please refer to the below KB article for more details.

http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=344

Here is a attached sample that shows you how get the record information from TableControlCellClick event/SelectedRecordChanged event.
ModifiedGGCGetRecord.zip

Please post your queries in the grid forums section to get a quick response on GridControl.
Essential Grid Forum

Best regards,
Haneef

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

;