borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (ASP.NET DataList Problems!)Next Topic (Problem with code on CD-ROM drive.) New Topic New Poll Post Reply
AndreaVB Forum : VB.Net : Open new form when cell in datagridview is clicked
Poster Message
katie1411
Level: Trainee

Registered: 17-02-2009
Posts: 1

Ads by Lake Quincy Media
icon Open new form when cell in datagridview is clicked

Hi
I am creating a user interface for a mall as my uni project
I have so far made my database and linked in to Visual Basic 2008 and I am displaying data using datagridviewlinkcolumn
My Data displays fine now what i want to achieve is the following

As the data is displayed with different records when click on each record i want a new form to open with detailed info about that record

so for example I am in the fashion category and i want sub categories to be displayed in a new form. depending on wich category I am clicking on


I know I need to do a cellclick or a buttonclick but i dont know how to.

Please help

    

____________________________
kattie

17-02-2009 at 11:04 PM
View Profile Send Email to User Show All Posts | Quote Reply
yopibest
Level: Protégé

Registered: 19-01-2009
Posts: 6
icon Re: Open new form when cell in datagridview is clicked

If you just want to display the content of the row you clicked, you can try the following:

'assume you have 3 column in the datagridview, the new form named form2. If the column is dinamic, you can use array.

Private Sub DataGridView1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.Click
        Dim int As Integer = Me.DataGridView1.CurrentCell.RowIndex
        Form2.Label1.Text = Me.DataGridView1.Item(0, int).Value
        Form2.Label2.Text = Me.DataGridView1.Item(1, int).Value
        Form2.Label3.Text = Me.DataGridView1.Item(2, int).Value
        Form2.Show()
End Sub

It just the simple, for more task on the new form like updating or binding, you must define more detail.
Hope it help. Or if it's not what you intended, just ignore it.

Ads by Lake Quincy Media
26-03-2009 at 01:49 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB.Net : Open new form when cell in datagridview is clicked
Previous Topic (ASP.NET DataList Problems!)Next Topic (Problem with code on CD-ROM drive.) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder