Solved

2 Identical DataGrids...moving a selected ROW

Posted on 2004-09-07
3
177 Views
Last Modified: 2011-04-14
I have a User form which has 2 Datagrids...

Blocked Branches                  Allowed Branches
--------------------                 ------------------------
|   Branch1       |      >>       |     Branch2          |
|   Branch3       |                 |                          |
|                      |       <<      |                          |
|                      |                 |                          |
--------------------                 -----------------------

They both have the exact same layout (4 Columns)

When a user clicks on >> button...I want to move the selected BLOCKED Branch ROW
into the ALLOWED Branch Grid...Is there a grid function that will COPY an entire ROW or do I have
to move each column into variables...and build a Row to ADD to Allowed Branches...
My code so far is...

'*****************************************************
'User wants to move selected BLOCKED Branch to ALLOWED
'*****************************************************
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If dgBlockedGrid.VisibleRowCount < 1 Then
            MsgBox("There are no more Blocked Branches.")
        Else
            Me.Cursor = System.Windows.Forms.Cursors.WaitCursor
            Dim oSelectedCell As DataGridCell
            Dim oSelectedItem As Object

            oSelectedCell = dgAllowedGrid.CurrentCell
            oSelectedItem = dgAllowedGrid.Item(oSelectedCell.RowNumber, 3)
            fkUserID = CInt(oSelectedItem)

        End If
End Sub
0
Comment
Question by:natloz
  • 2
3 Comments
 
LVL 7

Author Comment

by:natloz
ID: 11998539
This is a Windows Application
0
 
LVL 7

Accepted Solution

by:
natloz earned 0 total points
ID: 11998725
Figured out a better way...when the user clicks the button, I update the database with the new rights to the branches, and refresh my grids with the new security matrix...don't need to mess with moving rows this way.

Thanks...
0
 

Expert Comment

by:ee_ai_construct
ID: 11998998
Closed, 500 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Moderator
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question