C# WinForms DataBinding?
-
Hi all, Im having a problem with what should be really easy!! I have BindingList of type MyObject. MyObject has 2 properties, Name and Description... I can bind the BindingList to a listview no problem using DisplayMember and DataSource. But what i really want is so when I select an item in the listview, i want 2 textboxes to bind to the current item and let me change the value of these 2 items, but as i edit the Name textbox I want it to change the listview?? Is this 2way databinding? Any ideas on how to acheive this? Im assuming its possible!
-
Hi all, Im having a problem with what should be really easy!! I have BindingList of type MyObject. MyObject has 2 properties, Name and Description... I can bind the BindingList to a listview no problem using DisplayMember and DataSource. But what i really want is so when I select an item in the listview, i want 2 textboxes to bind to the current item and let me change the value of these 2 items, but as i edit the Name textbox I want it to change the listview?? Is this 2way databinding? Any ideas on how to acheive this? Im assuming its possible!
Hi johnson, what kind of datasource you have? are you filling your listviews, textboxes and other stuff with data from a dtabase right? I ussualy use comboxes and textboxes, listview i dont use but i think they work the same. So, you fill you listview with data, right? and you do some editing in the textboxes, right? and you want that changes o appear in the listview i suppose. Listen johnson, you dont really edit the listview! you edit the database (have to create one if you dont have one)! 1) Fill your listview with data from the database, and bind your texboxes to the listview. 2) When you what to edit listview from the textboxes, you will have to trigger a sql store_procedure (using sql server) that edits a record, after trigger another procedure the refreshs data so new record(or chanded record) appear in your listview. Again, you edit/delete/add records in a database not in the listview GoodLuck :-O
nelsonpaixao@yahoo.com.br trying to help & get help
-
Hi johnson, what kind of datasource you have? are you filling your listviews, textboxes and other stuff with data from a dtabase right? I ussualy use comboxes and textboxes, listview i dont use but i think they work the same. So, you fill you listview with data, right? and you do some editing in the textboxes, right? and you want that changes o appear in the listview i suppose. Listen johnson, you dont really edit the listview! you edit the database (have to create one if you dont have one)! 1) Fill your listview with data from the database, and bind your texboxes to the listview. 2) When you what to edit listview from the textboxes, you will have to trigger a sql store_procedure (using sql server) that edits a record, after trigger another procedure the refreshs data so new record(or chanded record) appear in your listview. Again, you edit/delete/add records in a database not in the listview GoodLuck :-O
nelsonpaixao@yahoo.com.br trying to help & get help