set selected index of gridview on load

Discussion in 'ASP .Net' started by WebBuilder451, May 2, 2008.

  1. I have the datakey for the gridview passed to the page using cross postback.
    How can i set the selected index of the page using this value, but only on
    load where a previous page (cross post back) exists?
    --
    (i''ll be asking a lot of these, but I find C# totally way cooler than vb
    and there''s no go''n back!!!)
    thanks (as always)

    kes
     
    WebBuilder451, May 2, 2008
    #1
    1. Advertising

  2. WebBuilder451

    Teemu Keiski Guest

    Hi,

    you can check for cross-page postback on the target page by checking
    PreviousPage property for null reference. I've blogged about that at:
    http://aspadvice.com/blogs/joteke/a...age-and-PreviousPage.IsCrossPagePostBack.aspx

    So basically in Page_Load of your target page, check with previous technique
    if you're in cross-page post and if you are then just set the property .

    --
    Teemu Keiski
    AspInsider, ASP.NET MVP
    http://blogs.aspadvice.com/joteke
    http://teemukeiski.net

    "WebBuilder451" <> wrote in message
    news:...
    >I have the datakey for the gridview passed to the page using cross
    >postback.
    > How can i set the selected index of the page using this value, but only
    > on
    > load where a previous page (cross post back) exists?
    > --
    > (i''ll be asking a lot of these, but I find C# totally way cooler than vb
    > and there''s no go''n back!!!)
    > thanks (as always)
    >
    > kes
     
    Teemu Keiski, May 3, 2008
    #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. Child X

    GridView Selected Index!

    Child X, Oct 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    778
    Child X
    Oct 28, 2006
  2. Paul
    Replies:
    3
    Views:
    1,026
  3. Sobin Thomas
    Replies:
    1
    Views:
    912
    Munna
    Aug 12, 2008
  4. mldardy
    Replies:
    0
    Views:
    973
    mldardy
    Sep 28, 2010
  5. Tomasz Chmielewski

    sorting index-15, index-9, index-110 "the human way"?

    Tomasz Chmielewski, Mar 4, 2008, in forum: Perl Misc
    Replies:
    4
    Views:
    315
    Tomasz Chmielewski
    Mar 4, 2008
Loading...

Share This Page