Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 3rd, 2005, 05:28 AM
Authorized User
 
Join Date: Aug 2004
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Baby_programmer Send a message via MSN to Baby_programmer Send a message via Yahoo to Baby_programmer
Default CheckBox in DataGrid

Hi Friends!
Another problem is that, i have a paged datagrid, each row contains the check box.. when the user enables the check box the id is taken of selected record....The problem is when the user checks/enables record at page1 and then select the second record on page2, the 1st checked-record disappers.....

Please help me.....

ashfaq
__________________
Baby Prgrammer
 
Old March 3rd, 2005, 08:33 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Please only post your questions in one forum.

This is because when you change pages the datagrid is Bound again to its datasource without the first checkbox being saved to the database.
To fix this you need to run whatever code is to persist the checkbox as part of the PageIndexChanged event before binding again.
This involve looping throught items on the grid saving/checking each line for the checkbox

Alternatively you can you can set the checkbox to postback on its click event. Where you would then save the detail needed.

It really depends on how frequent you think this even would happen, and whatyou would expect your users to expect to happen.



======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================





Similar Threads
Thread Thread Starter Forum Replies Last Post
CheckBox in Datagrid sumith ASP.NET 1.0 and 1.1 Professional 1 March 21st, 2007 06:25 AM
checkbox in datagrid asad_prog VB.NET 0 November 25th, 2006 02:41 PM
Checkbox in the datagrid sadermine VB Components 0 August 16th, 2005 10:36 PM
CheckBox in DataGrid Baby_programmer ASP.NET 1.x and 2.0 Application Design 2 March 11th, 2005 12:42 AM
checkbox in datagrid joekske VB How-To 1 June 3rd, 2004 02:31 PM





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