Results 1 to 7 of 7

Thread: Replicate Database Command Button with click event outside of DataGrid

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2020
    Posts
    2

    Replicate Database Command Button with click event outside of DataGrid

    Good morning,

    I am new to VBForums and are looking for assistance in creating a separate button to replicate a command button within a datagrid. What i'm looking to do is to select click event button outside the datagrid which should display the data from that row and display it in several labels. I am unsure on how to go about this. i have also attached an image for reference.

    Name:  VBApp.jpg
Views: 48
Size:  14.0 KB

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    4,554

    Re: Replicate Database Command Button with click event outside of DataGrid

    This is not a Database question. Looks like your using VB .Net so that is where it should be posted.

    As for your question, the answer depends on where the data in the DataGridView is coming from and how your setting the dgv datasource. I would suggest using a Bindingsource for the Datasource, then bind the labels to the same bindingsource then the current row in the dgv will automatically be displayed in the labels.

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    32,966

    Re: Replicate Database Command Button with click event outside of DataGrid

    Quote Originally Posted by wes4dbt View Post
    This is not a Database question. Looks like your using VB .Net so that is where it should be posted.
    It's an Access DataForm... so, it actually should be inthe Office section... still not really a DB question, even though it's "in a database" ... it has nothing to do with databases, but rather how Access deals with forms and grids. But it's not .NET either.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2020
    Posts
    2

    Re: Replicate Database Command Button with click event outside of DataGrid

    My apologies if i didn't explain myself correctly. I would like to have the button binded to the row. For example every time i click the "TEST" button it will always display the info in row 1 even if i change the data info.

  5. #5
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    4,554

    Re: Replicate Database Command Button with click event outside of DataGrid

    Quote Originally Posted by techgnome View Post
    It's an Access DataForm... so, it actually should be inthe Office section... still not really a DB question, even though it's "in a database" ... it has nothing to do with databases, but rather how Access deals with forms and grids. But it's not .NET either.

    -tg
    Looks like a dgv to me, how can you tell the difference???

  6. #6
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    4,554

    Re: Replicate Database Command Button with click event outside of DataGrid

    Quote Originally Posted by Dwhite88 View Post
    My apologies if i didn't explain myself correctly. I would like to have the button binded to the row. For example every time i click the "TEST" button it will always display the info in row 1 even if i change the data info.
    Are you talking about the "True" row 1 or just the first row currently being display at the top of the grid.

  7. #7
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,612

    Re: Replicate Database Command Button with click event outside of DataGrid

    I can't tell the difference either but TG's sounding confident so let's go with moving it to Office. To be fair, if it is Access then the DB forum was kinda appropriate but, sice we're talking about the UI part of Access, Office is likely to get better results.

    @DWhite: welcome to the forums. It's always worth explaining exactly what technologies etc. you're using when posting a question. Otherwise you might get a bunch of inappropriate answers.
    You can depend upon the Americans to do the right thing. But only after they have exhausted every other possibility - Winston Churchill

    Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width