Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > culdn populate data using doubleclick event
 

culdn populate data using doubleclick event

hi.....
i ve a form with datagrid.In tat i want to doubleclicka row, so tat it shld open another form with populated datas from the previous form....
pl help me to do dis....
vry urgent....

thnks in advans:)
charmee  Wednesday, August 19, 2009 8:37 AM
Handle CellMouseDoubleClick

and pass the DataSet you have attached with DataGridView and Selected Row Index to Next Form Constructor.


Please mark the post as answer if it is helpfull to you because it boosts the members to answer more and more.
  • Marked As Answer bycharmee Thursday, August 20, 2009 4:14 AM
  •  
_SuDhiR_  Wednesday, August 19, 2009 8:46 AM
Private Sub DataGrid1_DoubleClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DataGrid1.DoubleClick

Dim MyGrid As DataGrid = DirectCast(sender, DataGrid)

Dim MyEdit As New <Your New Form Name >(rs,
MyGrid.CurrentCell.RowNumber)

MyEdit.ShowDialog()

End Sub

-> Add a consturtor to your new form which take RecordSet and int as parameters.
-> Now in Form load of the new form get the values from row number and RecordSet
Please mark the post as answer if it is helpfull to you because it boosts the members to answer more and more.
  • Marked As Answer bycharmee Monday, August 24, 2009 7:47 AM
  •  
_SuDhiR_  Thursday, August 20, 2009 8:58 AM
Handle CellMouseDoubleClick

and pass the DataSet you have attached with DataGridView and Selected Row Index to Next Form Constructor.


Please mark the post as answer if it is helpfull to you because it boosts the members to answer more and more.
  • Marked As Answer bycharmee Thursday, August 20, 2009 4:14 AM
  •  
_SuDhiR_  Wednesday, August 19, 2009 8:46 AM

hiiii........

thnks for ya reply...

but m sry it s nt wrking....

m vry new to dis vb6....

can u help me by posting sum codings???

nd for ya info m using datagrid nt datagridview.....

pl help me........

vry vry urgent...........

thnks in advan:):)

charmee  Thursday, August 20, 2009 4:18 AM
Cn you post your code what are you doing?
Please mark the post as answer if it is helpfull to you because it boosts the members to answer more and more.
_SuDhiR_  Thursday, August 20, 2009 5:12 AM

hi sudhir.......

k heraft ll do it...

well,here s ma code

To make grid to wrk:


private sub ok_click()

dim rs as new adodb.recordset

dim adconn as new adodb.recordset

set adoconn=new adodb.recordset

adconn.connection="provider=msdaora.1;user id=bs;data source=ltm;password=inno"

adconn.open

rs.cursorlocation=aduseclient

rs.open "select * from lib_issue",adconn,adopenkeyset,adlockoptimistic

set datagrid1.datasource =rs

datagrid1.refresh

end sub

this is what i did so far....

once again i remind you what i actually need

see,i have a datagrid in one form. In that ineed todoubleclick a row which opens another form.
In that second form m having textboxs which should display the row detials in that...
say if that row contains author name,book name,book id...all those details should be get displaying in the corresponding text boxes.

m i clear to you mr.sudhir????

if you know the solution for dis please dohelp me(vry vry urgent).........

million thanks in advans....

charmee  Thursday, August 20, 2009 8:39 AM
Private Sub DataGrid1_DoubleClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DataGrid1.DoubleClick

Dim MyGrid As DataGrid = DirectCast(sender, DataGrid)

Dim MyEdit As New <Your New Form Name >(rs,
MyGrid.CurrentCell.RowNumber)

MyEdit.ShowDialog()

End Sub

-> Add a consturtor to your new form which take RecordSet and int as parameters.
-> Now in Form load of the new form get the values from row number and RecordSet
Please mark the post as answer if it is helpfull to you because it boosts the members to answer more and more.
  • Marked As Answer bycharmee Monday, August 24, 2009 7:47 AM
  •  
_SuDhiR_  Thursday, August 20, 2009 8:58 AM

hiiiii frnds....
thnks 4 al ya supports....
wit ya help i made ma datagrid to wrk properly.......
thnks a lot:):)....
hey one more doubt.....
s der any way to change the background color of column in datagridbased on its value???

charmee  Monday, August 24, 2009 7:47 AM

You can use google to search for other answers

Custom Search

More Threads

• DataBindings Problem
• datagridview datetimepicker column
• Creating a Discussion Forum in C# Windows Application
• Feature list of the new DataGridView control
• Bound dataGridView with Calendar Column
• Duplicates in listview
• DataGridView Not Showing Objects
• DataGridView and the clipboard
• ComboBox does not lose focus
• Append text to image in a single cell of DatGridView