Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > ItemTemplate Problem

Reply
Thread Tools

ItemTemplate Problem

 
 
CarlS CarlS is offline
Junior Member
Join Date: Jul 2012
Posts: 1
 
      07-06-2012
I have a simple datagrid that is bound to a filtered dataset. The filter attributes can be selected from a number of dropdown lists on the form, and the form posted back.

The problem I have is that a bound textbox control in the datagrid does not update when the form is posted, whereas all the other bound columns do.


<asp:TemplateColumn ItemStyle-Wrap="False" HeaderText="Match Date" ItemStyle-HorizontalAlign="Center">
<itemtemplate>
<asp:Textbox CssClass="fixdate" Width="100" Runat="server" ID="txtMatchDate" Text='<%# Container.DataItem("MatchDate")%>' ></asp:Textbox>
</itemtemplate>
</asp:TemplateColumn>

<asp:BoundColumn ReadOnly="True" DataField="MatchDate" HeaderText="Match Date" SortExpression="MatchDate"></asp:BoundColumn>

The two columns show above both bind to the MatchDate field. The BoundColumn shows show the corrrectly bound data at every postback, whereas the textbox in the TemplateColumn always shows the data from the first time time it is bound.
 
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
XPath if statement and GridView <ItemTemplate> Problem =?Utf-8?B?T3Bh?= ASP .Net 3 11-01-2006 11:08 PM
problem for dropdown list in itemtemplate =?Utf-8?B?QnJpYW4=?= ASP .Net 2 02-14-2006 08:20 PM
About ItemTemplate problem Alan Ho ASP .Net 1 04-11-2005 12:40 PM
can code inside a Repeater's ItemTemplate modify controls in the ItemTemplate? Bennett Haselton ASP .Net 1 09-24-2004 01:59 AM
ItemTemplate help Jeremy Chapman ASP .Net 2 07-29-2003 05:19 PM



Advertisments