How to clean (really) a SelectionModel ?

  1. #1

    How to clean (really) a SelectionModel ?

    Hi, friends

    I am in trouble and I need help, please.

    I have a screen with a TabPanel. In that, there are 2 Tabs called "List" and "Edit".

    When I select one row in the GridPanel of the "List", the Tab "Edit" is actived with all the fields of the form loaded to be edited or deleted. After executed a changing, deleting or inserting, the tab "List" is actived again and refreshed (with AjaxEventArgs ever).

    My problem is that when I back to "List", I want <U>ever</U> clean the SelectedRecordID of the SelectionModel, because I already tried unsuccessfully:

    Dim sm As RowSelectionModel = Me.grdListar.SelectionModel.Primary
    sm.SelectedRow = (New SelectedRow())
    sm.UpdateSelection()
    and

    Dim sm As RowSelectionModel = Me.grdListar.SelectionModel.Primary
    sm.SelectedRows.Clear()
    sm.UpdateSelection()

    My ASPX

    <SelectionModel> 
        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
            <AjaxEvents>
                <RowSelect OnEvent="SelecionaLinha">
                    <EventMask ShowMask="true" Msg="Carregando..." /> 
                </RowSelect>
            </AjaxEvents> 
        </ext:RowSelectionModel>
    </SelectionModel>
    (...)

    My biggest problem is after a deleting, because the sm.SelectedRecordID doen't get cleaned

    Dim sm As RowSelectionModel = Me.grdListar.SelectionModel.Primary
    Dim intCod As Integer = CType(sm.SelectedRecordID, Integer)
    even using before:
    sm.SelectedRows.Clear() or sm.SelectedRow = (New SelectedRow())

    even trying select another row in the list!


    <DIV id=result_box dir=ltr style="TEXT-ALIGN: left">How to clean effectively the SelectionModel ?


    <DIV id=result_box dir=ltr style="TEXT-ALIGN: left">I hope you understood my problem (and my English), sorry.


    <DIV id=result_box dir=ltr style="TEXT-ALIGN: left">Thank you very much !
    Eliézer
  2. #2

    RE: How to clean (really) a SelectionModel ?

    What I use is...

    grdListar.AddScript("{0}.getSelectionModel().clearSelections();", grdListar.ClientID);
    Hope this helps...
  3. #3

    RE: How to clean (really) a SelectionModel ?

    Thank you for help!

    ... but where (exactly) do you suggest this command ?

    Regards
    Eliézer

  4. #4

    RE: How to clean (really) a SelectionModel ?

    On AjaxEvent (Code-Behind).
  5. #5

    RE: How to clean (really) a SelectionModel ?

    Thank you!

    I just resolved my problem, disabling the property SelectionMemory!

    Only this:

    <ext:GridPanel ID="grdListar" 
    runat="server" 
    StoreID="Store1" 
    StripeRows="true"
    Title="Itens Cadastrados"
    Icon="Table"
    TrackMouseOver=true
    SelectionMemory=Disabled>

    <DIV id=result_box dir=ltr style="TEXT-ALIGN: left">I still am a beginner with Coolite...

    [ ]'s

Similar Threads

  1. [CLOSED] How to clean up dynamically created controls?
    By jchau in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 23, 2011, 9:51 AM
  2. [CLOSED] Clean GridPanel
    By rnfigueira in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 18, 2011, 9:10 PM
  3. [CLOSED] GridPanel doesn't clean selected row
    By kenanhancer in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 01, 2011, 8:11 AM
  4. Replies: 6
    Last Post: Feb 09, 2010, 4:32 PM
  5. Replies: 1
    Last Post: Nov 17, 2009, 12:42 PM

Posting Permissions