Click here to Skip to main content
15,916,379 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Flickering form Pin
eagertolearn16-Nov-05 5:54
eagertolearn16-Nov-05 5:54 
GeneralRe: Flickering form Pin
Joshua Quick16-Nov-05 7:16
Joshua Quick16-Nov-05 7:16 
GeneralRe: Flickering form Pin
eagertolearn16-Nov-05 8:13
eagertolearn16-Nov-05 8:13 
GeneralRe: Flickering form Pin
Joshua Quick16-Nov-05 8:52
Joshua Quick16-Nov-05 8:52 
GeneralRe: Flickering form Pin
eagertolearn16-Nov-05 9:48
eagertolearn16-Nov-05 9:48 
GeneralRe: Flickering form Pin
Joshua Quick16-Nov-05 13:59
Joshua Quick16-Nov-05 13:59 
GeneralRe: Flickering form Pin
eagertolearn17-Nov-05 5:41
eagertolearn17-Nov-05 5:41 
GeneralRe: Flickering form Pin
Joshua Quick17-Nov-05 21:10
Joshua Quick17-Nov-05 21:10 
GeneralRe: Flickering form Pin
eagertolearn18-Nov-05 14:05
eagertolearn18-Nov-05 14:05 
GeneralRe: Flickering form Pin
Joshua Quick18-Nov-05 14:29
Joshua Quick18-Nov-05 14:29 
GeneralRe: Flickering form Pin
eagertolearn20-Nov-05 19:40
eagertolearn20-Nov-05 19:40 
GeneralRe: Flickering form Pin
Joshua Quick21-Nov-05 6:28
Joshua Quick21-Nov-05 6:28 
QuestionIn Win 2000 Pro , why can not permit one user have only right read all file in one folder Pin
dinhnq15-Nov-05 15:17
dinhnq15-Nov-05 15:17 
QuestionImage Editing Problems Pin
Mazitan15-Nov-05 13:57
Mazitan15-Nov-05 13:57 
AnswerRe: Image Editing Problems Pin
Christian Graus15-Nov-05 14:21
protectorChristian Graus15-Nov-05 14:21 
GeneralRe: Image Editing Problems Pin
Mazitan16-Nov-05 2:42
Mazitan16-Nov-05 2:42 
QuestionStretching BackgroundImage Pin
eagertolearn15-Nov-05 12:07
eagertolearn15-Nov-05 12:07 
AnswerRe: Stretching BackgroundImage Pin
Christian Graus15-Nov-05 12:53
protectorChristian Graus15-Nov-05 12:53 
GeneralRe: Stretching BackgroundImage Pin
eagertolearn15-Nov-05 16:08
eagertolearn15-Nov-05 16:08 
QuestionMatrix Transformations before rendering Pin
K. Shaffer15-Nov-05 8:43
K. Shaffer15-Nov-05 8:43 
Questiondisplaying search results Pin
JMS7615-Nov-05 7:07
JMS7615-Nov-05 7:07 
AnswerRe: displaying search results Pin
Guerven15-Nov-05 14:44
Guerven15-Nov-05 14:44 
GeneralRe: displaying search results Pin
JMS7616-Nov-05 5:55
JMS7616-Nov-05 5:55 
QuestionReferencing the selected ro in a DataGrid Pin
dptalt15-Nov-05 6:51
dptalt15-Nov-05 6:51 
AnswerRe: Referencing the selected ro in a DataGrid Pin
Guerven15-Nov-05 14:47
Guerven15-Nov-05 14:47 
There are many ways to extract information, first you need to identify the index of the record you want to extract.
We can use the ME.Databindingcontext( datasource ).position to identify the current row.
Normally we assign a table to a datagrid's datasource, but here we will use the Table.Defaultview.

SO given TBL1 as your datatable

Datagrid.datasource = TBL1.Defaultview

then we can use

Me.BindingContext(TBL1.DefaultView).Position()

to indentify the current row, this should work even it you change the sort field of the datagrid.


I think thats it.


Dim ID As String

'use the this event handle
Private Sub DataGrid1_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles
DataGrid1.CurrentCellChanged
Dim x As Int16

'Datagrid1.datsource = tbl1.Defaultview
' instead of Datagrid1.datsource = tbl1
' you must explicitly point to the tables defaultview

'Get the position of the Table's Defaultview
x = Me.BindingContext(TBL1.DefaultView).Position()

'use x to identify you row
textbox1.text = TBL1.DefaultView(x)("fieldname")
End Sub






Marvin N. Guerrero
- Taje Kage_bunshinNunJutsU


Marvin N. Guerrero
- Taje Kage_bunshinNunJutsU


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.