Click here to Skip to main content
15,918,596 members
Home / Discussions / Visual Basic
   

Visual Basic

 
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 
Questionhow to extract a selected row from datagrid Pin
raghu sahay14-Nov-05 20:30
raghu sahay14-Nov-05 20:30 
AnswerRe: how to extract a selected row from datagrid Pin
Guerven15-Nov-05 14:41
Guerven15-Nov-05 14:41 
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 table

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.

<br />
    Dim ID As String<br />
<br />
    'use the this event handle<br />
    Private Sub DataGrid1_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles   <br />
                              DataGrid1.CurrentCellChanged<br />
        Dim x As Int16<br />
<br />
        'Datagrid1.datsource = tbl1.Defaultview<br />
        '    instead of Datagrid1.datsource = tbl1<br />
        '     you must explicitly point to the tables defaultview <br />
<br />
        'Get the position of the Table's Defaultview<br />
        x = Me.BindingContext(TBL1.DefaultView).Position()<br />
<br />
        'use x to identify you row<br />
        ID = TBL1.DefaultView(x)("fieldname")<br />
    End Sub<br />






Marvin N. Guerrero
- Taje Kage_bunshinNunJutsU
GeneralRe: how to extract a selected row from datagrid Pin
dptalt16-Nov-05 2:46
dptalt16-Nov-05 2:46 
QuestionPassword Protected Package Pin
Guerven14-Nov-05 18:49
Guerven14-Nov-05 18:49 
AnswerRe: Password Protected Package Pin
Guerven14-Nov-05 18:50
Guerven14-Nov-05 18:50 
QuestionHow can C++ control a VB-window? Pin
Big_Goose14-Nov-05 16:17
Big_Goose14-Nov-05 16:17 
AnswerRe: How can C++ control a VB-window? Pin
Christian Graus14-Nov-05 16:33
protectorChristian Graus14-Nov-05 16:33 
AnswerRe: How can C++ control a VB-window? Pin
K. Shaffer15-Nov-05 8:57
K. Shaffer15-Nov-05 8:57 
QuestionHow to get a event when have 1 new file in one folder Pin
dinhnq14-Nov-05 14:54
dinhnq14-Nov-05 14:54 
AnswerRe: How to get a event when have 1 new file in one folder Pin
Christian Graus14-Nov-05 15:13
protectorChristian Graus14-Nov-05 15:13 
Questionkeyboard hooks stop Web Browser VS.net 2005 Pin
Sebzy14-Nov-05 9:09
Sebzy14-Nov-05 9:09 
AnswerRe: keyboard hooks stop Web Browser VS.net 2005 Pin
Sebzy14-Nov-05 9:17
Sebzy14-Nov-05 9:17 
QuestionOracle question Pin
icDavid14-Nov-05 8:08
icDavid14-Nov-05 8:08 
AnswerRe: Oracle question Pin
Sebzy14-Nov-05 9:27
Sebzy14-Nov-05 9:27 
Questionanimated jpeg streaming? Pin
Joe Zimmerman14-Nov-05 6:52
Joe Zimmerman14-Nov-05 6:52 
GeneralRe: animated jpeg streaming? Pin
Briga14-Nov-05 22:31
Briga14-Nov-05 22:31 
QuestionExport Data from Datagrid to word Pin
sreejaps14-Nov-05 6:22
sreejaps14-Nov-05 6:22 
Questionmobile programming Pin
microuser_200014-Nov-05 5:57
microuser_200014-Nov-05 5:57 
AnswerRe: mobile programming Pin
Briga14-Nov-05 22:28
Briga14-Nov-05 22:28 

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.