Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Bind item

Reply
Thread Tools

Bind item

 
 
Bruno Alexandre
Guest
Posts: n/a
 
      04-10-2006
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)



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
<asp:BoundField> can only bind to properties/fields? Not x.Item["KeyName"]? Ryan Liu ASP .Net 0 02-23-2010 02:19 AM
bind to item index, not just its property Ryan Liu ASP .Net 0 01-21-2009 10:05 PM
confused by boost::bind & boost::lambda::bind XHengDF@gmail.com C++ 0 05-29-2007 04:37 AM
Bind item Bruno Alexandre ASP .Net Datagrid Control 1 04-10-2006 02:59 PM
Using a data-bind dropdownlist to populate another data-bind dropdownlist mr2_93 ASP .Net 1 10-02-2005 05:07 PM



Advertisments