MultiSelect Control values not getting selected

  1. #1

    MultiSelect Control values not getting selected


    I am using multiselect control. My declaration code is
    <ext:MultiSelect ID="mlProdPlace" PaddingSpec="0 50 0 50" runat="server" MultiSelect="true"
                            DisplayField="Field1" ValueField="Field2" FieldLabel="Production Places"
                            Width="500" Height="200" AllowBlank="false">
                                <ext:Store runat="server">
                                        <ext:Model runat="server">
                                                <ext:ModelField Name="Field1">
                                                <ext:ModelField Name="Field2">
    i want to select a value at server side based on the data.I have written code like this in direct event

    mlProdPlace.SelectedItems.Add(new Ext.Net.ListItem { Text = objProjLoc.Field1, Value = Convert.ToString(objProjLoc.Field2) });
    but it is not getting selected.

    Please help.

    Rashid siddique
    Last edited by Daniil; Aug 11, 2014 at 6:29 AM. Reason: Please use [CODE] tags
  2. #2
    What I do is:

    combo.SelectedItem.Value = value;
    Being "value" the corresponding ValueField as string.

    I think you should also specify the data type and IDProperty in your store, like this:

                                        <ext:Model runat="server" IDProperty="Field1">
                                                <ext:ModelField Name="Field1" Type="Int" />
                                                <ext:ModelField Name="Field2" Type="String" />
  3. #3
    Thanks ALobpreis for the reply

    I got the solution. I have used DropDownField.Setvalue() method, which dosent even require an UpdateSelectedItems method to be called.

Similar Threads

  1. Replies: 0
    Last Post: Oct 12, 2012, 10:45 AM
  2. [CLOSED] Add values to Multiselect manually
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 11, 2012, 8:09 AM
  3. Replies: 1
    Last Post: Mar 29, 2012, 9:18 PM
  4. Replies: 0
    Last Post: Apr 29, 2011, 8:37 PM
  5. Multiselect - Get Values and Update Store
    By Tbaseflug in forum 1.x Help
    Replies: 6
    Last Post: Jul 13, 2009, 3:24 PM

Tags for this Thread

Posting Permissions