Bind item

Discussion in 'ASP .Net Datagrid Control' started by Bruno Alexandre, Apr 10, 2006.

  1. Hi guys,

    in this gridView code
    <asp:GridView ... >
    <asp:TemplateField ConvertEmptyStringToNull="False" HeaderText="Qty">
    <ItemTemplate>
    <asp:TextBox CssClass="cart-InputQty" MaxLength="2" Width="40px"
    TextMode="SingleLine" ID="qty2" runat="server" Text="" />
    </ItemTemplate>
    </asp:TemplateField>
    <asp:BoundField DataField="qty" HeaderText="Qty" />
    <asp:BoundField DataField="code" HeaderText="Code" ReadOnly="True" />
    <asp:BoundField DataField="desc" HeaderText="Description" />
    </asp:GridView>

    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
    DataObjectTypeName="Shopping.Cart"
    TypeName="ShoppingCart"
    SelectMethod=""
    UpdateMethod="">
    </asp:ObjectDataSource>

    ShoppingCart is a Class and Cart is a DataTable inside ShoppingCart Class

    How can I add to the TEXT property the Qty from the DataTable?
    I tried:
    <%# Bind("qty") %> but I get an error
    I tried:
    <%# Eval("qty") %> but I get an error

    The BoundField works fine... but I want to convert it to a textbox so user's
    can modify the quantity...



    --


    Thank you in Advance.

    Bruno Alexandre
    (a Portuguese in Denmark)
    Bruno Alexandre, Apr 10, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mr2_93
    Replies:
    1
    Views:
    3,582
    mr2_93
    Oct 2, 2005
  2. Replies:
    0
    Views:
    579
  3. Ryan Liu
    Replies:
    0
    Views:
    224
    Ryan Liu
    Jan 21, 2009
  4. Ryan Liu
    Replies:
    0
    Views:
    759
    Ryan Liu
    Feb 23, 2010
  5. Bruno Alexandre

    Bind item

    Bruno Alexandre, Apr 10, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    158
    Bruno Alexandre
    Apr 10, 2006
Loading...

Share This Page