Rosna ck

Rosna ck

  • NA
  • 10
  • 10.5k

I dinnt get checkbox list bind

Sep 25 2012 3:19 AM
this is my code:


  protected DataTable CreateDatatable()
        {
            DataTable dtskill = new DataTable();
            DataColumn dc;

            dc = new DataColumn();
            dc.Caption = "PK_SkillID";
            dc.ColumnName = "PK_SkillID";
            dc.DataType = typeof(Guid);
            dtskill.Columns.Add(dc);
            return dtskill;
        }

        protected DataTable fillDatatable()
        {
            DataTable dtskill = CreateDatatable();
            DataRow dr;
            for (int i = 0; i < chkSkill.Items.Count; i++)
            {
                if (chkSkill.Items[i].Selected == true)
                {
                    dr = dtskill.NewRow();
                    dr["PK_SkillID"] = (chkSkill.Items[i].Value);
                    dtskill.Rows.Add(dr);
                }

            }
            return dtskill;
        }

        public void BindCheck()
        {
            Bl_Trainer blobjTriner = new Bl_Trainer();

            chkSkill.DataTextField = "Name";
            chkSkill.DataValueField = "PK_SkillID";
            chkSkill.DataSource = blobjTriner.bindTrainer();
            chkSkill.DataBind();


        }
thnksssssssss.....