Solved

2 Identical DataGrids...moving a selected ROW

Posted on 2004-09-07
3
178 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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…

740 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