|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Getting content from one column in a datagrid in a textboxI have a datagrid with columns. One of the columns are a textbox.
I want the text in this column shown in a textbox outside the datagrid. How can I do that when clicking the actual row in the datagrid? reidarT For .NET 1.x or 2.0?
Show quoteHide quote "reidarT" <rei***@eivon.no> wrote in message news:Olo%23nyD0GHA.996@TK2MSFTNGP03.phx.gbl... >I have a datagrid with columns. One of the columns are a textbox. > I want the text in this column shown in a textbox outside the datagrid. > How can I do that when clicking the actual row in the datagrid? > reidarT > for .net 2.0
reidarT Show quoteHide quote "Mike McIntyre" <mik***@getdotnetcode.com> skrev i melding news:%233ze5hF0GHA.4796@TK2MSFTNGP06.phx.gbl... > For .NET 1.x or 2.0? > > -- > Mike > > Mike McIntyre [MVP] > http://www.getdotnetcode.com > > > "reidarT" <rei***@eivon.no> wrote in message > news:Olo%23nyD0GHA.996@TK2MSFTNGP03.phx.gbl... >>I have a datagrid with columns. One of the columns are a textbox. >> I want the text in this column shown in a textbox outside the datagrid. >> How can I do that when clicking the actual row in the datagrid? >> reidarT >> > > You can bind the Text property of your 'off the grid' TextBox to your
DataGridView's BindingSource text column and the TextBox will display the text for the row selected in the DataGridView. ..1 At design time you can select the TextBox that is outside the DataGridView, view its properties, select DataBindings -> Advanced to open the 'Formatting and Advanced Binding' dialog where you can associate the column of the BindingSource with the TextBox. OR 2. For runtime binding you will need to add code similar to this to bind the TextBox Text property to the BindingSource: Me.TextBox1.DataBindings.Add(New System.Windows.Forms.Binding("Text", Me.CustomerBindingSource, "Name", True)) The example above shows the Text property of a TextBox named TextBox1 being bound to the "Name" column of a BindingSource named CustomerBindingSource. Show quoteHide quote "reidarT" <rei***@eivon.no> wrote in message news:Olo%23nyD0GHA.996@TK2MSFTNGP03.phx.gbl... >I have a datagrid with columns. One of the columns are a textbox. > I want the text in this column shown in a textbox outside the datagrid. > How can I do that when clicking the actual row in the datagrid? > reidarT >
is an object destroyed/closed when an exception occurs
processor time Visual Basic.Net & DBF files Adding event (mouseclick) handlers to GDI+ shapes? Multiple Select listbox and sql stored procedure -Help needed How can I convert a graphics object to image? list of objects vs Array of objects newbe help please. paste disabled when i add a menubar in vb2005 paramertised select query Windows form is getting crashed VB.Net 2005 |
|||||||||||||||||||||||