Click here to Skip to main content
15,910,234 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionvb.net Pin
lopashree18-Feb-07 18:38
lopashree18-Feb-07 18:38 
AnswerRe: vb.net Pin
Christian Graus18-Feb-07 20:15
protectorChristian Graus18-Feb-07 20:15 
QuestionAccess C++ DLL from Visual BAsic .Net Pin
Lee Bottone18-Feb-07 13:45
Lee Bottone18-Feb-07 13:45 
AnswerRe: Access C++ DLL from Visual BAsic .Net Pin
Christian Graus18-Feb-07 14:09
protectorChristian Graus18-Feb-07 14:09 
QuestionRandom numbers from ascii Pin
harveyhanson18-Feb-07 11:45
harveyhanson18-Feb-07 11:45 
AnswerRe: Random numbers from ascii Pin
Christian Graus18-Feb-07 12:14
protectorChristian Graus18-Feb-07 12:14 
AnswerRe: Random numbers from ascii Pin
Guffa18-Feb-07 12:20
Guffa18-Feb-07 12:20 
GeneralRe: Random numbers from ascii Pin
Christian Graus18-Feb-07 12:28
protectorChristian Graus18-Feb-07 12:28 
GeneralRe: Random numbers from ascii Pin
harveyhanson18-Feb-07 13:53
harveyhanson18-Feb-07 13:53 
GeneralRe: Random numbers from ascii Pin
Christian Graus18-Feb-07 14:18
protectorChristian Graus18-Feb-07 14:18 
QuestionProgram to test my knowledge? Pin
Wolf9218-Feb-07 6:06
Wolf9218-Feb-07 6:06 
AnswerRe: Program to test my knowledge? Pin
Christian Graus18-Feb-07 9:27
protectorChristian Graus18-Feb-07 9:27 
AnswerRe: Program to test my knowledge? Pin
Thomas Stockwell19-Feb-07 6:58
professionalThomas Stockwell19-Feb-07 6:58 
Questionhow to create reports Pin
kendo1718-Feb-07 2:19
kendo1718-Feb-07 2:19 
AnswerRe: how to create reports Pin
Christian Graus18-Feb-07 11:42
protectorChristian Graus18-Feb-07 11:42 
Questionapplication.run Pin
amaneet18-Feb-07 1:00
amaneet18-Feb-07 1:00 
AnswerRe: application.run Pin
Colin Angus Mackay18-Feb-07 4:36
Colin Angus Mackay18-Feb-07 4:36 
Questionshared keyword in vb.net Pin
amaneet18-Feb-07 0:48
amaneet18-Feb-07 0:48 
AnswerRe: shared keyword in vb.net Pin
Colin Angus Mackay18-Feb-07 4:34
Colin Angus Mackay18-Feb-07 4:34 
GeneralRe: shared keyword in vb.net Pin
amaneet19-Feb-07 3:36
amaneet19-Feb-07 3:36 
GeneralRe: shared keyword in vb.net Pin
Hossein Narimani Rad20-Feb-07 19:13
Hossein Narimani Rad20-Feb-07 19:13 
Questiontransfer attribute from 1 datagrid to another Pin
kendo1718-Feb-07 0:17
kendo1718-Feb-07 0:17 
AnswerRe: transfer attribute from 1 datagrid to another Pin
Johan Hakkesteegt23-Feb-07 0:40
Johan Hakkesteegt23-Feb-07 0:40 
Hi Kendo,

If I understand correctly what you are asking, you can try something like this:
1. populate dataset 1 and bind it to datagrid 1
2. adapt the following code to get the row the user clicked on, and the corresponding cell value:
Private Sub Datagrid1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles Datagrid1.MouseDown<br />
Try<br />
Dim myGrid As DataGrid = CType(sender, DataGrid)<br />
Dim hti As System.Windows.Forms.DataGrid.HitTestInfo<br />
hti = myGrid.HitTest(e.X, e.Y)<br />
Dim message As String = "You clicked "<br />
Select Case hti.Type<br />
Case System.Windows.Forms.DataGrid.HitTestType.None<br />
message &= "the background."<br />
Case System.Windows.Forms.DataGrid.HitTestType.Cell<br />
message &= "cell at row " & hti.Row & ", col " & hti.Column<br />
Case System.Windows.Forms.DataGrid.HitTestType.ColumnHeader<br />
message &= "the column header for column " & hti.Column<br />
Case System.Windows.Forms.DataGrid.HitTestType.RowHeader<br />
message &= "the row header for row " & hti.Row<br />
Case System.Windows.Forms.DataGrid.HitTestType.ColumnResize<br />
message &= "the column resizer for column " & hti.Column<br />
Case System.Windows.Forms.DataGrid.HitTestType.RowResize<br />
message &= "the row resizer for row " & hti.Row<br />
Case System.Windows.Forms.DataGrid.HitTestType.Caption<br />
message &= "the caption"<br />
Case System.Windows.Forms.DataGrid.HitTestType.ParentRows<br />
message &= "the parent row"<br />
MsgBox(message)<br />
End Select<br />
Catch Ex As Exception<br />
MsgBox(Ex.Message)<br />
End Try<br />
End Sub

3. Execute a parametrized query to populate dataset 2 with the data you want to show in datagrid 2, using the cell value obtained in the code above.
4. bind dataset 2 to datagrid 2

Good luck,

Johan



My advice is free, and you may get what you paid for.

QuestionSelectedIndexChange of DDL inside Datagrid.. HELP!! Pin
Huvandhuma17-Feb-07 19:50
Huvandhuma17-Feb-07 19:50 
AnswerRe: SelectedIndexChange of DDL inside Datagrid.. HELP!! Pin
Marcus J. Smith19-Feb-07 3:39
professionalMarcus J. Smith19-Feb-07 3:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.