Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange Listview behaviour
Message
From
21/07/2006 12:58:23
 
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
01138022
Message ID:
01138594
Views:
20
Very strange, Pete. I tried different variations of this and it still works for me every time. So, either your row, dr["PayDetailsConf"], does not contain true when you think it does, or there is code elsewhere that is un-checking your items. Have you stepped through the code in the debugger?

~~Bonnie



>Hi Bonnie, the rest of the code is simply adding more subitems and obviously adding the item to the listview, as I stated, the first item in the list is checked, here's the code anyway
>
>
>private void LoadListView()
>        {
>
>                this.lvClaims.Items.Clear();
>                ListViewItem lvItem;
>                string ClaimRef;
>                string PathToDBOForm;
>
>                foreach (DataRow dr in this.dsClaims.Tables[0].Rows)
>                {
>                    lvItem = new ListViewItem(dr["PayDetailsConf"].ToString());
>                    lvItem.Text = "";
>                    lvItem.Checked = (bool)(dr["PayDetailsConf"]);
>                    lvItem.SubItems.Add(dr["PayDetailsConfDate"].ToString());
>                    lvItem.SubItems.Add(dr["PayDetailsConfUser"].ToString());
>                    ClaimRef = dr["ClaimRef"].ToString();
>                    lvItem.SubItems.Add(ClaimRef);
>
>                    lvItem.SubItems.Add(dr["CreditorName"].ToString());
>                    lvItem.SubItems.Add(dr["ClaimStatus"].ToString());
>                    lvItem.SubItems.Add(dr["AdmitList"].ToString());
>                    lvItem.SubItems.Add(dr["PayBlockCode"].ToString());
>                    lvItem.SubItems.Add(String.Format("{0:#,#,#,#.00}", dr["AdmittedBalUSD"]));
>                    lvItem.SubItems.Add(DateUtils.ShortDate(dr["Article39LetterDate"].ToString(), null));
>                    lvItem.SubItems.Add(DateUtils.ShortDate(dr["Article39AmendDate"].ToString(), null));
>                    lvItem.SubItems.Add(dr["Article39Code"].ToString());
>                    lvItem.SubItems.Add(dr["PayDetailsID"].ToString());
>                    lvItem.SubItems.Add(dr["PayAddressID"].ToString());
>                    lvItem.SubItems.Add(dr["Article39Narrative"].ToString());
>
>
>                    PathToDBOForm = this.BuildPath(ClaimRef);
>
>                    if (File.Exists(PathToDBOForm))
>                    {
>                        lvItem.SubItems.Add(PathToDBOForm);
>                        lvItem.ImageIndex = 1;
>                    }
>
>                    this.lvClaims.Items.Add(lvItem);
>            }
>        }
>
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform