When I Set Width="100%" , the containerWidth no equal as the width of webdropwodn.
<table width="600px" align="center" border="1">
<tr>
<td style="width:20%;">
<asp:Label ID="lbl1" runat="server" Text="Normal DDL"></asp:Label>
</td>
<td >
<asp:DropDownList ID="ddlNormal" runat="server" Width="100%"></asp:DropDownList>
</tr>
<td>
<asp:Label ID="Label1" runat="server" Text="Infragistric DDL"></asp:Label>
<ig:WebDropDown ID="WebDropDown1" runat="server" Width="100%"
EnableAnimations="false" DropDownContainerWidth="100%"
DisplayMode="DropDownList">
</ig:WebDropDown>
</table>
I try modify the ig_dropDown.css as below but it bring unexpected container width to me too..
.igdd_DropDownListContainer
{
background-color:White;
border:solid 1px #BBBBBB;
float: left;
width:100%;
}
Any Idea to make the container width exactly equal as the webdropdown width when Width="100%"?
Hi,
I see in the designer that the DropDownContainerWidth does not accept percentage values at all. So that's why the 100% doesn't work. Maybe you can catch an event on the client side when the container is opening and set it then to the parent width.
Ed
Hi again,
Another idea: Maybe put the dropdown into a different container. Maybe your CSS idea will work if the dropdown is in a better container.
Hello Chua,
To make the container width exactly equal as the webdropdown width when DropDown width is set to 100% make sure DropDownContainerWidth is not set using designer since DropDownContainerWidth is set in pixel. One possible approach is to set DropDownContainerWidth to 0 in order for DropDownContainer to use the same width of DropDown. The below line of code achieves the same:
this.WebDropDown1.DropDownContainerWidth = Unit.Pixel(0);
Hope this helps.
Thanks,
Bhadresh