in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Serverside tracking of selected key

Last post 10/26/2007 5:00 PM by Mehul Harry (Developer Express). 8 replies.
Page 1 of 1 (9 items)
Sort Posts:
Previous Next
  • 10/25/2007 3:50 AM

    Serverside tracking of selected key

    Hi,

    which event of the AspxGridView can I use to make sure at any time the key of a selected row had been written to a (http)Session variable?  

    I have tried to use the BeforePerfomDataSelect as wel as the focusRowChanged and to override the DataBind, but I still have the problem that when the grid is loaded for the first time I have no key written to the Http Session.

    I use the pager and have the AllowFocusedRow=true;

    Thanks,

    Albert Jan

  • 10/25/2007 7:36 PM In reply to

    Re: Serverside tracking of selected key

    Hello Albert,

    I'm not sure I understand the scenario. Can you describe it in more detail and perhaps upload a sample please?

    Also, you might consider using the ASPxClientGridView.SelectionChanged Event on the client side to invoke CustomCallBack.

    Thanks.

  • 10/26/2007 3:57 AM In reply to

    Re: Serverside tracking of selected key

    Hi Mehul,

    In many places in my application I use controls that should display content related  to the selected row in the gridviews. So I have inherited the Gridview, and I want the GridView to save the keyvalue of the selected row to the Http session.

    This works fine when the user has realy clicked a row, but when the page is first loaded, the gridview shows  the first line as being selected, but on the serverside I haven't been able to set the key to a session variable. So when the user moves to a different (part of the) page the information displayed is not related to the selected row.

    The example included performs a custom callback when the second tab is chosen. This works when the user has selected a row, but fails when the user immediately clciks the orders tab.

     

    Thanks

     

    Albert Jan

  • 10/26/2007 4:25 AM In reply to

    Re: Serverside tracking of selected key

    Hello Albert,

    Take a look at this tutorial that maintains the focused rows even between page changes. If the session variable is null then it select the first row but perhaps you can save this somewhere and reload it if it's null:

    Enable one row selection in the grid with Radiobuttons

    Thanks.

    Filed under: ,
  • 10/26/2007 4:42 AM In reply to

    Re: Serverside tracking of selected key

    Hi Mehul,

    Thanks for your answer. However the given example still depends on the user to click the row. This also works in my solution. But when in my solution the page is just opened the gridview displays the first row as being selected(the first row has the focus). Without the user selecting a row the information on the server should be consistent with the page displayed and therefore the server should 'know' the keyvalue of the row that seems to be selected (and have it stored as Session variable).

     

    Thanks

     

    Albert Jan

  • 10/26/2007 6:59 AM In reply to

    Re: Serverside tracking of selected key

    Hi Mehul, 

    "but perhaps you can save this somewhere and reload it if it's null:" 

    I don't understand this part of your anwer. How should I do this? 

    Thanks,

    Albert Jan

  • 10/26/2007 8:17 AM In reply to

    Re: Serverside tracking of selected key

    Hi Albert,

    The next major ASPxGridView version (7.3) will contain the
    SettingsBehavior.ProcessFocusedRowChangedOnServer property. If you set it
    to true, a callback(postback) will be sent to the server once a focused row
    is changed and thus you will be able to trap this moment and save the
    focused row key value to a session variable.

    For now, to resolve the problem, you may handle the FocusedRowChanged server
    side event. It will be triggered when the current page is changed or the
    grid is loaded for the first time.

    Thanks,
    Plato

    Developer Express Support
    Thanks,

    Plato

    Developer Express Support
  • 10/26/2007 9:06 AM In reply to

    Re: Serverside tracking of selected key

    Great to head the new version will have this event!

    Thank you for your help,

    Albert Jan

  • 10/26/2007 5:00 PM In reply to

    Re: Serverside tracking of selected key

    Hello Albert,

    You can download the beta for 2007 vol 3 now if you're a DXperience customer:

    http://www.devexpress.com/Products/NET/DXperience/WhatsNew2007v3/index.xml

    Thanks.

Page 1 of 1 (9 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED