I have a multiselect ListBox within a FormView. I can't figure
out how to setup the databinding for it.
I can populate the listbox fine. If the listbox was a single select I could use say
that works fine. Is there something that I can bind to for a
multiselect listbox? I've tried manually DataBinding by handling
the DataBinding event of the listbox and setting the selected
property on the appropriate items. Unfortunately, there are no
items in the listbox during the DataBinding event. The closest
thing I've found is to save the value that determines what items
should be selecting during DataBinding and then use that value in
the FormViews DataBinding event to select the right items which
seems like a hack to me.
我正在使用FormViews的ItemCreated事件來保存FormView的DataItem。 然後在FormView的DataBound事件中，我找到列表框並手動設置所選項。 我必須保存這樣的值並不正確，我認為有一種更正確的方法可以做到這一點，我看不到。