p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 2.0 Professional (http://p2p.wrox.com/forumdisplay.php?f=215)
-   -   grid view (http://p2p.wrox.com/showthread.php?t=57830)

MunishBhatia May 14th, 2007 03:50 AM

grid view
 
Hello to All
please solve my problen soon
i am using following code to get the checked value of text box.
but always it fires false:
1) gvcallerlist is name of grid
2) chkGridSelect is name of check box


protected void btnNext_Click(object sender, EventArgs e)
        {
           CheckBox chkSelected;
           foreach (GridViewRow gv in gvCallerList.Rows)
            {
                chkSelected = (CheckBox)gv.FindControl("chkGridSelect");

                if (chkSelected.Checked)
                {
                    //stNameGrid = ((Label) gv.FindControl("lblListNames").text;
                    Response.Redirect("default.aspx");
                }
            }
            if (ListNameGrid == "")
            {
                string Message = "<script language='javascript'>alert('Please Select one Calling Plan from the List.');</script>";
                Page.RegisterStartupScript("SelectRecord", Message);
                //ClientScript.RegisterStartupScript( "Message",Message);
            }


regards,
Munish bhatia

thanks......

pavank May 25th, 2007 07:26 AM

you use...

bool ischecked=((CheckBox)gv.FindControl("chkGridSelect ")).Checked;

in place of chkSelected = (CheckBox)gv.FindControl("chkGridSelect");

  n write like

  if(ischecked)
{

}

try it ...

bye

pavan


All times are GMT -4. The time now is 03:52 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.