[ PeraKojovic @ 01.09.2006. 12:38 ] @
Pozdrav, posto sam pitanje postavio na stranim forumima, ne bih da ga prevodim: Hi all, here is my problem: (system is VS 2005, C#, ADO .NET 2) I have a bindingsource, a datagrid, and set of details like fields on the same form. Next, there are following bindings set: void Init() { BindingSource.DataSource = someLocalTable datagrid.DataSource = BindingSource for every control { Control.DataBinding.Add("...", BindingSource, "...") } } Moving through a datagrid changes the data in bound detail controls, hence BindingSource too, changes position. Changing data in controls changes the data in selected dataGrid row. The problem is: I have a button "Insert New", that does exactly this: 1. adds a new row in the local someLocalTable and fills it with the default values: DataRow dr = someLocalTable.NewRow(); ... fill default values someLocalTable.Rows.Add(dr); 2. TRIES TO CHANGE THE BINDINGSOURCE-s POSITION TO LAST(newly created table row) 3. This is the step where after changing position on the bindingSource to the newly created row (.MoveLast()), you expect detail fields change to null (or empty), and dataGrid changes the ActiveRow and position However, after adding new row to someLocalTable, I can not change the position of the bindingSource to that new row. BindingSource.Count returns good nr. of rows, including the newly created. I tried a lots of things, like rebind all controls like on the Init method, still no luck. Am I missing something here? I forgot to mention that the grid is actually Infragistics ultraGrid, but that doesn't change the basic concept... Pera |