PC Review


Reply
Thread Tools Rate Thread

DataGrid / Context menu - HowTo

 
 
coltrane
Guest
Posts: n/a
 
      20th Jan 2007
Can someone direct me to a reference that describes how to create a
context menu for a selected row in a datagrid? I have come across many
threads regarding context menus and datagrids but they all seem to be
how to modify the default behavior. I've gone through a couple of books
and many threads but none of these seem to discuss creating a context
menu for a given row. I did come across a thread that allowed me to
create a menu for the entire grid but that even allows for a context
menu outside of any rows.


thanks for your help


john

 
Reply With Quote
 
 
 
 
Otis Mukinfus
Guest
Posts: n/a
 
      22nd Jan 2007
On 20 Jan 2007 13:21:08 -0800, "coltrane" <(E-Mail Removed)> wrote:

>Can someone direct me to a reference that describes how to create a
>context menu for a selected row in a datagrid? I have come across many
>threads regarding context menus and datagrids but they all seem to be
>how to modify the default behavior. I've gone through a couple of books
>and many threads but none of these seem to discuss creating a context
>menu for a given row. I did come across a thread that allowed me to
>create a menu for the entire grid but that even allows for a context
>menu outside of any rows.
>
>
>thanks for your help
>
>
>john


You might try capturing the row number from the right click and display your
context menu based on something you determine from the row's data or which
column the right click targeted.

Pseudo code:

If the right click is in Column 1
row display a context menu that is appropriate for column 1
else display a context menu that is appropriate for column[n]
.....


Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 
Reply With Quote
 
coltrane
Guest
Posts: n/a
 
      22nd Jan 2007
thanks for the help. Worked like a charm.


Otis Mukinfus wrote:
> On 20 Jan 2007 13:21:08 -0800, "coltrane" <(E-Mail Removed)> wrote:
>
> >Can someone direct me to a reference that describes how to create a
> >context menu for a selected row in a datagrid? I have come across many
> >threads regarding context menus and datagrids but they all seem to be
> >how to modify the default behavior. I've gone through a couple of books
> >and many threads but none of these seem to discuss creating a context
> >menu for a given row. I did come across a thread that allowed me to
> >create a menu for the entire grid but that even allows for a context
> >menu outside of any rows.
> >
> >
> >thanks for your help
> >
> >
> >john

>
> You might try capturing the row number from the right click and display your
> context menu based on something you determine from the row's data or which
> column the right click targeted.
>
> Pseudo code:
>
> If the right click is in Column 1
> row display a context menu that is appropriate for column 1
> else display a context menu that is appropriate for column[n]
> ....
>
>
> Good luck with your project,
>
> Otis Mukinfus
> http://www.arltex.com
> http://www.tomchilders.com


 
Reply With Quote
 
Otis Mukinfus
Guest
Posts: n/a
 
      23rd Jan 2007
On 22 Jan 2007 09:56:35 -0800, "coltrane" <(E-Mail Removed)> wrote:

>thanks for the help. Worked like a charm.


You're welcome sir. Glad it worked for you.

>
>
>Otis Mukinfus wrote:
>> On 20 Jan 2007 13:21:08 -0800, "coltrane" <(E-Mail Removed)> wrote:
>>
>> >Can someone direct me to a reference that describes how to create a
>> >context menu for a selected row in a datagrid? I have come across many
>> >threads regarding context menus and datagrids but they all seem to be
>> >how to modify the default behavior. I've gone through a couple of books
>> >and many threads but none of these seem to discuss creating a context
>> >menu for a given row. I did come across a thread that allowed me to
>> >create a menu for the entire grid but that even allows for a context
>> >menu outside of any rows.
>> >
>> >
>> >thanks for your help
>> >
>> >
>> >john

>>
>> You might try capturing the row number from the right click and display your
>> context menu based on something you determine from the row's data or which
>> column the right click targeted.
>>
>> Pseudo code:
>>
>> If the right click is in Column 1
>> row display a context menu that is appropriate for column 1
>> else display a context menu that is appropriate for column[n]
>> ....
>>
>>
>> Good luck with your project,
>>
>> Otis Mukinfus
>> http://www.arltex.com
>> http://www.tomchilders.com

Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
 
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 / Context menu - HowTo john coltrane Microsoft Dot NET Framework Forms 1 22nd Jan 2007 10:58 AM
Re: Datagrid Context Menu vbnetdev Microsoft VB .NET 0 14th Dec 2006 12:05 PM
Context menu in a dataGrid view =?Utf-8?B?Y3VfYmxlbmdl?= Microsoft Dot NET Compact Framework 1 29th Apr 2006 03:16 PM
Datagrid with context menu Krishna Microsoft ASP .NET 1 29th Nov 2005 10:38 AM
Context Menu on a datagrid? Luis Esteban Valencia Microsoft ASP .NET 1 29th Sep 2004 07:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:59 AM.