c# - Databinding To A Property I Create In .Net 2.0 -
I'm binding on Net 2.0. It's a hassle! I have datatable (I was trying to use a detouro, but none of it was there) and a binding nigger with a binding source (which seemed magic ingredient), and I'm controlling it programming binding I am One of my columns, however, is an ID that I definitely do not want to display to the user, but I still should be easily accessible. Because I use the ID to call some more for the database, I also wanted to do this when it changes.
I thought that I want to make the form code of my own property code appropriate type, then bind it does not work, even if the text box using the same code is bound to the properties . why not?
There are some code in my UserControl, so you can see what I'm doing:
Guid SetID {get; Set; } // ... DataTable SetTable = DatabaseObject.GetDataTable (tablename) SetTable.DefaultView.Sort = "DisplayName ASC"; SetBinder.DataSource = SetTable; Foreign currency (DataColumn columns in SetTable.Column) {if (! Controls.ContainsKey ("in" + column.ColumnName)) is in progress; // This code is mostly here so I do not have a list of // controls with binding for each when it is very similar to all of them. Control "[" in + column.ColumnName] .databinding.ad ("text", setbinder, column.panname); } This.DataBindings.Add ("SetID", SetBinder, "SetID"); // does not work
I have worked on it: the property needs to be public , And you must add bindable attributes to the property, such as:
[Bindable (true)] get public good set; Set; }
Comments
Post a Comment