How to add CheckBoxList item on StringBuilder Use to Linq
<p>How can I add CheckBoxList Item on String Builder. </p>

<pre><code>CheckBoxList cblItem = new CheckBoxList();
cblItem.ID = "cblItem";

var MainCatGroup = subCatDet.GroupBy(q =&gt; q.catCode).Select(q =&gt; new { CatName = q.Key, Items = q.ToArray() }).Select(q =&gt; new { CatName = q.CatName, Items = q.Items.OrderBy(t =&gt; t.catCode).ToArray() }).ToArray();
foreach (var mainCat in MainCatGroup)
{
    sb.Append(string.Format("&lt;li&gt;&lt;a href=\"javascript:void(0)\"&gt;{0}&lt;/a&gt;", mainCat.CatName.ToString()));
    sb.Append(string.Format("&lt;ul&gt;"));

    foreach (var item in mainCat.Items)
    {
        string Subcat = item.subCat.ToString();
        string catCode= item.catCode.ToString();
        sb.Append(string.Format("&lt;li&gt;"));
-----&gt;  sb.Append(string.Format(cblItem.Items.Add(new ListItem("{0},{1}")), Subcat, catCode));     &lt;----
        sb.Append(string.Format("&lt;/li&gt;"))
     }
        litList.Text = sb.ToString();
    }
</code></pre>

<p>So, How can i edit below the line? </p>

<pre><code>sb.Append(string.Format(cblItem.Items.Add(new ListItem("{0},{1}")), Subcat, catCode));
</code></pre>