Velocity Reviews

Velocity Reviews (
-   ASP .Net Datagrid Control (
-   -   checkbox problems in datagrid (

John 01-05-2006 08:15 PM

checkbox problems in datagrid
Hi all, i've added a checkbox column to my datagrid using template columns,
and i added a checkbox to the header for check all and uncheck all
functionality. the purpose of this is to allow the users to select records
from the list and add them to another list when the push a button. My
problem is that the checked value never survives postback. in other words i
can find the controls, i used some online articles to figure out how to do
this, but the chkbox.checked value is always false even if i hard code it to
be true in the html. i've tried both asp:checkbox and HtmlInputControl
checkboxes, both have the same problem. i've also tried with and without
paging enabled on the datagrid and nothing helps.
heres the c# code i'm using to try to get the values

foreach( DataGridItem di in dgListData.Items )
Trace.Write("in foreach");
HtmlInputCheckBox chkBx =
(HtmlInputCheckBox)di.FindControl("chkInclude") ;

if( chkBx !=null )
Trace.Write("In if",chkBx.Checked.ToString()+" value
lblIncludeError.Text="It worked";

All times are GMT. The time now is 06:27 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.