Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Need to know what row and column in a flygrid

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

Need to know what row and column in a flygrid
Link Posted: 28-Nov-2005 23:24
Hello!

Below is some code that displays a flygrid consisting of 4 rows and 2 columns.
What I want is to be able to set in some way to make it easy to know on what row and column you are clicking on. Each cell location has a row number and a column number these row number and column number should be highlighed or marked in some way when the user click on any cell. If the user click on the header the row below could be marked.

This is because sometime the Grid contains of perhaps 20 rows and 10 columns then it's quite difficult to see on what row and column you are clicking on.

//Tony

//


public class vertGridFrm : System.Windows.Forms.Form
{
..
...
...
private ArrayList list;
}

public vertGridFrm()
{
    list = new ArrayList();
    FillGrid();  
...
}

private void FillGrid()
{

   vertGrid.Columns.Items.AddRange(new Column[]
   {
       new DynamicallyAutoDetectDataTypeColumn("Value0"),
       new DynamicallyAutoDetectDataTypeColumn("Value1")
    });


   list.Add( new object[] {1, "row 1,col 2"} ) ;
   list.Add( new object[] {2, "row 2, col 2"} ) ;
   list.Add( new object[] {3, "row 3, col 2"} ) ;
   list.Add( new object[] {4, "row 4, col 2"} ) ;

   vertGrid.Rows.DataSource = list;
}
Link Posted: 29-Nov-2005 13:28
Yes, it is possible.
Use FlyGrid.GetHitTestInfoAt method to determine hit test, column, row under specified
coordinates.
Usage of this method you can see in the FlyGrid Class Reference and in the FlyGrid Demo
(TreeView replacement sample, click on MonitorMouse button to monitor hittests).