Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid Template Column

Status
Not open for further replies.

imadmarie

Programmer
Nov 14, 2001
14
JO
i added a template column to a data grid :
<asp:DataGrid id=&quot;DataGrid1&quot; runat=&quot;server&quot; PageSize=&quot;5&quot; AllowPaging=&quot;True&quot;>
<Columns>
<asp:TemplateColumn HeaderText=&quot;Name&quot;>
<HeaderStyle HorizontalAlign=&quot;Center&quot;></HeaderStyle>
<ItemTemplate>
<asp:checkbox runat=&quot;server&quot; ID=&quot;ItemSelection&quot; enableViewState=&quot;True&quot; />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle Mode=&quot;NumericPages&quot;></PagerStyle>
</asp:DataGrid>

now : the problem is that those custom check boxes would not maintain there status if the page is reloaded, although i set the enableViewState property to TRUE !!
any help ?
 
The viewstate will work. Make sure that it is not because you are rebinding the data grid with every postback. Remember that the page_load event runs every time. You can prevent re-binding by only binding within

if not page.ispostback then
..bind here
end if

Hope this helps you - let me know otherwise
Mark [openup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top