Dynamic control CheckBoxList losing style after selected index event - ASP.Net C#
<p>I have checkBoxList control in which I am adding list items dynamically. I am applying style to some of the list items while creating. But, on the run time, when I am selecting any list Item, all the list items which have style applied to them lose their style. How can I fix it?</p>

<pre><code>foreach (Group group1 in groups)
{
      if (wObj.Id== id.ToString())
     {
         ListItem li = new ListItem(wObj.GroupName,wObj.ID.ToString());
        li.Attributes.Add("Style", "padding-left: 25px;");
        chkBoxListWorkGroups.Items.Add(li);

     }
}
</code></pre>

<p>On the selected index event, I am just checking some condition and marking the list item checked. But the issue is style is getting lost? I mean padding of all the controls is removed? How can I fix it?</p>