Databind / Reload Store and GridPanel Problem

  1. #1

    Databind / Reload Store and GridPanel Problem

    I have a combobox at the top of the page with two choices (A and B). Page loads with option A selected. There is a gridpanel tied to a store which loads information.

    Now I select choice B on the combobox. This basically changes the store (new query for new information from db) to get new information and databinds it again.

    The gridpanel changes its data to correspond to the new query. The problem comes in when I try to read column values in the gridpanel, all data is from previous store (the one that corresponds to option A). Am I missing a command? The data that I see in the gridpanel changed when I changed from Option A to Option B, but the underlying data hasn't changed.

    For example:
            string strSQL;        
            RowSelectionModel sm = this.gpnlProjectList.SelectionModel.Primary as RowSelectionModel;        
            string ID = sm.SelectedRow.RecordID as string;
    ID never changes. It always stays the same as whatever option was loaded on page load. I think there is a command I need to run after user changes Combobox besides Store1.DataBind(). I am hoping someone out there can help.

    On a side note, I can't seem to find out how to make the coolite combobox just reload the page on change of selected item. If user changes from Option A to Option B, make the page reload.. (Basically make the coolite control behave like a regular drop down list). The reason I don't use a regular drop down list is because it is not allowed in the TOPBAR/TOOLBAR of a panel.

    Thanks for the help!
  2. #2

    RE: Databind / Reload Store and GridPanel Problem

    Ok, i figured out what is going on. Even though I have made the Row Selection Model of my grid 'Single Select = true', it keeps saying the count for selectedrows of the gridpanel are 2.

    Here is the selection model of the gridpanel in markup:
    <SelectionModel>
       <ext:RowSelectionModel ID="RowSelectionModel2" runat="server" SingleSelect="true">
       </ext:RowSelectionModel>
    </SelectionModel>
    So this is what is going on. I load page with combobox = Option A. I click on a row. I then change combobox to Option B, the gridpanel refreshes with its new information. I click on a new row, and when I look at the number of rows selected, it says 2, even though i have singleselect='true'.


    I am hoping someone out there can help me out on this. Very wierd behavior!
  3. #3

    RE: Databind / Reload Store and GridPanel Problem

    Hi,

    Try to set SelectionMemory="Disabled" *for GridPanel


  4. #4

    RE: Databind / Reload Store and GridPanel Problem

    Thanks alot. I've been banging my head for about 3 hours on this. Do you happen to know why the gridpanel says 2 selected rows even when the row model says singleselect=true? When you click on the rows, it selects only one at a time so thats good, but the problem here was that the gridpanel was storing the previous selected row...very wierd. Thanks again!
  5. #5

    RE: Databind / Reload Store and GridPanel Problem

    Hi,

    Is the SelectionMemory="Disabled"solved your problem?


  6. #6

    RE: Databind / Reload Store and GridPanel Problem

    Yes it did. Thank you again! I appreciated your quick response!!

Similar Threads

  1. Replies: 1
    Last Post: Dec 12, 2011, 5:14 PM
  2. Replies: 4
    Last Post: Oct 11, 2010, 3:39 PM
  3. Problem with Store.DataBind
    By flaviodamaia in forum 1.x Help
    Replies: 0
    Last Post: Nov 20, 2009, 9:22 AM
  4. Replies: 2
    Last Post: Nov 02, 2009, 8:27 AM
  5. Store.reload() problem
    By Dgsoft.ru in forum 1.x Help
    Replies: 1
    Last Post: May 28, 2009, 2:14 PM

Posting Permissions