Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Textbox in header of Datagrid loosing viewstate

Thread Tools

Textbox in header of Datagrid loosing viewstate

Posts: n/a

I have a templated column in a datagrid which contains a textbox
control in the Header template.

Does anyone know how to maintain the viewstate of the textbox after a
datagrid rebind?

(A postback without rebind DOES maintain the viewstate)

Thanks in advance,


My aspx snippet:

<asp:datagrid id=dgrHauliers runat="server"
OnItemDataBound="ItemDataBound" AutoGenerateColumns="False">

<asp:TemplateColumn HeaderText="Company ID">

<asp:TextBox id=txtId Width="100%" Runat="server"
OnTextChanged="TextChanged" AutoPostBack="True">

<asp:Label id=Label1 runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.Id") %>'></asp:Label>

Reply With Quote

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
Header files with "header.h" or <header.h> ?? mlt C++ 2 01-31-2009 02:54 PM
datagrid having row header and column header ASP .Net Datagrid Control 0 07-13-2006 08:20 AM
Any way to reorder how a datagrid is drawn (header/footer/items vs.header/items/footer)? Henrik ASP .Net Datagrid Control 1 07-06-2006 12:23 AM
Loosing ViewState on postback Gauthier Segay ASP .Net 6 08-10-2005 01:55 PM
meta refresh loosing the viewstate on the TextBox Prodip Saha ASP .Net 2 12-29-2004 02:12 PM