How to get the contents of a row (Model) simply by mousing over the row? I'm trying to cache the row, that is, it's underlying model when a user mouses over the row.
3 Answers, 1 is accepted
0
Accepted
Martin Ivanov
Telerik team
answered on 12 Dec 2019, 02:34 PM
Hello John,
To achieve your requirement, you can subscribe to the MouseEnter event of the GridViewRow elements. To do this, you can use the RowLoaded and RowUnloaded events of RadGridView.
privateobject hoveredRowModel;
privatevoidRadGridView_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
{
if (e.Row is GridViewRow)
{
e.Row.MouseEnter += Row_MouseEnter;
}
}
privatevoidRadGridView_RowUnloaded(object sender, Telerik.Windows.Controls.GridView.RowUnloadedEventArgs e)
{
if (e.Row is GridViewRow)
{
e.Row.MouseEnter -= Row_MouseEnter;
}
}
privatevoidRow_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
{
var row = (GridViewRow)sender;
this.hoveredRowModel = row.Item;
}
Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.
Thank you kind sir... I'm off till Monday... But I'll it then... Thank you so much sir the help, much appreciated... Happy holidays..
0
Martin Ivanov
Telerik team
answered on 13 Dec 2019, 08:51 AM
Hello John,
Happy holidays to you too.
Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.