Get ComboBox Selected Item

  1. #1

    Get ComboBox Selected Item

    hi,

    i have loaded ComboBox items on page loading time...Initially EmptyText is "Select".Then i have Clicked on separate Image ..that time i want to change ComoBox Selected item..but i cant do this,text always show "Select".i want c# code.please reply me..

    by..
    madan
  2. #2

    RE: Get ComboBox Selected Item

    Please post simplified .aspx code sample demonstrating this scenario and what you have built so far.*

    Geoffrey McGill
    Founder
  3. #3

    RE: Get ComboBox Selected Item

    In PostBack


    if (!IsPostBack)


    {



    ds = obj1.GetDataSet("select article_status_type as ATRICLE_STATUS_TYPE,ARTICLE_STATUS_DESC from

    article_status where 1=1 and Sys_id = '1'");




    this.Store1.DataSource = ds;


    this.Store1.DataBind();





    }

    in Html view




    <ext:Store ID="Store1" runat="server" AutoLoad="true" >


    <Reader>


    <ext:JsonReader >


    <Fields>


    <ext:RecordField Name="ARTICLE_STATUS_TYPE" />


    <ext:RecordField Name="ARTICLE_STATUS_DESC" />


    </Fields>


    </ext:JsonReader>


    </Reader>


    </ext:Store>



    <ext:ComboBox runat="server"


    ID="cmb_status"


    Width="170px"


    StoreID="Store1"


    Editable="false"


    DisplayField="ARTICLE_STATUS_DESC"


    ValueField="ARTICLE_STATUS_TYPE"


    TypeAhead="true"


    Mode="Local"


    ForceSelection="true"


    TriggerAction="All"


    SelectOnFocus="false" />






    now i got Items in Combo Box.


    then i want change ComoBox Text on Image Click event
    sample is,



    <img src="images/toolbar/excel.png" alt="Apply" title="Apply" id="apply_fil" />




    <U>on event for apply_fil id</U>


    <ext:ScriptManager ID="ScriptManager1" runat="server" RenderStyles="File" >


    <CustomAjaxEvents>


    <ext:AjaxEvent Target="apply_fil" OnEvent="Apply_filter">


    <EventMask ShowMask="false" />


    </ext:AjaxEvent>





    <</CustomAjaxEvents>


    </ext:ScriptManager>




    In C# code is,




    protected void Apply_filter(object sender, AjaxEventArgs e)


    {
    string s="Antony";



    cmb_status.SelectedItem.Text = s;






    }

    In this time also the selected text shown "Select".

    How can i Change Selected Text at this time..


    help me


    by
    madan

Similar Threads

  1. [CLOSED] Always selected Item is nothing for combobox as menu item
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 04, 2011, 4:51 PM
  2. [CLOSED] get the value of the selected item from a combobox via js
    By Edward in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 03, 2010, 12:06 PM
  3. [CLOSED] ComboBox set selected item value
    By pumpkin in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 27, 2009, 7:26 AM
  4. Get Combobox Selected item
    By yarlenvas in forum 1.x Help
    Replies: 3
    Last Post: Mar 08, 2009, 2:04 PM
  5. [FIXED] [V0.6] ComboBox and Selected Item
    By amitpareek in forum Bugs
    Replies: 2
    Last Post: Sep 16, 2008, 5:03 PM

Posting Permissions