I am just starting to get into CSLA.net with ASP.net. I can't seem to figure out how to bind one of my business object properties to a DropDownList. I've bound a readonlylist of business objects to the dropdownlist's datasource and have set the DataTextField and DataValueField. The list of readonly items populates just fine. How do I bind the selected item of the DropDownList to my business object? Does it work anything like WinForms?
Usually the business object itself is bound to a GridView, DetailsView or FormView control. All other controls (if any) are inside one of these container controls.
So if you want to use an explicit DropDownList, you'd put it in a FormView. Or you can just use a GridView or DetailsView and set the column type to be a dropdown.
Okay. I got it. I just did a Bind on the SelectedItem of the DropDownList. The control was in a FormView. Any ideas on how to add a null item (or rather a Guid.Empty) item?
Copyright (c) Marimer LLC