473,626 Members | 3,439 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Repeater with CheckBox and Paging

I am attempting to build a repeating list using a repeater control. I want
to add a checkbox to each item (line) and 'Select All' and 'Clear All'
buttons.

I have figured out how to do this until it comes time to implement paging.

Without paging I can iterate through the repeater when I click 'Select All'
and set the checked property to true for all items in the repeater.

However when I implement paging, I have to rebind the repeater which causes
my selections to go away.

Does anyone have working example code?

Thanks,
Mark
Nov 18 '05 #1
2 5035
Hi Mark,
Thanks for posting in the community! My name is Steven, and I'll be
assisting you on this issue.
From your description, you use the repeater control to hold a list of
checkboxes and you implemented your custom paging for the repeater so as to
rebind the repeater with different datas when different page of records if
requested. However, you found that after rebinding the data when paging ,
the checkboxes's value for the previous page will lose. So you 're looking
for some means to remain the checkboxes's state value, yes?
If there is anything I misunderstood, please feel free to let me know.
As for this problem, here is some of my suggestions:
Generally, when we use the list template control to bind and display some
certain collection of datas, if the data's count is very large, we need to
page them. However, since everytime the control is binded and display, only
a certain page's data would be binded and ouput to the user. Then, the
previous page's statues will be lose. So normally, we use the following
means regarding on such problem:
1. Let all the operations which are dependent on the page's status(such as
the checkboxes's checked value) be done right
at or before the paging event happened. That means we will do data
manipulations on every page's data so that if the page changed, the former
data has been successfully dealt, we won't need to store it for further use.
For example:
We have a product lists and every product have a "selected" attribute, we
represent this attribute using a "checkbox" column in Repeater. We may need
to display all the productes in several pages, then everytime page is
changing , we need to do operation to retrieve all the states of the
checkboxes and then update the recored in the datasource(mayb e the database
server or other collections in memory)

2. We use some Collections to store the state values on the former page on
the serverside. For example, just the product lists I mentioned above. When
user clicked a page index and change the current page, we retrieve all the
checkboxes' value and then store the value in a array or ArrayList
collection and save it into the Session or Applicatoin area as temp data.
When we need to use it again, then we retrieve it from the Session or
Application. If useless, remove them.

Please consider the above suggestions. I still recommend that you deal with
a certain page's data (state value on page) within the life cyle when it is
the current page since it lose performance if you use serverside memory
(such as Session or application) to store the state datas. How do you think
of it?

If you have any questions or need any other assistance, please feel free to
post here. I'll do some further research to help you.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #2
Hi Mark,

I'm reviewing this message and found that you've posted a new thread as:
" Additional Repeater questions for Steven Cheng" on this issue.
And I've replied you in that thread. Do you feel it convenient that we
continue to discuss in that thread?
If you have any questions or need any help, please feel free to post in the
new thread. Thanks.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
546
by: Viktor Popov | last post by:
Hi, I'm trying to do the following but I can't understand what's wrong. Could you help me here! I do paging with a Repeater like this: DataSet ds = new DataSet(); dad.Fill(ds, "MyOffers"); if(ds.Tables.Rows.Count==0) Delete.Enabled=false;
0
926
by: Viktor Popov | last post by:
Hi, I'm trying to do the following but I can't understand what's wrong. Could you help me here! I do paging with a Repeater like this: DataSet ds = new DataSet(); dad.Fill(ds, "MyOffers"); if(ds.Tables.Rows.Count==0) Delete.Enabled=false;
2
11786
by: Thomas R | last post by:
Is is possible? In VS.NET 2003, Binding data to the repeater is easy, but when I try to add an ASP:checkbox to the .aspx page, the designer won't recognize it, hence the code view doesn't allow me to access it. The funny thing is that it compiles fine, and the checkboxes are there, I just can't write to them! Is there a way around this problem? My HTML is as follows:
2
1592
by: Mark | last post by:
I am trying to use a Pagable Repeater with checkboxes in ASP.Net, I cannot seem to associate the checkbox with a particular database record so I lose the checked state from page-to-page. Below is a sample 1-page ASP.Net apllication built to run against the SQL pubs database. There are contents of 2 files 1. ASPX, 2. ASPX.VB If there is anyway you can help, I'd really appreciate it.
3
2129
by: Mark | last post by:
I am looking for an example of using checkboxes in a repeater control where the checkbox state is persisted from page to page. Thank you, Mark
7
5476
by: charliewest | last post by:
Hello - I'm using a Repeater control to render information in a very customized grid-like table. The Repeater control is binded to a DataSet with several records of information. Within the Repeater control, I've placed DropDownLists and CheckBoxes. When the user has updated the information, he/he clicks the submit button which is outside the scope of the Repeater control.
2
5515
by: Ceema M via DotNetMonster.com | last post by:
Hello all, I have a nested repeater, which displays categories(parent repeater) and corresponding subcategories(child repeater). Both repeaters have checkboxes. When I check category checkbox and subcategory check boxes and click on submit button , I have to retrieve the corresponding categoryid and subcategory id, so that I can store it to a table. I am getting the categoryid but I am failing to get subcategoryid(actually I don't know...
3
7812
by: renil | last post by:
I have a repeater control that displays info. from a datatable. Each row in the repeater has a checkbox. Also, I have a delete linkbutton outside the repeater control. What I'm trying to do when the delete linkbutton is clicked is get the SubscriptionID from the repeater control for each row in which the checkbox is checked, then call a delete function. (See the code for the .aspx and .aspx.cs below.) The problem I'm having is that I...
1
1840
by: Doogie | last post by:
Hi, I have been trying to get a checkbox added to a repeater control of mine and then try to access events of the repeater control when a user clicks the checkbox. At first, since the control is tied to xsl, I added the checkbox there. That works fine, but I cannot get any information about the checkbox (i.e. checked, unchecked, etc) when I pass data from the xsl over to a method in java. I can get info on the other columns but not...
0
8268
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8202
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8641
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8366
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5575
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2628
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1812
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.