Is there any way to change the selected row in a DataGridView programmatically?


Author
Message
Marcia G Akins
Marcia G Akins
Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)Advanced StrataFrame User (698 reputation)
Group: StrataFrame Users
Posts: 322, Visits: 529
Hi All.

The reason that I want to do this is necause I am using a context menu to allow them to add, edit and delete item (it calls up a modal dialog). It is a little confusing to them if they right click, select edit or delete, and the information from a different row shows up in the modal dialog.

TIA

Reply
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Marcia G Akins (09/05/2008)
And after your last reply, I looked at the ListView in Strataframe.

I suggested you to look at the StrataFlix sample application which uses the new enhanced list.

It also had no RightCLick event that I could hook in to.

A single event, the MouseClick event is used to handle all this in .NET controls like this:

Private Sub lstServiceCalls_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lstServiceCalls.MouseClick

     If e.Button = Windows.Forms.MouseButtons.Right Then

          '-- do your stuff here.    

     End If

End Sub

And if all you want is to show a shortcut menu (ContextMenuStrip in .NET) all you need to do is add a SF ThemedContextMenuStrip to your form, add all the items you want then add that menu to the form's property ContextMenuStrip and you are done, not need to manage it via the right click like in VFP. 

BTW, StrataFlix Main Form also have a sample of a ThemedContextMenuStrip.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Marcia G Akins - 17 Years Ago
Edhy Rijo - 17 Years Ago
Marcia G Akins - 17 Years Ago
Dustin Taylor - 17 Years Ago
Marcia G Akins - 17 Years Ago
StrataFrame Team - 17 Years Ago
StrataFrame Team - 17 Years Ago
                         [quote][b]Ben Chase (09/05/2008)[/b][hr]It's probably called...
Marcia G Akins - 17 Years Ago
                             [quote][b]Marcia G Akins (09/05/2008)[/b][hr]Yes. I found that event....
Edhy Rijo - 17 Years Ago
                                 [quote][b]Edhy Rijo (09/05/2008)[/b][hr][quote][b]Marcia G Akins...
Marcia G Akins - 17 Years Ago
                                     Could you add a context menu to the grid? I have done this with the...
Bill Cunnien - 17 Years Ago
                                     [quote][b]Marcia G Akins (09/05/2008)[/b][hr]And after your last...
Edhy Rijo - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search