May 19th, 2012, 04:14 AM
Please help with datagridview
I'm totally beginer (noob) in programmers world, I'm trying to prepare my first program (database). I'm creating it just acording to my knownledge so it's a little bit cr..
in form1 I've 3 comboboxes (CB) 3datagridviews(DGV) and some textboxes (TB)
all DGV are connected to a diffrent database files..
CB1 list values from DGV1; CB2 from DGV2 etc
'CB1.DisplayMember = "Column3"
CB1.DataSource = dBaseDT
when I'm choosing the value from CB1 then values in CB2 and CB3 are changing to the same value. then in all DGV is sellected row with value choosen in CB1 (if present).
CB2.Text = CB1.Text
Now I would like to copy the text from specific colum of choosen row in DGV1 to TB1... but only part of the text..
I'm using this
'Dim mm As String
'TextBox1.DataBindings.Add("TEXT", dBaseDT, "Column10")
'mm = TB1.Text
'TB1.Text = Microsoft.VisualBasic.Right(mm, 3)
unfortunately when I make simple databinding without cutting the text it shows me value from actual sellected row but wen I'm using Microsoft.VisualBasic.Right it shows me the cutted part from previous choose.
Please teach me how to fix it??
Last edited by Mic13; May 22nd, 2012 at 02:24 PM.
Reason: accidentialy created 2 post for the same thema
May 19th, 2012, 04:33 AM
problem with datagridview
To solve this problem I used something not properly Inteligent.
I just add additional form and additional operation for user. First on the main form user needs to click the button that will show additional form.
To make this form more useful I prepared this form as something print preview scrollable form (of corse due to scrollable form to print this I need to use not printform but printdocument with functions to draw same as additional form view)
On additional form I used the same function like I tried to use in original main form
and now it works - it shows the proper (cutted) value so I can export it to other database. maybe something was updated during opening new form.
mm = TB1.Text
TB1.Text = Microsoft.VisualBasic.Right(mm, 3)
Last edited by Mic13; May 22nd, 2012 at 02:36 PM.
May 23rd, 2012, 12:54 AM
Re: Please help with datagridview
Thanks for sharing your solution.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.