![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
| I can retrieve the value from gridview but i cann't if the value is invisible in gridview. If i read the value that is hidden i got the value null. I don't know why. if someone know, please let me know. my code is as follow protected void GridView3_RowUpdating(object sender, GridViewUpdateEventArgs e) { int a = GridView3.EditIndex; Control ctl = GridView3.Rows[a].Controls[0]; string value = ((System.Web.UI.WebControls.TextBox)(ctl.Controls[1])).Text; Control ctl1 = GridView3.Rows[a].Controls[1]; string value1 = ((System.Web.UI.WebControls.TextBox)(ctl1.Controls [1])).Text; Control ctl2 = GridView3.Rows[a].Controls[3]; string value2 = ((System.Web.UI.WebControls.TextBox)(ctl2.Controls [1])).Text; } i got value and value1 but didn't get value2 because i make it invisible in gridview. i want to have this. please help me. Thanks a lot! *** Sent via Developersdex http://www.developersdex.com *** |
#3
| |||
| |||
|
| I can retrieve the value from gridview but i cann't if the value is invisible in gridview. If i read the value that is hidden i got the value null. I don't know why. if someone know, please let me know. my code is as follow protected void GridView3_RowUpdating(object sender, GridViewUpdateEventArgs e) { int a = GridView3.EditIndex; Control ctl = GridView3.Rows[a].Controls[0]; string value = ((System.Web.UI.WebControls.TextBox)(ctl.Controls[1])).Text; Control ctl1 = GridView3.Rows[a].Controls[1]; string value1 = ((System.Web.UI.WebControls.TextBox)(ctl1.Controls [1])).Text; Control ctl2 = GridView3.Rows[a].Controls[3]; string value2 = ((System.Web.UI.WebControls.TextBox)(ctl2.Controls [1])).Text; } i got value and value1 but didn't get value2 because i make it invisible in gridview. i want to have this. please help me. Thanks a lot! *** Sent via Developersdex http://www.developersdex.com *** |
#4
| |||
| |||
|
|
Server controls with Visible=false don't get rendered to client and don't come back in postbacks. That's why you can't retrieve them. Leave Visible=true and hide the control with a css rule display:none. -- Eliyahu Goldin, Software Developer Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net "phyumon thant" <phyumon (AT) gmail (DOT) com> wrote in message news:OQTYKu47HHA.1900 (AT) TK2MSFTNGP02 (DOT) phx.gbl... I can retrieve the value from gridview but i cann't if the value is invisible in gridview. If i read the value that is hidden i got the value null. I don't know why. if someone know, please let me know. my code is as follow protected void GridView3_RowUpdating(object sender, GridViewUpdateEventArgs e) { int a = GridView3.EditIndex; Control ctl = GridView3.Rows[a].Controls[0]; string value = ((System.Web.UI.WebControls.TextBox)(ctl.Controls[1])).Text; Control ctl1 = GridView3.Rows[a].Controls[1]; string value1 = ((System.Web.UI.WebControls.TextBox)(ctl1.Controls [1])).Text; Control ctl2 = GridView3.Rows[a].Controls[3]; string value2 = ((System.Web.UI.WebControls.TextBox)(ctl2.Controls [1])).Text; } i got value and value1 but didn't get value2 because i make it invisible in gridview. i want to have this. please help me. Thanks a lot! *** Sent via Developersdex http://www.developersdex.com *** |
#5
| |||
| |||
|
|
Server controls with Visible=false don't get rendered to client and don't come back in postbacks. That's why you can't retrieve them. Leave Visible=true and hide the control with a css rule display:none. -- Eliyahu Goldin, Software Developer Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldinhttp://usableasp.net "phyumon thant" <phyu... (AT) gmail (DOT) com> wrote in message news:OQTYKu47HHA.1900 (AT) TK2MSFTNGP02 (DOT) phx.gbl... I can retrieve the value from gridview but i cann't if the value is invisible in gridview. If i read the value that is hidden i got the value null. I don't know why. if someone know, please let me know. my code is as follow protected void GridView3_RowUpdating(object sender, GridViewUpdateEventArgs e) { int a = GridView3.EditIndex; Control ctl = GridView3.Rows[a].Controls[0]; string value = ((System.Web.UI.WebControls.TextBox)(ctl.Controls[1])).Text; Control ctl1 = GridView3.Rows[a].Controls[1]; string value1 = ((System.Web.UI.WebControls.TextBox)(ctl1.Controls [1])).Text; Control ctl2 = GridView3.Rows[a].Controls[3]; string value2 = ((System.Web.UI.WebControls.TextBox)(ctl2.Controls [1])).Text; } i got value and value1 but didn't get value2 because i make it invisible in gridview. i want to have this. please help me. Thanks a lot! *** Sent via Developersdexhttp://www.developersdex.com***- Hide quoted text - - Show quoted text - |
#6
| |||
| |||
|
|
Server controls with Visible=false don't get rendered to client and don't come back in postbacks. That's why you can't retrieve them. Leave Visible=true and hide the control with a css rule display:none. -- Eliyahu Goldin, Software Developer Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net "phyumon thant" <phyumon (AT) gmail (DOT) com> wrote in message news:OQTYKu47HHA.1900 (AT) TK2MSFTNGP02 (DOT) phx.gbl... I can retrieve the value from gridview but i cann't if the value is invisible in gridview. If i read the value that is hidden i got the value null. I don't know why. if someone know, please let me know. my code is as follow protected void GridView3_RowUpdating(object sender, GridViewUpdateEventArgs e) { int a = GridView3.EditIndex; Control ctl = GridView3.Rows[a].Controls[0]; string value = ((System.Web.UI.WebControls.TextBox)(ctl.Controls[1])).Text; Control ctl1 = GridView3.Rows[a].Controls[1]; string value1 = ((System.Web.UI.WebControls.TextBox)(ctl1.Controls [1])).Text; Control ctl2 = GridView3.Rows[a].Controls[3]; string value2 = ((System.Web.UI.WebControls.TextBox)(ctl2.Controls [1])).Text; } i got value and value1 but didn't get value2 because i make it invisible in gridview. i want to have this. please help me. Thanks a lot! *** Sent via Developersdex http://www.developersdex.com *** |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |