PC Review


Reply
Thread Tools Rate Thread

Datagrid & contextMenu

 
 
MDB
Guest
Posts: n/a
 
      23rd Dec 2004
Hello All,

I have a datagrid with multiple rows and columns When a user taps a column
I update the quantity by one and then when they tap and hold, I display a
context menu with Subtract and Quantity displayed. Everything works fine
however, I can not figure out how to tell which of the datagrids
cells(row/column) is selected where the context menu is displayed. Can
anyone help? I have tried DataGrid.CurrentCell however, if the cell is not
highlighted/selected, it doesn't work.

Thanks In Advance


 
Reply With Quote
 
 
 
 
Alex Feinman [MVP]
Guest
Posts: n/a
 
      24th Dec 2004
In the menu's Popup event get cursor position by calling
Control.MousePosition. Convert it to grid's client coordinates and pass to
DataGrid.HitTest().
See http://www.alexfeinman.com/download....c=GridDemo.zip for more
details

--
Alex Feinman
---
Visit http://www.opennetcf.org
"MDB" <nospam> wrote in message
news:%(E-Mail Removed)...
> Hello All,
>
> I have a datagrid with multiple rows and columns When a user taps a
> column
> I update the quantity by one and then when they tap and hold, I display a
> context menu with Subtract and Quantity displayed. Everything works fine
> however, I can not figure out how to tell which of the datagrids
> cells(row/column) is selected where the context menu is displayed. Can
> anyone help? I have tried DataGrid.CurrentCell however, if the cell is
> not
> highlighted/selected, it doesn't work.
>
> Thanks In Advance
>



 
Reply With Quote
 
MDB
Guest
Posts: n/a
 
      27th Dec 2004
Thanks, I will check it out.


"Alex Feinman [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> In the menu's Popup event get cursor position by calling
> Control.MousePosition. Convert it to grid's client coordinates and pass to
> DataGrid.HitTest().
> See http://www.alexfeinman.com/download....c=GridDemo.zip for more
> details
>
> --
> Alex Feinman
> ---
> Visit http://www.opennetcf.org
> "MDB" <nospam> wrote in message
> news:%(E-Mail Removed)...
>> Hello All,
>>
>> I have a datagrid with multiple rows and columns When a user taps a
>> column
>> I update the quantity by one and then when they tap and hold, I display a
>> context menu with Subtract and Quantity displayed. Everything works fine
>> however, I can not figure out how to tell which of the datagrids
>> cells(row/column) is selected where the context menu is displayed. Can
>> anyone help? I have tried DataGrid.CurrentCell however, if the cell is
>> not
>> highlighted/selected, it doesn't work.
>>
>> Thanks In Advance
>>

>
>



 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid and ContextMenu (CF 2) Fred Microsoft Dot NET Compact Framework 1 14th Nov 2007 06:47 AM
DataGrid and ContextMenu problems news.tpi.pl Microsoft C# .NET 0 29th Jul 2005 08:38 AM
contextMenu & Datagrid MDB Microsoft C# .NET 1 23rd Dec 2004 03:43 PM
Is it possible to add ContextMenu items to the Standard TextBox ContextMenu??? =?Utf-8?B?TWlrZSBpbiBQYXJhZGlzZQ==?= Microsoft Dot NET Framework Forms 1 15th Mar 2004 07:54 AM
DataGrid Cell ContextMenu David Elliott Microsoft Dot NET Framework Forms 0 28th Aug 2003 04:21 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:13 PM.