Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Combobox enable on Enter

$
0
0

Hi,

How can I enable my combobox on ENTER keypress. It triggers postback when i press on combox arrow. But i want when user enters the value and press ENTER to trigger the postback. The user types in the desired value and it automatically suggests the options. Then when user selects desired value I want selected item to fire the postback. Now, when I type in the combo the desired value I have to press twice the enter button to show the result. Or when I click on the highlighted item to trigger the postback. Is it possible? Thank you.

Here is the code:

<div class="divComGrid"><cc1:ComboBox ID="comPosition" Height="25px" Width="300px" AppendDataBoundItems="true"
        AutoCompleteMode="Suggest" AutoPostBack="True"
        runat="server" DataSourceID="rdCombo" MaxLength="0"
        DataTextField="Position" DropDownStyle="Simple"></cc1:ComboBox></div><asp:SqlDataSource ID="rdCombo" runat="server" ConnectionString="<%$ ConnectionStrings:CompanyInfoEventsConnectionString %>"
    SelectCommand="SELECT [Position] FROM [GpiEmployees] GROUP BY [Position]"></asp:SqlDataSource><br /><div class="divComGrid"><asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="grdPosition"
        EnableModelValidation="True"><Columns><asp:BoundField DataField="FullName" HeaderText="FullName" SortExpression="FullName" /><asp:BoundField DataField="GeocellCellar" HeaderText="GeocellCellar" SortExpression="GeocellCellar" /><asp:BoundField DataField="Extention" HeaderText="Extention" SortExpression="Extention" /><asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" /></Columns></asp:GridView></div><asp:SqlDataSource ID="grdPosition" runat="server" ConnectionString="<%$ ConnectionStrings:CompanyInfoEventsConnectionString %>"
    SelectCommand="SELECT [FullName], [GeocellCellar], [Extention], [Email] FROM [GpiEmployees] WHERE ([Position] = @Position)"><SelectParameters><asp:ControlParameter ControlID="comPosition" Name="Position" PropertyName="SelectedValue"
            Type="String" /></SelectParameters></asp:SqlDataSource>


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>