473,320 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Overriding DataGrid behaviour

Hi!

I'm using DataGrid in windows form.
I need to implement the following functionality:
- any mouse must select a row according where mouse has been clicked
- context menu must be also availiable by right mouse click

Have you got any ideas?
Thanks for any advice.
Nov 15 '05 #1
2 1932
Dmitry,

The context menu is easy, just create a menu and assign it to the
ContextMenu property of the DataGrid control. To select a complete row, you
can handle the click event of a grid and then use the Select method to
select a particular row. To get the row that was clicked, you can use the
HitTest method to find out where the row is that was clicked on.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dmitry Karneyev" <ka******@msn.com> wrote in message
news:e0****************@TK2MSFTNGP11.phx.gbl...
Hi!

I'm using DataGrid in windows form.
I need to implement the following functionality:
- any mouse must select a row according where mouse has been clicked
- context menu must be also availiable by right mouse click

Have you got any ideas?
Thanks for any advice.

Nov 15 '05 #2
Thanks Nicholas!
That is exact I've been looking for.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com>
сообщил/сообщила в новостях следующее:
news:OO**************@TK2MSFTNGP09.phx.gbl...
Dmitry,

The context menu is easy, just create a menu and assign it to the
ContextMenu property of the DataGrid control. To select a complete row, you can handle the click event of a grid and then use the Select method to
select a particular row. To get the row that was clicked, you can use the
HitTest method to find out where the row is that was clicked on.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dmitry Karneyev" <ka******@msn.com> wrote in message
news:e0****************@TK2MSFTNGP11.phx.gbl...
Hi!

I'm using DataGrid in windows form.
I need to implement the following functionality:
- any mouse must select a row according where mouse has been clicked
- context menu must be also availiable by right mouse click

Have you got any ideas?
Thanks for any advice.


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andrew Durdin | last post by:
In Python, you can override the behaviour of most operators for a class, by defining __add__, __gt__, and the other special object methods. I noticed that, although there are special methods for...
3
by: Ali Eghtebas | last post by:
Hi, I have 3 questions regarding the code below: 1) Why can't I trap the KEYDOWN while I can trap KEYUP? 2) Is it correct that I use Return True within the IF-Statement? (I've already read...
5
by: zero | last post by:
I'm having trouble with overriding methods in subclasses. I'll explain the problem using some code: class BaseClass { protected: void method2(); public: void method1();
0
by: DraguVaso | last post by:
Hi, I 'wrote' my own DataGrid, using the normal DataGrid, and overriding some of the DataGridTextBoxColumn-methods (mostly the Paint-method). I based most of my changes on the Windows Form FAQ:...
1
by: Morten Plathe | last post by:
Hi, Is there a way to override the shadowed (grey) backcolor of a textbox when the textbox is disabled for input (textbox.enabled = false) ? In some cases I want to have a custom backcolor when...
4
by: jibran | last post by:
Hello. I have wrapped the DataGrid control with my own class (SmartDataGrid) adding some necessary functionality. My current webform has 2 SmartDataGrids. The first is populated by selected...
4
by: Phill. W | last post by:
Here's a knotty little problem. I have some nasty little controls that needs to behave in a non- windows-Standard way - don't ask why; it's a large application being converted from some older...
3
by: David Scarlett | last post by:
Hi all, I've got a question regarding overriding const member functions with non-const functions. Let's say I've got a base class defined as follows: /*******************/ class Foo {...
1
by: tshad | last post by:
I have a DataGrid where I want the text in the cells to be black. But I want the header to have a black background and white text. The problem is the settings in the DataGrid are not overriding...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you▓ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.