The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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.
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.
ADAdministrator Syncfusion Team 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);
}
SSSteve SmithJuly 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);
>}
>