a Store question

  1. #1

    a Store question

    Hi All,

    How can i bind a Dictionary<int,string> collection to a Store object ?


    I try like that :
        <ext:Store ID="stFirms" runat="server" AutoLoad="true">
        <Reader>
            <ext:JsonReader>
                <Fields>
                    <ext:RecordField Name="id" Type="Int" />
                    <ext:RecordField Name="firm" Type="String" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>

    and than at code behind:
    this.stFirms.DataSource = SqlLibrary.RegisteredFirms();// it returns a Dictionary<int,string> collection
    this.stFirms.DataBind();

    I use that Stoe for a ComboBox, it loads number of the collection but nothing seen in ComboBox..
    And the here is the combo :
    <ext:ComboBox 
    ID="cmbFirm"
    runat="server" Editable="false"
    StoreID="stFirms"
    FieldLabel="Firm" 
    DisplayField="firm"
    ValueField="id"
    Mode="Local"
    ForceSelection="true"
    TriggerAction="All"
    EmptyText="Choose your firm..."
    Width="250">
    </ext:ComboBox>




    Please check the screen capture for the comboBox..


    Thanks..




  2. #2

    RE: a Store question



    Have you tried a List of Dictionaries? The dictionary key needs to match the RecordField names... So you would need to return a collection of dictionary<string, string>

    Edit: Found out that Coolite (v0.82) does not support binding to a dictionary. You can use the other solution provided at this link:
    http://forums.ext.net/showthread.php?postid=17968.aspx

    You would have to specify each fields here.

Similar Threads

  1. [CLOSED] Question about store
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 27, 2012, 11:49 AM
  2. [CLOSED] Store Question
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 13
    Last Post: Feb 25, 2011, 12:02 AM
  3. A question about store
    By wxmayifei in forum 1.x Help
    Replies: 2
    Last Post: Oct 14, 2010, 8:35 AM
  4. [CLOSED] [1.0] Store Submit Question
    By ljankowski in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Aug 20, 2010, 3:38 PM
  5. [CLOSED] Store Question
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Apr 03, 2009, 3:56 PM

Posting Permissions