Click here to Skip to main content
15,894,740 members
Home / Discussions / Visual Basic
   

Visual Basic

 
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


AnswerRe: Referencing the selected ro in a DataGrid Pin
aseef15-Nov-05 21:45
aseef15-Nov-05 21:45 
GeneralRe: Referencing the selected ro in a DataGrid Pin
dptalt17-Nov-05 2:12
dptalt17-Nov-05 2:12 
QuestionCombobox issues Pin
lildragon15-Nov-05 6:36
lildragon15-Nov-05 6:36 
QuestionDisable the Windows Key Pin
Wilhelm-NA15-Nov-05 4:07
Wilhelm-NA15-Nov-05 4:07 
AnswerRe: Disable the Windows Key Pin
Dave Kreskowiak15-Nov-05 6:25
mveDave Kreskowiak15-Nov-05 6:25 
QuestionCSV file Pin
Dennis Huisman15-Nov-05 3:19
Dennis Huisman15-Nov-05 3:19 
AnswerRe: CSV file Pin
Christian Graus15-Nov-05 12:54
protectorChristian Graus15-Nov-05 12:54 
GeneralRe: CSV file Pin
Dennis Huisman15-Nov-05 19:16
Dennis Huisman15-Nov-05 19:16 
GeneralRe: CSV file Pin
Christian Graus16-Nov-05 12:15
protectorChristian Graus16-Nov-05 12:15 
QuestionHow to do Pin
minhbt_hitec15-Nov-05 2:50
minhbt_hitec15-Nov-05 2:50 
AnswerRe: How to do Pin
Christian Graus15-Nov-05 12:53
protectorChristian Graus15-Nov-05 12:53 
QuestionLast Post apply to VB.NET 2003 Pin
PatriceB15-Nov-05 1:58
PatriceB15-Nov-05 1:58 
QuestionStrong Name: error BC30145 Pin
PatriceB15-Nov-05 1:50
PatriceB15-Nov-05 1:50 
Questiontoolbar button , How on disable Normal image will display Pin
Rizwan Bashir15-Nov-05 1:20
Rizwan Bashir15-Nov-05 1:20 
Questionfile content change notification in VB Pin
Dinakara K15-Nov-05 1:19
Dinakara K15-Nov-05 1:19 
Questiondecompress a file vb.net 2005 Pin
wva197714-Nov-05 23:58
wva197714-Nov-05 23:58 
QuestionHOW TO USE TDB OR FLEXI GRID IN VB.NET PROJECT USING DATA SET.....PLEASE HELP ME Pin
ajay bharti14-Nov-05 22:12
ajay bharti14-Nov-05 22:12 

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.