Reputation: 107
I am getting following error on gridview binding.
DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Sr'
.
In my gridview itemtemplete i have a lable like this.
<asp:Label ID="lblQuesNo" runat="server" Text='<%#Eval("Sr.No.") %>'></asp:Label>
Sr.No. is present in dataset.
Upvotes: 0
Views: 71
Reputation: 4081
Try this instead
<asp:Label ID="lblQuesNo" runat="server" Text='<%# DataBinder.GetPropertyValue(Container.DataItem, "Sr.No.") %>'></asp:Label>
Upvotes: 1