Reputation: 2509
I have a checkbox list like below:
<asp:CheckBoxList id="chx" runat="server" repeatdirection="Horizontal"> <asp:ListItem value="OPTION1">Option 1</asp:ListItem>
<asp:ListItem value="OPTION2">Option 2</asp:ListItem>
<asp:ListItem value="OPTION3">Option 3</asp:ListItem><
asp:ListItem value="OPTION4">Option 4</asp:ListItem>
</asp:CheckBoxList>
And I am dynamically adding the list items to this checkbox using the following C# code:
chx.Items.Clear();
while(dr.Read()){
if(dr.GetOracleString(0).ToString()!="Null"){
chx.Items.Add(dr.GetOracleString(0).ToString());
}
}
My requirement is whenever the new item is added in the checkboxlist, it should check whether the new item is going beyond the border(fixed width) of the page and if so the new item should go the next line of checkboxlist without overlapping below control.
Please help me to fix this.
Upvotes: 1
Views: 2012