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 don't want to become a pest on this forum, but I'm tearing my hair out over a very simple task I want to perform with a data-bound grid.
Upon double-clicking either in a cell in a row or the row header column for that row, I want to capture that event, get the value entered in the first column of that row and run some code based on this value.
I got this to work in a round-about way using the GridDoubleClick event, but at that point, to get the row index of the row double-clicked, I had to have clicked into a cell in the grid _before_ double-clicking on the row header.
Then I decided to try the CellDoubleClick event instead, but I can't even get this to fire at all.
So my two questions are this: how can you get the index of the row double-clicked if you have only clicked in the row header and not a cell in the row? And, how do you get the CellDoubleClick event to fire.
I thought that the latter might have to do with the grid being editable, but when I tried to set EnableEdit to false, I got a runtime error NullReferenceException on that line of code.
Phew. Any help greatly appreciated.
CBClay Burch Syncfusion Team September 20, 2002 01:53 PM UTC
To get the index of the clicked column header in the grid's DoubleClick event, you can use code such as:
Dim pt As Point = GridDataBoundGrid1.PointToClient(Control.MousePosition)
Dim row, col As Integer
GridDataBoundGrid1.ViewLayout.PointToClientRowCol(pt, row, col, True)
col = col + GridDataBoundGrid1.LeftColIndex - 1 ' absolute col
In the 1.0.2.4, release the CellDoubleClick does not fire because of a coding error in the OnDoubleClick method. If you have access to the source, you can see that method is firing the click event instead of the DoubleClick event. This is corrected in the 1.1.0.0 release due out next week.