Showing posts with label checkbox. Show all posts
Showing posts with label checkbox. Show all posts

Wednesday, March 21, 2012

persist Checkbox state in datagrid

hi,

i have a datagrid control in a page with checkbox column and paging option.
i selected some checkbox and going to next page or prev page, if i come back to the same page
the checkbox is not checked in that page.

so how to persist that checked item throughout the datagrid?

can any one help me with codingWhen the page is changed the DataGrid is data bound again therefore repopulating everything from the data source. This means any changes made client-side are lost. Save the changes made to the data source before data binding.

DJ

Friday, March 16, 2012

Persistence

Hi,
I have a datagrid with a checkbox column. The datagrid is using paging and
sorting. When I click on a checkbox then go to page 2 (or any other) then
come back to page 1 the checkbox is cleared!
Any suggestions?
Thanks,
YamaYama,
The datagrid is being re-populated each time you change pages and that
clears the checkbox on the previous page. (The datagrid is being persisted
using viewstate which only stores the objects currently displayed. You'll
need to store previous page's checkbox values in a database, in viewstate,
or session variables and then restore them.
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"Yama" <yamajan@.cox.net> wrote in message
news:eJVwpGSeEHA.3864@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I have a datagrid with a checkbox column. The datagrid is using paging and
> sorting. When I click on a checkbox then go to page 2 (or any other) then
> come back to page 1 the checkbox is cleared!
> Any suggestions?
> Thanks,
> Yama
>

Persistence

Hi,

I have a datagrid with a checkbox column. The datagrid is using paging and
sorting. When I click on a checkbox then go to page 2 (or any other) then
come back to page 1 the checkbox is cleared!

Any suggestions?

Thanks,

YamaYama,

The datagrid is being re-populated each time you change pages and that
clears the checkbox on the previous page. (The datagrid is being persisted
using viewstate which only stores the objects currently displayed. You'll
need to store previous page's checkbox values in a database, in viewstate,
or session variables and then restore them.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Yama" <yamajan@.cox.net> wrote in message
news:eJVwpGSeEHA.3864@.TK2MSFTNGP10.phx.gbl...
> Hi,
> I have a datagrid with a checkbox column. The datagrid is using paging and
> sorting. When I click on a checkbox then go to page 2 (or any other) then
> come back to page 1 the checkbox is cleared!
> Any suggestions?
> Thanks,
> Yama