Getting the Rowindex

Hi,


How to get the rowindex for row while clicking disabled column of that particular row.

is it possible?

Ragards.

Leema

4 Replies

AD Administrator Syncfusion Team January 10, 2007 11:22 AM UTC

Hi Leema,

You can handle the MouseClick event of the grid and use PointToRowCol method to get the rowIndex and colIndex of the clicked cells in a grid. Here is a code snippet.

//Form load event handler
this.gridDataBoundGrid1.MouseClick += new MouseEventHandler(gridDataBoundGrid1_MouseClick);

void gridDataBoundGrid1_MouseClick(object sender, MouseEventArgs e)
{
GridDataBoundGrid grid = sender as GridDataBoundGrid;
int row, col;
grid.PointToRowCol(new Point(e.X, e.Y),out row,out col);
Console.WriteLine("Clicked CellPos {0},{1}", row, col);
}

Best Regards,
Haneef


LE leemarose January 10, 2007 11:31 AM UTC

hi haneef!

I dont have mouseclick event in griddataboundgrid

grid.

what to do? any other suggestions.

regards,
leema


AD Administrator Syncfusion Team January 10, 2007 11:53 AM UTC

Hi Leema,

The MouseClick event only available in the .Net 2.0. Try handling the MouseDown event of the grid. Please refer to the attached sample for implementation.

Sample : GDBGEnaledClick.zip

Best Regards,
Haneef


LE leemarose January 10, 2007 12:26 PM UTC

Hi hannef!

it worked out.

thanks a lot.

regards..

Leema


Loader.
Up arrow icon