This is a discussion on "arrays?" within the ASP.NET Forum section. This forum, and the thread "arrays? are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
arrays?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
arrays?
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 = } } } } } |
|
|
|
#2
|
|||
|
|||
|
So what exactly is the problem?
(try using the [code ] [/code ] tags to make your post clearer) |
![]() |
| Tags |
| arrays |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Problems with arrays | Scream | JavaScript Forum | 2 | Jan 10th, 2008 16:15 |
| arrays images and backgroundImage | gleb | JavaScript Forum | 0 | Sep 9th, 2007 20:39 |
| Looping through arrays | assgar | Starting Out | 1 | Apr 22nd, 2007 18:43 |
| sending email arrays with php | ppgpilot | PHP Forum | 2 | Jan 25th, 2007 16:49 |
| Unique Array of Arrays | ktsirig | Other Programming Languages | 1 | Jan 27th, 2006 16:30 |