Binding TextBoxes in DataGrid

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<p style="font:inherit; vertical-align:baseline; list-style-type:none; color:#666666; font-family:Segoe UI,Helvetica,Garuda,Arial,sans-serif; line-height:21px
Hi..!!
<p style="font:inherit; vertical-align:baseline; list-style-type:none; color:#666666; font-family:Segoe UI,Helvetica,Garuda,Arial,sans-serif; line-height:21px
Am using a DataGrid, inside a datagrid it contain a combobox [ which is binded using a datasource ] and four textboxes. I want to do is ,when an item in combobox is selected, the corresponding values from the table should bind to two of the textboxes. Combobox
function is carrying out correctly that is selection of an item.
<p style="font:inherit; vertical-align:baseline; list-style-type:none; color:#666666; font-family:Segoe UI,Helvetica,Garuda,Arial,sans-serif; line-height:21px
My problems are
<p style="font:inherit; vertical-align:baseline; list-style-type:none; color:#666666; font-family:Segoe UI,Helvetica,Garuda,Arial,sans-serif; line-height:21px
1) i want to bind datas correctly to the textboxes
<p style="font:inherit; vertical-align:baseline; list-style-type:none; color:#666666; font-family:Segoe UI,Helvetica,Garuda,Arial,sans-serif; line-height:21px
2)when a selection is made the combobox selected item is disappeared
<p style="font:inherit; vertical-align:baseline; list-style-type:none; color:#666666; font-family:Segoe UI,Helvetica,Garuda,Arial,sans-serif; line-height:21px
i had given the following code
<pre class="prettyprint prettyprinted" style="font:inherit; vertical-align:baseline; list-style-type:none; word-wrap:normal; overflow-y:hidden; overflow-x:auto; color:#666666; line-height:21px <span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="kwd" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline private<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="kwd" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline void<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline dataGridView1_EditingControlShowing<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline (<span class="kwd" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline object<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline sender<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline ,<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline DataGridViewEditingControlShowingEventArgs<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline e<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline )<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline
<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline {<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline
<span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline ComboBox<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline cmb <span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline =<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline e<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline .<span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline Control<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="kwd" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline as<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline ComboBox<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline ;<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline
<span class="kwd" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline if<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline (<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline cmb <span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline !=<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="kwd" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline null<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline )<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline
cmb<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline .<span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline SelectedIndexChanged<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline +=<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="kwd" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline new<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline EventHandler<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline (<span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline ComboBox_SelectedIndexChanged<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline );<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline
<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline }<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline
<span class="kwd" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline private<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="kwd" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline void<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline ComboBox_SelectedIndexChanged<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline (<span class="kwd" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline object<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline sender<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline ,<span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline EventArgs<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline e<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline )<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline
<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline {<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline
<span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline ComboBox<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline cb <span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline =<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline (<span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline ComboBox<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline )<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline sender<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline ;<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline
<span class="kwd" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline string<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline code <span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline =<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline cb<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline .<span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline SelectedValue<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline .<span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline ToString<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline ();<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline
<span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline SelectQuery<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="kwd" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline select<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline =<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="kwd" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline new<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline SelectQuery<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline ();<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline
<span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline DataTable<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline dt <span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline =<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="kwd" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline select<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline .<span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline SelectItemDetailsByCode<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline (<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline code<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline );<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline
dataGridView1<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline .<span class="typ" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline DataSource<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline <span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline =<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline dt<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline ;<span class="pln" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline

<span class="pun" style="margin:0px; padding:0px; border:0px; font:inherit; vertical-align:baseline }[/code]
<p style="font:inherit; vertical-align:baseline; list-style-type:none; color:#666666; font-family:Segoe UI,Helvetica,Garuda,Arial,sans-serif; line-height:21px
Am doing a windows application and preferred language is C#..

View the full article
 
Back
Top