Note that there are some explanatory texts on larger screens.

plurals
  1. PObound text boxes do not show adding new row
    primarykey
    data
    text
    <p>I'm using a datagridview, bindingnavigator and textboxes hooked to a bindingsource (set in code). When I select row in the grid the contents show in the textboxes, all is well. </p> <pre><code>txtQty.DataBindings.Add("Text", bsInvoiceDetails, "Detail_Quantity"); </code></pre> <p>Next I click the add on the binding navigator. It adds a blank row to the datagrid which is fine, but it does not clear the textboxes. The highlighted row in the grid is a different row. When I manually select the new row the textboxes still do not change. </p> <p>If I type in the texboxes with the new row selected in the grid, it in fact changes a different rows values. </p> <p>I can't figure out why this is our how to fix it. </p> <ul> <li>Help </li> </ul> <p>Update: </p> <p>Ran a query, returned a datatable... attached it to a dataset... the dataset is the datasource for the bindingsource ...</p> <pre><code>dsInvoiceDetails = new dsInvoiceDetails.Tables.Add(dtInvoiceDetails); bsInvoiceDetails.DataSource = dsInvoiceDetails; bsInvoiceDetails.DataMember = "Invoice_Detail"; </code></pre> <p>Code to hook the grid and the binding navigator to the bindingsource... </p> <pre><code>gridInvoiceDetails.DataSource = bsInvoiceDetails; bnInvoiceDetails.BindingSource = bsInvoiceDetails; </code></pre> <p>The binding source populates the textboxes above "automatically" when a grid row is selected. Works perfectly. </p> <p>The binding navigator has a cool button to add rows. Click on that. It adds a row to the grid. Great. But when the new row is selected nothing changed with the bound text boxes. </p> <p>I may need to handle the "AddingNew" event on the bindingsource... </p> <p>Hope that helps define the question a bit more for ya.</p> <p>Thanks for the help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload