This question is locked. New answers and comments are not allowed.
HI,
I want Row When it is highlighted. I dont want Selected Row But, Highlighted Row. (Selected Row = Orange Color , Highlighted Row = Yellow Color)
I get NULL in RadtreelistView.CurrentRow.
Find attached files for ease.
I want Row When it is highlighted. I dont want Selected Row But, Highlighted Row. (Selected Row = Orange Color , Highlighted Row = Yellow Color)
I get NULL in RadtreelistView.CurrentRow.
Find attached files for ease.
5 Answers, 1 is accepted
0
Hello,
In order to achieve your goal, you can subscribe to GridView's MouseMove event and get the GridViewRow element by using the ParentOfType<> extension method. Please check the following code snippet for a reference:
I hope this helps.
Regards,
Yoan
Telerik
In order to achieve your goal, you can subscribe to GridView's MouseMove event and get the GridViewRow element by using the ParentOfType<> extension method. Please check the following code snippet for a reference:
public MainPage()
{
InitializeComponent();
this.clubsGrid.MouseMove += clubsGrid_MouseMove;
}
void clubsGrid_MouseMove(object sender, MouseEventArgs e)
{
var element = e.OriginalSource;
var row = (element as FrameworkElement).ParentOfType<
GridViewRow
>();
if (row != null)
{
//your code
// Debug.WriteLine((row.Item as Club).StadiumCapacity.ToString());
}
}
I hope this helps.
Regards,
Yoan
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
0
Ishita
Top achievements
Rank 1
answered on 26 Apr 2014, 04:31 AM
Yes, It helped me,
Actually, i want a context menu to be assiciated with this highlighted row and needed highlighted row, mouse move is gonna call all the time, any better solution ?!!
Actually, i want a context menu to be assiciated with this highlighted row and needed highlighted row, mouse move is gonna call all the time, any better solution ?!!
0
Accepted
Chirag
Top achievements
Rank 1
answered on 26 Apr 2014, 04:34 AM
Hello Ishita
you can achieve your goal by adding mouse click event on row as below
i hope this will help to you
you can achieve your goal by adding mouse click event on row as below
<
telerik:RadTreeListView
x:Name
=
"radTreeListView"
AutoGenerateColumns
=
"true"
Grid.Row
=
"1"
RowIsExpandedChanged
=
"radTreeListView_RowIsExpandedChanged"
RowLoaded
=
"radTreeListView_RowLoaded"
>
private
void
radTreeListView_RowLoaded(
object
sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
{
var row = e.Row
as
TreeListViewRow;
if
(row !=
null
)
{
row.MouseRightButtonUp += row_MouseRightButtonUp;
}
}
void
row_MouseRightButtonUp(
object
sender, MouseButtonEventArgs e)
{
radTreeListView.SelectedItem =((Telerik.Windows.Controls.GridView.GridViewRow)(sender)).DataContext
}
i hope this will help to you
0
Accepted
Hi Ishita,
As Chirag said, you can use GridView's RowLoaded event. Then you can subscribe to row's MouseEnter event like so:
Regards,
Yoan
Telerik
As Chirag said, you can use GridView's RowLoaded event. Then you can subscribe to row's MouseEnter event like so:
void clubsGrid_RowLoaded(object sender, RowLoadedEventArgs e)
{
e.Row.MouseEnter += Row_MouseEnter;
}
void Row_MouseEnter(object sender, MouseEventArgs e)
{
//your logic here....
var element = e.OriginalSource;
var row = (element as FrameworkElement).ParentOfType<
GridViewRow
>();
if (row != null)
{
Debug.WriteLine((row.Item as Club).StadiumCapacity.ToString());
}
}
Regards,
Yoan
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
0
Ishita
Top achievements
Rank 1
answered on 01 May 2014, 11:32 AM
yes. Thanks Given solution helped! :)