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

Determining current element

Thread ID:

Created:

Updated:

Platform:

Replies:

31928 Jul 18,2005 07:56 PM UTC Jul 19,2005 08:12 PM UTC WinForms 3
loading
Tags: Grouping
Steve Smith
Asked On July 18, 2005 07:56 PM UTC

I''m trying to determine the current element from the TableControlCellClick event. The following line *should* give the the element that I click: Console.WriteLine(e.TableControl.Table.CurrentElement.ToString) However, I find it''s always one click behind. When I click on a new element, it shows the last one I clicked on. If I click a 2nd time, it shows the correct element. (I get the same behavior with TableControlCellMouseUp, too). Any thoughts as to what I''m doing wrong? Thanks! Steve.

Steve Smith
Replied On July 18, 2005 09:38 PM UTC

One thing I forgot to mention - when clicking on a record, the WriteLine entry is correct. The "goofy" behavior only happens when I click on a header. Thx! Steve. >I''m trying to determine the current element from the TableControlCellClick event. The following line *should* give the the element that I click: >Console.WriteLine(e.TableControl.Table.CurrentElement.ToString) > >However, I find it''s always one click behind. When I click on a new element, it shows the last one I clicked on. If I click a 2nd time, it shows the correct element. (I get the same behavior with TableControlCellMouseUp, too). > >Any thoughts as to what I''m doing wrong? > >Thanks! >Steve.

Administrator [Syncfusion]
Replied On July 19, 2005 08:54 AM UTC

I suspect the reason this is happening is that headers cannot get focus (and thus are not the current element). If you want to get the element that was clicked (whether it is a header or record or ??), you can try this code. private void gridGroupingControl1_TableControlCellClick(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellClickEventArgs e) { GridTableCellStyleInfo style = e.TableControl.Model[e.Inner.RowIndex, e.Inner.ColIndex]; Console.WriteLine(style.TableCellIdentity.DisplayElement); }

Steve Smith
Replied On July 19, 2005 08:12 PM UTC

That did the trick. Thanks loads!! Steve >I suspect the reason this is happening is that headers cannot get focus (and thus are not the current element). > >If you want to get the element that was clicked (whether it is a header or record or ??), you can try this code. > >private void gridGroupingControl1_TableControlCellClick(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellClickEventArgs e) >{ > GridTableCellStyleInfo style = e.TableControl.Model[e.Inner.RowIndex, e.Inner.ColIndex]; > Console.WriteLine(style.TableCellIdentity.DisplayElement); >} >

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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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

;