PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework DataGrid and ContextMenu (CF 2)

Reply

DataGrid and ContextMenu (CF 2)

 
Thread Tools Rate Thread
Old 10-11-2007, 07:24 AM   #1
Fred
Guest
 
Posts: n/a
Default DataGrid and ContextMenu (CF 2)


Hello,

I have a DataGrid with a BindingSource and a ContextMenu.
I would like to change the Current property of the BindingSource before
the ContextMenu appears so that it matches the clicked row.
Is there a way to do this ?

Thanks for your help.

--
Fred
http://www.cerber mail.com/?3kA6ftaCvT (enlever l'espace)

  Reply With Quote
Old 14-11-2007, 06:47 AM   #2
Fred
Guest
 
Posts: n/a
Default Re: DataGrid and ContextMenu (CF 2)

Dans : news:ubK72q2IIHA.5328@TK2MSFTNGP05.phx.gbl,
Fred disait :
> Hello,
>
> I have a DataGrid with a BindingSource and a ContextMenu.
> I would like to change the Current property of the BindingSource
> before the ContextMenu appears so that it matches the clicked row.
> Is there a way to do this ?


No idea ? Or perhaps my question is not so clear ?
I explain another way to do, perhaps there is an easier solution to
succeed with this other method.
I tried to create the context menu in the MouseDown event (In this case,
I can change the selected row of my DataGrid using HitTestInfo.
In the MenuClick event I launch an action that hides the current Form
and open another one.
Unfortunatly, when the sub attached to the MenuClick event finishes, the
caption bar and the mainMenu of the hidden window appears again.
I mean that I have the expected form displayed but with the wrong
caption bar and menu. A simple click on the form client area is enough
to restore the right bar and menu.

--
Fred
http://www.cerber mail.com/?3kA6ftaCvT (enlever l'espace)

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off