Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Right-click. Dumb question.

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

Right-click. Dumb question.
Link Posted: 20-Mar-2007 07:19
Here..

I have a test grid with one column.

I set options - ReadOnly, RowSelect.

I create few records in code

            for (int i = 0; i < 100; i++)
            {
                flyGrid2.Rows.Items.Add(new Node(new object[] { 999 }));
            }


I dont have any event handlers attached to the grid.

When I left-click on a record it gets selection (blue bar with white text).

If I press arrow keys it gets selection.

If I right-click on a record it does something what I consider a bug:

a second selection appeared on the clicked record until you hold right button clicked.

When you release it - second selection disappeared.

As long as I can see - grid.Selected is always the first selection and never right-clicked.

And there is no such thing as grid.RightSelected. I use 1.4.5.0...


So what I need (a very basic thing actually):
I have a load of read-only grids with context menu... Naturally users want to choose from these menus. Menus are row-based. Most of menu items depends on a row data. So the only acceptable for me solution is - to have row selected on right-click (just before context menu popped-up)... So in this case I can always be sure that user requests action upon exact row he/she meant to request..

This is a very important and non-negotiable requirement.

So far - I have no idea how to implement that behavior with flyGrid.

Please advise.
Link Posted: 20-Mar-2007 08:38
When you're using popup menus you can receive right clicked node by using FlyGrid.RightClickNode. Also you can determine right clicked node шт FlyGrid.MouseDown event handler.
Link Posted: 20-Mar-2007 23:03
I am sorry. I strongly disagree.

RightSelect is a proper option. If only it was working in expected way. You right-clik - you select.

Simple.

I highly recommend to rethink this.
Link Posted: 20-Mar-2007 23:12
P.S. Apparently RightClickNode has a serious bug.

This property must be null if no node has been clicked. Not previously clicked node.


P.P.S. and if you really want to go your own way with rightClick and stuff then a 'proper' solution will be having NodeRightClickSelectChange event in pair with the property....

P.P.P.S. And still - if you go your own way you may find yourself all alone in the end of that path... Off-topic