Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

EndInit not working on DataSet as a BindingSource

$
0
0

Have a text box on a form bound as follows:

	DataSet dsCaseInfo = GetInfo();

	BindingSource bsCase = new BindingSource();

        bsCasePage.DataSource = dsCaseInfo;


..
..
//elsewhere

 txtName.DataBindings.Add("Text", bsCase, "TABLE1.COLUMN1");
..
..

//i make a change to textbox

bsCase.EndEdit();

//the following returns a null !!!??

bool bln = ((DataSet)m_bsCasePage.DataSource).GetChanges() == null;

In debug mode, the RowState for the row as UnModified but the Rowversi

on is 'Proposed' and the new value can be seen for the column as well. 

(this. Validate does not work nor have I called any 'AcceptChanges'. The Databindings.add with PropertyChanged parameter didnt work either!)

Here's the weird thing.. The same code works fine ---

1) if I extract the datatable from the dataset and bind it to the textbox

(or)

2) if i perform an EndInit() on the row in the datatable before calling GetChanges() on the DataSet like mentioned here - http://stackoverflow.com/a/6996832 (others seem to have the same issue, although they are having with the datatable, whereas i am having an issue with dataset)

Environment: x86, .net framework 4.5.2 and 4.6.1

what could i be missing?

Thanks





Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>