alslamo alikom...
i did the databinding process to some textboxes in a form and binding mode is two way....
iam asking now about how i would control the concurrency object of the controls....
in another meaning i want to put buttons for next and previous and last record and first record...
is there any class would help me achieve that in WPF...
or should manage that with special code...
thx for ur time...
Eng.Mohammad Abd Elrahman

Controlling the Currency of Binded Controls
hezkryvo
this should help
ms-help://MS.MSSDK.1033/MS.WinFXSDK.1033/wpf_conceptual/html/fcd37590-bce1-4ac9-8b74-3b96c7458b8a.htm
Nands
SqlConnection
conn =new SqlConnection(@"Data Source=BIZCORE\BIZCORE2005;Initial Catalog=SismatixERP;Integrated Security=True");
SqlDataAdapter adap =
new SqlDataAdapter("select * from com_m_country", conn);
ds = new DataSet();
ds.Tables.Add(new DataTable("table1"));
adap.Fill(ds, "table1");
Binding bind = new Binding("NameEn");
bind.Mode = BindingMode.TwoWay;
bind.Source = ds.Tables[0];
this.textBox2.SetBinding(TextBox.TextProperty, bind);
in the previuos code i did the binding using code there no thin in the XAML file indecating that iam doing binding...
but when i get the DataContext object either for the Form or for the TextBox object i used...i found DataContext Property is null....
i realy find ur code is great but help me to use it...or tell me whats wrong with my code....or is there a missing code to fill the DataContext property...by the way i tried the following code but no result still null value:
this.textBox2.DataContext = bind;
so sorry for bothering but this is the case....
Peter Smith
T. Bolon
Here is a way to do this.
Create a custom collection class (maybe even generic)
Add properties on the class that point to the "Current" object of the collection
Add functions to the collection to move "Current" to first, previous, next, and last.
Set the datacontext on your form to the Current property of your collection
here is the code for the custom collection.
I made it a generic class so that you can have type safety for any objects. To construct an instance
CursorCollection<MyClass> myCollection=new CursorCollection<MyClass>();
(Where MyClass is replaced with the class that will be inserted into the collection.)
Your only remaining steps are to populate your collection with objects, bind your forms datacontext to your collection's Current property, and make your buttons call GetNext and GetPrevious.