This is a migrated thread and some comments may be shown as answers.

Rad List box values are bind two time

0 Answers 35 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
mohamed
Top achievements
Rank 1
mohamed asked on 19 Feb 2013, 10:48 AM


if i put   ProjectName.DataBind(); after the records are come in radlistbox
if i don't put that record are shown one time but for each doesn't go inside

see the screen shot
.cs

if (service[0].grupname.ToString() == "SubCon")
                                {
                                    using (var db = new DoskContractServicesDataContext(Globals.strCon))
                                    {
                                       
                                        var Projec = (from a in db.DSProjectMasters where a.FinalStatus == "Cls" && a.Status != "Del" select new { a.ProjectCode, a.ProjectTitle }).ToList();
                                        ProjectName.DataSource = Projec;
                                        ProjectName.DataValueField = "ProjectCode";
                                        ProjectName.DataTextField = "ProjectTitle";
                                        ProjectName.DataBind();
                                    }
 
                                    ProjNam.Visible = true;
                                    ProjectName.Visible = true;
 
                                    string md = service[0].Projectid.ToString();
 
                                    string[] Projid = md.Split(',');
 
                                    for (int i = 0; i < Projid.Length; i++)
                                    {
                                        string val = Projid[i].ToString();
                                        int m = 0;
 
                                        foreach (RadListBoxItem item1 in ProjectName.Items)
                                        {
                                            string Md1 = ProjectName.Items[m].Value;
                                            if (Md1 == val)
                                            {
                                                item1.Checked = true;
                                            }
                                            m++;
                                        }
                                    }
                                }



Thanks Advance,
Mohamed.

No answers yet. Maybe you can help?

Tags
ListBox
Asked by
mohamed
Top achievements
Rank 1
Share this question
or