Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

How to raise an event when select a row?

$
0
0

I want to do it in code behind. I have a mouse down event when I click a row with mouse.

 

01.privatevoidradGridView_RowLoaded(objectsender, RowLoadedEventArgs e)
02.{
03.     var row = e.Row asGridViewRow;
04.     if(row != null)
05.     {
06.         row.IsCurrent = true;
07.         row.AddHandler(GridViewRow.MouseLeftButtonDownEvent,
08.         newMouseButtonEventHandler(GridViewRow_MouseLeftButtonDown), true);
09.     }
10.}
11. 
12.        privatevoidGridViewRow_MouseLeftButtonDown(objectsender, MouseButtonEventArgs e)
13.        {
14.            // change row color????
15.        }
I want to change the color then. So I thought to raise an event for that. Not sure whether we can do it since we already have an event. Basically the question can be divided two parts. One select row with mouse, two once we get the row, then to raise an event.

Thanks for help.


Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>