David Svedarsky
asked on
double click datagridview row header to show edit or detail form in VS 2005
Hi,
I need the code to double click a rowheader on a datagridview to show the record in an edit or detail form in Visual Studio 2005.
Thanks,
dave_sky
I need the code to double click a rowheader on a datagridview to show the record in an edit or detail form in Visual Studio 2005.
Thanks,
dave_sky
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I am using VB 2005. u don't get "e.rowindex" in VB 2003
ASKER
I don't understand, I am using VB 2005!
Your Code:
I = e.RowIndex
I am getting the error message:
"Error-'RowIndex' is not a memberof 'System.Windows.Forms.Mous
Hi
U are writting your code in TblUpgradesDataGridView_Mo useDoubleC lick Event
but u have to wite this code in DataGridView1_RowHeaderMou seDoubleCl ick Event
U are writting your code in TblUpgradesDataGridView_Mo
but u have to wite this code in DataGridView1_RowHeaderMou
ASKER
You are so right... Pardon me.
Would you please show the code for this:
>>'or the best way is grabe the the recorde nubmer for the I= e.rowindex and read the data from the database to show it in edit form.
Thanks
Hi
As u can read each and every cell of the double Clicked row Header, u can get the records ID or Index key to find the record in the database. For example CustomerID. When ever u get the customerID u can now search the customer table using the CustomerID to find the respective record and then show it in your edit form.
ASKER
Hi NomanBD,
Here is what I am looking for:
Form A = Datagridview
Form B = Parent/Child w/ Parent Detail and Datagridview Child.
I want to be able to click on the RowHeader of Form A and show the selected record in Form B.
I have seen it done using a Datagrid instead of a Datagridview using the "MouseDown" event and HitTestInfo.
I think you are trying to show me another type of feature.
Here is what I am looking for:
Form A = Datagridview
Form B = Parent/Child w/ Parent Detail and Datagridview Child.
I want to be able to click on the RowHeader of Form A and show the selected record in Form B.
I have seen it done using a Datagrid instead of a Datagridview using the "MouseDown" event and HitTestInfo.
I think you are trying to show me another type of feature.
Hi
You are right. But the thing is u doesn’t need HitTestInfo approach as we have direct event for getting the mouse click or mouse double click event of a specific row. It is much easier and safer to use those advance events to track down your desire row and corresponding data.
Thanks
Noman
You are right. But the thing is u doesn’t need HitTestInfo approach as we have direct event for getting the mouse click or mouse double click event of a specific row. It is much easier and safer to use those advance events to track down your desire row and corresponding data.
Thanks
Noman
ASKER
Thanks for the response.
I'm just learning so I have a problem that maybe you can help.
Maybe more of a Step by Step, If you would.
My info:
Dataset - "MonarchSQL"
Form - "frmUpgradesList"
Grid - "TblUpgradesDataGridView"
PrimaryKey - "UpgradesKey"
Edit Form - "frmUpgrades"
Your modified Code: (Check my input please)
Private Sub TblUpgradesDataGridView_Mo
Dim I As Int32
I = e.RowIndex
(Error-'RowIndex' is not a memberof 'System.Windows.Forms.Mous
Dim frmUpgrades As New Form
Dim Textbox1 As New TextBox
frmUpgrades.Controls.Add(T
frmUpgrades.Show()
' to retrive data, for example u can proced in this way
Textbox1.Text = Me.TblUpgradesDataGridView
'or the best way is grabe the the recorde nubmer for the I= e.rowindex and read the data from the database to show it in edit form
End Sub