I encounter error message when I try to bind a DropDownList in a GridView to a BO Custom Bindable Property.
My Custom Bindable Property in BO:
protected
{
};
}
[
_approver =
_approver.FillById(id);
ERROR MESSAGE AT ASPX PAGE (DEBUG MODE):
<ItemTemplate> <asp:Label ID="lblApproverCode" runat="server" Text='<%# Bind("ApproverCode") %>'></asp:Label></ItemTemplate>
DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'ApproverCode'.
However, it simply run fine with this.MyBoInstance.MyCustomField. Help...
{get{Guid id = this.CurrentRow["ApproverId"] == DBNull.Value ? Guid.Empty : (Guid)this.CurrentRow["ApproverId"];if (id != null){ //-- Obviously you will want to call another internal method. But you should get the idea. Calling //-- a scalar method would be faster and cleaner than your other code. return (string)Me.ExecuteScalar("SELECT code FROM WhateverTable WHERE mycriteria = @mycritera);
}else{ return string.Empty;}}}
If you can't get it to work, then post a sample that reproduces the problem instead of posting code snippetts. Thanks.