Setting GridView SelectedIndex based on a row value

Discussion in 'ASP .Net' started by Jay Pondy, Feb 25, 2006.

  1. Jay Pondy

    Jay Pondy Guest

    I have a datasource with 2 columns PKID and Description.

    The datasource is bound to a sortable GridView where the PKID field is NOT
    visible.

    If the user has a row selected before the grid is sorted I want to select that
    same row after the sort.

    How is this done using the GridView?
     
    Jay Pondy, Feb 25, 2006
    #1
    1. Advertising

  2. Set the DataKeyNames property to "PKID". Then you don't even to declare a
    column that contains this field.
    --
    Christopher A. Reed
    "The oxen are slow, but the earth is patient."

    "Jay Pondy" <> wrote in message
    news:...
    >I have a datasource with 2 columns PKID and Description.
    >
    > The datasource is bound to a sortable GridView where the PKID field is NOT
    > visible.
    >
    > If the user has a row selected before the grid is sorted I want to select
    > that
    > same row after the sort.
    >
    > How is this done using the GridView?
    >
    >
     
    Christopher Reed, Mar 3, 2006
    #2
    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. Replies:
    0
    Views:
    368
  2. Replies:
    0
    Views:
    428
  3. Froefel
    Replies:
    0
    Views:
    425
    Froefel
    Jul 24, 2007
  4. Froefel
    Replies:
    0
    Views:
    519
    Froefel
    Jul 25, 2007
  5. Froefel
    Replies:
    0
    Views:
    387
    Froefel
    Jul 25, 2007
Loading...

Share This Page