Thursday, January 12, 2012

How to set column width and height a CheckBoxList in an ASP.NET?

Posted by Rahul Kharde at 9:57 PM

There is always common problem for CheckBoxList control that it doesn't have set of column width and row height.

The problem is that since I can't seem to figure out how to set the width of the individual cells, which means the columns in each list don't match up with the other lists, and the design doesn't look clean.

Below image there is two checkbox list control and each contain 3 columns

Set the RepeatColumns to 3

To solve we are create style sheets. And we need to set the same height and width properties in the class and apply that class to both the CheckBoxList control.

e.g

<style type="text/css">

.chkBoxList tr

{

height:25px;

}

.chkBoxList td

{

width:150px;

}

</style>

<asp:CheckBoxList ID="CheckBoxList1" runat="server" RepeatColumns="3" CssClass="chkBoxList"> </asp:CheckBoxList>

Output

After applying the class it will look like

Download

For Download Code Click Here



If you enjoyed this post and wish to be informed whenever a new post is published, then make sure you subscribe to my regular Email Updates. Subscribe Now!


Kindly Bookmark and Share it:

YOUR ADSENSE CODE GOES HERE

0 comments:

Have any question? Feel Free To Post Below:

 

Popular Posts

Recent Comments

© 2011. All Rights Reserved | Help to understand .Net | Template by Blogger Widgets

Home | About | Top