Screen Position of a cell

2 posts, 0 answers
  1. Saji
    Saji avatar
    13 posts
    Member since:
    Mar 2016

    Posted 12 Jan Link to this post

    Hi Telerik,

    In RadGridView, it was possible to use  

    cell.PointToScreen(cell.BoundingRectangle.Location)

    to obtain the current screen position of a cell. What is the equivalent approach in RadVirtualGrid to obtain a cell's top/left from screen's point of view ?

    Thank you,

    Saj.

  2. Dess
    Admin
    Dess avatar
    2099 posts

    Posted 13 Jan Link to this post

    Hello Saj,

    Thank you for writing.  

    In order to get the screen location of a cell in RadVirtualGrid you can refer to the following code snippet:
    public RadForm1()
    {
        InitializeComponent();
        this.radVirtualGrid1.ColumnCount = 3;
        this.radVirtualGrid1.RowCount = 10;
        this.radVirtualGrid1.CellValueNeeded += radVirtualGrid1_CellValueNeeded;
        this.radVirtualGrid1.CellClick += radVirtualGrid1_CellClick;
    }
     
    private void radVirtualGrid1_CellClick(object sender, Telerik.WinControls.UI.VirtualGridCellElementEventArgs e)
    {
        Console.WriteLine(e.CellElement.PointToScreen(e.CellElement.Location));
    }
     
    private void radVirtualGrid1_CellValueNeeded(object sender, Telerik.WinControls.UI.VirtualGridCellValueNeededEventArgs e)
    {
        e.Value = "Data" + e.RowIndex + "" + e.ColumnIndex;
    }

    I hope this information helps. Should you have further questions I would be glad to help.

    Regards,
    Dess
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top