Monday 20 March 2017

Set Selected checkboxlist in c#

/// Codebehind

if (MemberInformationDt.Rows[0]["GovtScheme"].ToString() != "")
        {
            string GovtScheme = MemberInformationDt.Rows[0]["GovtScheme"].ToString();   
            for (int j = 0; j < chkGovtScheme.Items.Count; j++)
            {
                DataRowView dv = chkGovtScheme.Items[j] as DataRowView;
                int vv = (int)dv["SchemeID"];
                if (GovtScheme.Contains(vv.ToString()))
                {
                    chkGovtScheme.SetItemChecked(j, true);
                }
            }

        }



No comments:

Post a Comment

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...