Hi I am using Product Table. I choise Category DropDownList after page is postback and I choise checkbox and I choise another DropdownList after page is postback and I lost value Checkbox Checked. How can I do example.
As far as I know, when you choose another DropdownList and your page is postback, the contents of the GridView are re-created from the postback Viewstate data between page_init and page_load.
You can bind in this condition like the below, It will prevent rebinding to the GridView.
if (!Page.IsPostBack)
{
GridView1.DataSourceID = "Datasource";
GridView1.DataBind();
}
Best Regards,
Yohann Lu
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
22 Points
312 Posts
Gridview in checkbox after lost value
Nov 19, 2016 09:49 PM|Aliyilmaz|LINK
Hi I am using Product Table. I choise Category DropDownList after page is postback and I choise checkbox and I choise another DropdownList after page is postback and I lost value Checkbox Checked. How can I do example.
https://www.portakalahsap.com
https://www.portakalahsap.com/ofis-mobilyalari
Member
22 Points
312 Posts
Re: Gridview in checkbox after lost value
Nov 20, 2016 09:47 AM|Aliyilmaz|LINK
Can anyone help me ?
https://www.portakalahsap.com
https://www.portakalahsap.com/ofis-mobilyalari
All-Star
102952 Points
19469 Posts
MVP
Re: Gridview in checkbox after lost value
Nov 21, 2016 01:14 PM|vinz|LINK
Well looks like your issue was already addressed here: http://www.codeproject.com/Answers/1156926/Gridview-in-checkbox-after-lost-value#answer2
Microsoft MVP, CodeProject MVP, C# Corner MVP
Blog | Twitter | Linkedin
Star
11454 Points
2439 Posts
Re: Gridview in checkbox after lost value
Nov 22, 2016 02:53 AM|Yohann Lu|LINK
Hi Aliyilmaz,
As far as I know, when you choose another DropdownList and your page is postback, the contents of the GridView are re-created from the postback Viewstate data between page_init and page_load.
You can bind in this condition like the below, It will prevent rebinding to the GridView.
Best Regards,
Yohann Lu