修改AutoComplete下拉選單寬度

AutoCompleteExtender的樣式,若要設定下拉選單的寬度比原本的欄位還要長,

就要修改CSS樣式,如下:

<style type=”text/css”>
.autocomplete_completionListElement_Empl
{
margin: 0px !important;
cursor: pointer;
overflow: auto;
width: 120px !important;
height: 200px;
text-align: left;
list-style-type: none;
/*
background-color: inherit;
color: windowtext;
border: buttonshadow;
border-width: 1px;
border-style: solid;
font-size: 10pt;
*/
}
</style>

PS. 就是這個啦!【 width: 120px !important; 】

<cc1:AutoCompleteExtender ID=”AutoCompleteExtender_empl” runat=”server” TargetControlID=”tbemplno”
MinimumPrefixLength=”1″ FirstRowSelected=”true” OnClientItemSelected=”ClientItemSelected_emplname”
ServiceMethod=”GetEmpl” CompletionInterval=”100″
CompletionListCssClass=”autocomplete_completionListElement_Empl”
    ServicePath=”../WebService/OT_AutoComplete_ws.asmx”
CompletionSetCount=”25″>
</cc1:AutoCompleteExtender>

by mhchen15 on 20 3 月, 2012 in ASP.NET C#, 程式 - Tags:
Tags:

There are no comments.

Name*: Website: E-Mail*:
XHTML: You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>