DataGrid: Can't see the wood for the trees!!! 
Author Message
 DataGrid: Can't see the wood for the trees!!!

Hi,

Okay, I've bound a data grid to a dataset and all is well, I can see the
data.

But let's say that the requirement is for the user to double click
anywhere along a row of data and for a process to be fired using the
identity value of that row.

How do I then get to the specific column within that row, using its
column heading (i.e. the dataset column name)?

Regards,

Andy



Sat, 26 Nov 2005 23:00:04 GMT  
 DataGrid: Can't see the wood for the trees!!!
Hi,

Dim myCell As DataGridCell

myCell = DataGrid1.CurrentCell

Dim intCol As Integer = myCell.ColumnNumber

Dim intRow As Integer = myCell.RowNumber

Ken

--------------



Quote:
> Hi,

> Okay, I've bound a data grid to a dataset and all is well, I can see the
> data.

> But let's say that the requirement is for the user to double click
> anywhere along a row of data and for a process to be fired using the
> identity value of that row.

> How do I then get to the specific column within that row, using its
> column heading (i.e. the dataset column name)?

> Regards,

> Andy



Sun, 27 Nov 2005 01:16:57 GMT  
 DataGrid: Can't see the wood for the trees!!!
Try this:
'Row Cell Click

Private Sub DataGrid1_MouseDown(ByVal sender As Object,
ByVal e As MouseEventArgs) Handles DataGrid1.MouseDown

Dim myGrid As DataGrid = CType(sender, DataGrid)
Dim hti As System.Windows.Forms.DataGrid.HitTestInfo
hti = myGrid.HitTest(e.X, e.Y)
MessageBox.Show(hti)
AValue = DataGrid1.Item(hti.Row, hti.Column)
MessageBox.Show(AValue)
end sub
B

Quote:
>-----Original Message-----
>Hi,

>Okay, I've bound a data grid to a dataset and all is
well, I can see the
>data.

>But let's say that the requirement is for the user to
double click
>anywhere along a row of data and for a process to be
fired using the
>identity value of that row.

>How do I then get to the specific column within that row,
using its
>column heading (i.e. the dataset column name)?

>Regards,

>Andy

>.



Sun, 27 Nov 2005 01:20:31 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. 'Canned' data in VB program

2. seen a fast tree ?

3. Datagrid again...seen this error?

4. Some weird run time error I've never seen before

5. Some wierd error I've never seen before

6. HOWTO Create a master detail relationship datagrid for Web like Tree Structure

7. Need some help with DataGrids (DataGrid-->DataGrid, DataGrid-->Dataset, DataGrid-->XML)

8. I'm seeing red

9. Bizarre problem - VB6 won't see one .EXE file but sees all others

10. An Api I haven't seen

11. Weirdest bug I've ever seen

12. ? Internet connection sharing, I've seen this posted several times by people

 

 
Powered by phpBB® Forum Software