Bind item

B

Bruno Alexandre

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)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top