473,856 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CheckBoxList strange behaviour on changing from enabled to disabled.

I have a CheckBoxList like this one:

<asp:CheckBoxLi st id="chkReport" runat="server" DataValueField= "rptID"
DataTextField=" RptName" Enabled="False"
RepeatLayout="F low"></asp:CheckBoxLis t>

I fill it with items from a database and check/select items corresponding to
another database query.
When first displayed, the user cannot select/deselect items since
Enabled=false. After pushing a button on the page the list gets
Enabled=true.
The problem is, when changing from disabled to enabled, all selections are
cleared and none of the checkboxes remain ticked. Btw viewstate is enabled.

Anyone heard of this problem and/or know a possible solution?
Thanks in advance...

Dennis
Nov 17 '05 #1
1 1725
Actually, the selections are cleared no matter what button i press, as long
as it generates a postback. If the CheckBoxList has Enabled=true, this does
not occur. Is there something wrong with CheckBoxList and the Enabled
property?

"Dennis Johansson" <ip*****@hotmai l.com> wrote in message
news:3f******** @news.wineasy.s e...
I have a CheckBoxList like this one:

<asp:CheckBoxLi st id="chkReport" runat="server" DataValueField= "rptID"
DataTextField=" RptName" Enabled="False"
RepeatLayout="F low"></asp:CheckBoxLis t>

I fill it with items from a database and check/select items corresponding to another database query.
When first displayed, the user cannot select/deselect items since
Enabled=false. After pushing a button on the page the list gets
Enabled=true.
The problem is, when changing from disabled to enabled, all selections are
cleared and none of the checkboxes remain ticked. Btw viewstate is enabled.
Anyone heard of this problem and/or know a possible solution?
Thanks in advance...

Dennis

Nov 17 '05 #2

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

Similar topics

0
1351
by: Richard Hollenbeck | last post by:
I've asked this question before but over a month later I still don't have an answer. A few people did try to help and I am thankful, but I really didn't get the problem solved. I'll try to ask the question another way. I have a main form for collecting grades for students' activities. Inside the form is a subform which displays four fields: studentID, lName, fName, and score. The first three fields are only to identify the student and...
0
7953
by: Bryce Budd | last post by:
Hello All, I've been a taker of information from newsgroups for a long time and thought I'd finally make a contribution back to the community whose supported me when I've needed it. After all before commercialization took over that was the beauty of the Internet! I've create a checkboxlist validator control...something MS should have done originally in my opinion, but nonetheless here it is. It's a C# control, sort of IE specific. ...
4
8076
by: dm_dal | last post by:
Is there a know issue surrounding the CheckBoxList control and it's viewstate? When my control is created, it's ListItems are checked as needed, but on a postback, they loose their Selected status. David
2
2202
by: Xarky | last post by:
Hi, I have a checkboxlist and would like to set it as readonly. The properties that I found for it is the Enabled(true, false). Now when I am setting it to false, it is becoming as readonly, but is changing its appearance and does not seems to be so presentable (color becoming greyish, text and check boxes are not clear). I tried to change the fore-color, but in disabled state, it has no effect. Can someone tell me how I can get...
0
1001
by: Tommy Martin | last post by:
When the checkboxlist control is disabled the checks are not saved in the viewstate of the page so when another control has post back enabled i lose my checked items. Is there a way to force this to be saved?
2
1543
by: Ferret Face | last post by:
Is there a term for an individual who is half way between a Newby and a Novice? Anyway, getting down to business... I am trying to develop an on-line application form for my company's website. In it I have a number of 'Yes/No' or 'Select This Option' type questions where if an option is checked it will disable/enable another. I ended up using ClientScriptBlocks of JavaScript to accomplish this behaviour instead of an ASP.NET solution. ...
10
1423
by: Amit | last post by:
Hi I have occured a very strange situation. The scenario is as follows. I have two buttons in the form. First button is Load button and the second one is Delete button. As the name suggests when 'Load' button is clicked, some data is loaded on the screen. When the Delete button is hit, this data is removed and the user does not have access to it further. Load usually takes time and in some extreme situations it takes 4-5 seconds to...
2
6261
by: Bart Van Hemelen | last post by:
The situation: I have a CheckBoxList cblTest, the items are disabled in cblTest_DataBound in a foreach (ListItem oItem in cblTest.Items) loop. I provide a link that calls a client-side JavaScript that enables the items -- this works perfectly. However, when I then click a LinkButton that does a postback and I loop through the items on serverside to pick up the selected ones, it doesn't pick them up. IMHO it seems to loop though the items...
0
1348
by: Piotr Strycharz | last post by:
Hi, Here is my situation: I have disabled CheckBoxList. This CheckBoxList (actually: all of the checkboxes) is being enabled by user using javascript code. Than - user can select some of the checkboxes and post the form. In .NET 1.1 it worked as expected: when control's state was set to enable - the selected checkboxes had their Selected property set to true. However in ..NET 2.0 this does not work - althought Request.Form collection...
0
9916
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
11057
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10696
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
10782
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
10384
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
9531
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...
1
7932
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
2
4174
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3201
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.