Hi, How can I have multiple properties in my usercontrol that can be databound? For a single property I have found that DefaultBindingProperty Attribute does the trick but I have no idea on how to get databinding with multiple properties.
A:
I'm trying to do the same thing. I have a usercontrol with StateCode, County and Municipality properties which should each be bound to a database field bidirectionally so I can put it in a detailview template.
Any ideas would be appreciated.
Rob
Robert Bratton
2010-05-06 22:45:01
Should be a comment
Ali Kazmi
2010-05-20 10:58:03
A:
I had databind the usercontrol's 2 properties with the same eval expressions like below.
<uc3:PickDate ID="txtCutOffDate" runat="server" SelectedDate='<%# Eval("CutOffDate") %>' Text='<%# Eval("CutOffDate") %>' RequiredField="False" TextBoxLength="100" ToolTipDate="CutoffDate" ValidationGroup="UpdateVal" />
here cutoffdate was data field which bind with both selecteddate and text properties of pickdate control.
hope this helps!
Antoops
2010-07-10 12:47:07