Selection Changed Event

Jun 16, 2009 at 2:20 PM

I need to know when the grid selection has changed to another row so that I can update a separate control. I do not know much about events so any help would be appreciated.

Jun 16, 2009 at 2:59 PM
Check out the sourcegrid html documentation, there is a section on controllers which does what you want.
 
It is very straight forward.
 
Cheers,
Derek


 
On Tue, Jun 16, 2009 at 10:20 AM, cerilia <notifications@codeplex.com> wrote:

From: cerilia

I need to know when the grid selection has changed to another row so that I can update a separate control. I do not know much about events so any help would be appreciated.

Read the full discussion online.

To add a post to this discussion, reply to this email (sourcegrid@discussions.codeplex.com)

To start a new discussion for this project, email sourcegrid@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Coordinator
Jun 16, 2009 at 3:56 PM

there is a grid.Selection.SelectionChanged event. You can subscribe to that one

Jun 16, 2009 at 4:30 PM

Yup, I think grid.Selection.SelectionChanged event is what I want to use, but I don't really know how.

I tried adding:

this.dataGrid.Selection.SelectionChanged += new SourceGrid.SelectionChangeEventHandler(this.selectionChange);

And in my code I have:

private void selectionChange(object sender, SourceGrid.SelectionChangeEventArgs e)
{

// code to be executed on selection change

}

But this will not execute. it comes up with an error:

Error 1 Cannot implicitly convert type 'SourceGrid.SelectionChangeEventHandler' to 'SourceGrid.RangeRegionChangedEventHandler'

Coordinator
Jun 16, 2009 at 5:30 PM
Edited Jun 16, 2009 at 5:31 PM

Sorry, but this forum is out of scope for these kind of questions.

 

You could try and read these links:

http://www.google.lt/search?hl=lt&q=.Net+delegate+and+events&btnG=Paie%C5%A1ka&meta=

Apr 21, 2011 at 9:02 AM

Another question/problem with SelectionChanged event:

It works as I want after i've set it

grid.Selection.SelectionChanged += new SourceGrid.RangeRegionChangedEventHandler(Selection_SelectionChanged);

But if I change the selection mode of the Grid (from Cell to Row), the event isn't fired any more. I have to redefine/reset teh SelectionChanged event. Is this normal??

Coordinator
May 19, 2011 at 10:21 AM

Jray,

it is expected behaviour. Is it "normal"? Depends.   The original developer decided, that if you change the selection mode, the attached events are lost.