473,398 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

checkbox populate with array?

I am using a checkbox as follows:
protected System.Web.UI.WebControls.CheckBoxList cblReading;

Now I store the index(checked marked) in an array for postback method, i.e.,
I save the selected indexes in array :
ArrayList selItems = (ArrayList)Session["webform6_cblReading"];

And I have to repopulate the cblReading on post back.
DataView for ReadingsList
// property delivers the list of Reading
private DataView ReadingsList
{
get
{
DataSet myDataSet = new DataSet ();
myDataSet.ReadXml(Server.MapPath("PersonalInterest s/Readings.xml"));
return (myDataSet.Tables["reading"].DefaultView);
}
}
There should be two for loops

private void FillcblReading(DataView data)
{

this.cblReading.DataSource = data;
this.cblReading.DataMember = "title";
this.cblReading.DataTextField = "text";
this.cblReading.DataValueField = "value";
this.cblReading.DataBind();
ArrayList selItems = (ArrayList)Session["webform6_cblReading"];
if ((ArrayList)Session["webform6_cblReading"] != null)
{
foreach (? in selItems)
{

// Check to see where the index is and assign the item.Selected = true
foreach (ListItem item in this.cblReading.Items)
{
item.Selected =
}
}
}
}
}

--
macupryk - forum member
http://www.visual-basic-data-mining.net/forum
Nov 16 '05 #1
0 2303

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

Similar topics

0
by: claudel | last post by:
Hi I have a newb PHP/Javascript question regarding checkbox processing I'm not sure which area it falls into so I crossposted to comp.lang.php and comp.lang.javascript. I'm trying to...
5
by: DotNetJunkies User | last post by:
1. i want to populate checkboxlist using javascript only at client side ....how can i do this..by populate word i mean that checkboxes should be checked or unchecked on some condition basis.......
2
by: Andrew | last post by:
Hi, I have a problem capturing the checkboxes that are checked, I get false irrespective of wether they are checked or not. I have gone thru the sample code on this forum, but they dun seem to...
1
by: rodchar | last post by:
hey all, is the following even possible? i have a datagrid with checkboxes on each row, when a user clicks on the checkbox i'd like to populate one of the fields in the grid with the current...
2
by: Paul Morrison | last post by:
Hi, I am new to Javascript and am having a bit of difficulty. On my site, in order for a member to unsubscribe from an article, they go to the'Unsubscribe' page where they get a table of all of...
1
by: WebArtist8248 | last post by:
Hi all, Trying to figure out how to use a checkbox in a form and have JavaScript populate another field. For instance, I have 2 fields: DaytimePhone and EveningPhone and I have a checkbox that...
4
by: Matt | last post by:
I am no JavaScript guru so please bear with me and be as detailed as possible with your response. I thank you in advance. I have an ASP page that contains form elements. I also have an inline...
0
by: Frank Miverk | last post by:
Hi, I am not understanding how the Remember Me checkbox is supposed to work here. I have a LoginCtrl (asp.net 2.0, framework 2.0) and all I want to do is remember the user the next time if they...
0
by: Nolanclark | last post by:
Hi there. I've read a previous thread regarding the Old VB 6 checkbox array and how it's not really needed any more. That's fine, but I'm not really sure how to implement the checkbox control array...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
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...
0
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,...

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.