A
André Almeida Maldonado
Hy Guys..
I have a datagrid with template columns. The datagrid have a datatable
datasource. But when I try to bind data, I receive this error:
DataBinder.Eval: 'System.Web.UI.WebControls.DataGridItem' do not have a
property named "Codigo".
See my code:
<asp:TemplateColumn HeaderText="Código">
<HeaderStyle HorizontalAlign="Justify" Width="80px"
CssClass="grid-header" VerticalAlign="Middle"></HeaderStyle>
<ItemStyle HorizontalAlign="Justify"></ItemStyle>
<ItemTemplate>
<asp:label ID="item_lblPediGrCo" Text=' <%#
DataBinder.Eval(Container, "Codigo") %>' Runat="server" Width='80px' />
</ItemTemplate>
<EditItemTemplate>
<asp:label ID="edit_lblPediGrCo" Text='' Runat="server" Width='80px'
/>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Produto">
<HeaderStyle HorizontalAlign="Justify" Width="80px"
CssClass="grid-header" VerticalAlign="Middle"></HeaderStyle>
<ItemStyle HorizontalAlign="Justify"></ItemStyle>
<ItemTemplate>
<asp:label ID="item_lblPediGrPr" Text=' <%#
DataBinder.Eval(Container, "Produto") %>' Runat="server" Width='80px' />
</ItemTemplate>
<EditItemTemplate>
<asp:dropdownlist Width="80px" ID="edit_drpPediGrPr"
CssClass="Standard-text" DataSource='<%# drppediprod %>' Runat="server">
</asp:dropdownlist>
</EditItemTemplate>
</asp:TemplateColumn>
Where is the error????
Thank's
I have a datagrid with template columns. The datagrid have a datatable
datasource. But when I try to bind data, I receive this error:
DataBinder.Eval: 'System.Web.UI.WebControls.DataGridItem' do not have a
property named "Codigo".
See my code:
<asp:TemplateColumn HeaderText="Código">
<HeaderStyle HorizontalAlign="Justify" Width="80px"
CssClass="grid-header" VerticalAlign="Middle"></HeaderStyle>
<ItemStyle HorizontalAlign="Justify"></ItemStyle>
<ItemTemplate>
<asp:label ID="item_lblPediGrCo" Text=' <%#
DataBinder.Eval(Container, "Codigo") %>' Runat="server" Width='80px' />
</ItemTemplate>
<EditItemTemplate>
<asp:label ID="edit_lblPediGrCo" Text='' Runat="server" Width='80px'
/>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Produto">
<HeaderStyle HorizontalAlign="Justify" Width="80px"
CssClass="grid-header" VerticalAlign="Middle"></HeaderStyle>
<ItemStyle HorizontalAlign="Justify"></ItemStyle>
<ItemTemplate>
<asp:label ID="item_lblPediGrPr" Text=' <%#
DataBinder.Eval(Container, "Produto") %>' Runat="server" Width='80px' />
</ItemTemplate>
<EditItemTemplate>
<asp:dropdownlist Width="80px" ID="edit_drpPediGrPr"
CssClass="Standard-text" DataSource='<%# drppediprod %>' Runat="server">
</asp:dropdownlist>
</EditItemTemplate>
</asp:TemplateColumn>
Where is the error????
Thank's