GridView EnableSortingAndPagingCallBacks Select command.

Discussion in 'ASP .Net Web Controls' started by MikeS, Nov 13, 2006.

  1. MikeS

    MikeS Guest

    Has anybody got a workaround for addding the equivalent of a select
    command to a GridView that has EnableSortingAndPagingCallBack enabled
    so I can get at the selected row?
     
    MikeS, Nov 13, 2006
    #1
    1. Advertising

  2. This problem may not be solved in this way. Instead look into the
    UpdatePanel which is part of ASP.NET AJAX. It will allow you to avoid
    the full page refresh when you click the select button.

    You can see it here...

    http://ajax.asp.net/docs/mref/82a07319-001c-3fa5-43b7-74e9fc21f6f3.aspx

    Basically you place the GridView into the UpdatePanel which uses a bit
    of AJAX to change the GridView display.

    You can find a video on it on the Get Started page here...

    http://ajax.asp.net/Default.aspx

    Brennan Stehling
    http://brennan.offwhite.net/blog/

    MikeS wrote:
    > Has anybody got a workaround for addding the equivalent of a select
    > command to a GridView that has EnableSortingAndPagingCallBack enabled
    > so I can get at the selected row?
     
    Brennan Stehling, Nov 15, 2006
    #2
    1. Advertising

  3. MikeS

    MikeS Guest

    OK, Thank you. That is a good suggestion.

    I have worked with the Atlas stuff but we can't use that in this
    project in this iteration.
     
    MikeS, Nov 15, 2006
    #3
  4. I do have another suggestion you could potentially use, but it is so
    pretty or automatic. Instead of using a Select button generated for
    the GridView, you could simply place a market string into the column
    where you want the button. Then have Javascript loop over the rows in
    the table and add buttons. Normally when I have a button in a GridView
    I set the CommandArgument value with the key for the row. Hopefully
    one of your other rows has the unique key you would need so that the
    Javascript can use it to take action when the button is clicked.

    Of course you will need to instrument each of the clickable elements
    for the GridView like the sortable heading and pager links with a
    Javascript event handler which causes the buttons to be redrawn when
    the callback happens.

    If you feel confident in your Javascript skills you could attempt this
    approach. But I personally would place it in risky category as you are
    depending on a lot of things going just right.

    Brennan Stehling
    http://brennan.offwhite.net/blog/


    MikeS wrote:
    > OK, Thank you. That is a good suggestion.
    >
    > I have worked with the Atlas stuff but we can't use that in this
    > project in this iteration.
     
    Brennan Stehling, Nov 15, 2006
    #4
  5. MikeS

    MikeS Guest

    Thank you, that is interesting stuff. I will look into it.

    On the whole I guess a push for AJAX ASAP would be better than writing
    a lot of wacky code to solve a problem it solves.
     
    MikeS, Nov 16, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U3VuU21pbGU=?=

    EnableSortingAndPagingCallbacks run time setup bug?

    =?Utf-8?B?U3VuU21pbGU=?=, Mar 9, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    540
    =?Utf-8?B?U3VuU21pbGU=?=
    Mar 9, 2006
  2. =?Utf-8?B?RGVtZXRyaQ==?=

    GridView & EnableSortingAndPagingCallbacks

    =?Utf-8?B?RGVtZXRyaQ==?=, May 23, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    2,404
  3. GridView EnableSortingAndPagingCallbacks

    , Nov 21, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    762
    freeflyrw
    Jan 20, 2006
  4. how EnableSortingAndPagingCallbacks works?

    , May 24, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    679
    Brock Allen
    May 28, 2006
  5. palmiere
    Replies:
    1
    Views:
    431
    Erwin Moller
    Feb 9, 2004
Loading...

Share This Page