GridViewUpdateEventArgs.Keys miss after sort

Discussion in 'ASP .Net' started by ad, Jun 17, 2006.

  1. ad

    ad Guest

    I have set "Years,GradeID" as DataKeyNames of a GridView.I use the codes
    below to get the Keys value of a GridView, it is ok.

    But if I sort this GridView on Pageload like:

    gv.Sort("Years", SortDirection.Descending);

    The e.e.Keys["Years"] is not define in the RowUpdating event.

    What's problem? How can I get the Keys value after sort?



    protected void gvCheckSem_RowUpdating(object sender,
    GridViewUpdateEventArgs e)
    {
    int iYears = int.Parse(e.Keys["Years"].ToString());
    int iGrade = int.Parse(e.Keys["GradeID"].ToString());
    ad, Jun 17, 2006
    #1
    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. youngeagle

    I miss frames!

    youngeagle, Aug 24, 2004, in forum: ASP .Net
    Replies:
    11
    Views:
    647
    Vidar Petursson
    Oct 23, 2004
  2. rkk
    Replies:
    9
    Views:
    808
    CBFalconer
    Sep 24, 2006
  3. Steve Kershaw
    Replies:
    0
    Views:
    506
    Steve Kershaw
    Sep 25, 2007
  4. Sub-sort after sort

    , Nov 2, 2007, in forum: Python
    Replies:
    5
    Views:
    765
    Paul Hankin
    Nov 3, 2007
  5. Navin
    Replies:
    1
    Views:
    684
    Ken Schaefer
    Sep 9, 2003
Loading...

Share This Page