[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

Troubleshooting databinding issue

DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Title'.

What are the common causes for this?

Here is the markup for the gridview:

<asp:GridView ID="gvCart" runat="server" Font-Names="Arial" HorizontalAlign="Center"  RowStyle-Wrap="false"
AutoGenerateColumns="False" Width="100%" CellPadding="2" GridLines="None" BorderColor="Transparent">
<Columns>
<asp:BoundField DataField="ISBN" HeaderText="ISBN" Visible="False" />
<asp:TemplateField HeaderText="Item Description">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Title") %>'></asp:TextBox>
</EditItemTemplate>
<HeaderStyle CssClass="Title_HeaderStyle" />
<ItemStyle CssClass="Title_ItemStyle" />
<ItemTemplate>
<asp:Label EnableViewState="false" ID="Label1" runat="server" Text='<%# Bind("Title") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="DETAILS" HeaderText="Details">
<HeaderStyle CssClass="Details_HeaderStyle" />
<ItemStyle CssClass="Details_ItemStyle" />
</asp:BoundField>
<asp:BoundField DataField="TYPE" HeaderText="Type">
<HeaderStyle CssClass="Type_HeaderStyle" />
<ItemStyle CssClass="Type_ItemStyle" />
</asp:BoundField>
<asp:BoundField DataField="Price" HeaderText="Price">
<HeaderStyle CssClass="Price_HeaderStyle" />
<ItemStyle CssClass="Price_ItemStyle" />
</asp:BoundField>
<asp:BoundField DataField="QTY" HeaderText="Qty">
<HeaderStyle CssClass="Qty_HeaderStyle" />
<ItemStyle CssClass="Qty_ItemStyle" />
</asp:BoundField>
<asp:BoundField DataField="Extended" HeaderText="Ext">
<HeaderStyle CssClass="Extended_HeaderStyle" />
<ItemStyle CssClass="Extended_ItemStyle" />
</asp:BoundField>
</Columns>
</asp:GridView>

Open in new window

0
Tom Knowlton
Asked:
Tom Knowlton
1 Solution
 
binaryevoCommented:
That typically means that your data structure your binding to doesn't contain a column / property called "Title".   Check your data that's coming back before you can .DataBind() and audit it against the Bind("Title") just to be sure that you have your naming correct.
0
 
Tom KnowltonWeb developerAuthor Commented:
thx


I found it in the meantime...it was trying to assign the datasource at the wrong time.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now