This is a migrated thread and some comments may be shown as answers.

Screen Position of a cell

1 Answer 121 Views
VirtualGrid
This is a migrated thread and some comments may be shown as answers.
Saji
Top achievements
Rank 1
Saji asked on 12 Jan 2017, 04:16 PM

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.

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 13 Jan 2017, 08:18 AM
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.
Tags
VirtualGrid
Asked by
Saji
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or