views:

264

answers:

2

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
Should be a comment
Ali Kazmi
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