Highlight row in a gridview after formview insert

Discussion in 'ASP .Net Web Controls' started by Feege, Jan 9, 2006.

  1. Feege

    Feege Guest

    I am using a formview to insert a new record into a gridview.

    After the insert is done, I want to highlight the new record.

    I have written some code to do this which is called on the
    "OnItemInserted" event on the formview

    GridView1.DataBind()
    GridView1.PageIndex = 1
    Dim Row As GridViewRow = GridView1.Rows(5)
    Row.Style("background-color") = "#FF3333"

    The pageindex works, but the highlighting of the row does not work.

    Any ideas ?

    Thanks

    Geoff
     
    Feege, Jan 9, 2006
    #1
    1. Advertising

  2. Hi Geoff,

    I'd probably use the built in SelectedRowStyle to highlight the row,
    Just select the newly inserted item in the postback. You might also
    want to change the highlight color do differ from the normal selected
    item color, also in the postback code.

    Grtz,

    Wouter van Vugt
    Trainer - Info Support
    http://blogs.infosupport.com/wouterv
     
    Wouter van Vugt, Jan 11, 2006
    #2
    1. Advertising

  3. Or derive from GridView and implement an extra style which you can use,
    e.g. this is the harder way.

    Grtz,

    Wouter van Vugt
    Trainer - Info Support
    http://blogs.infosupport.com/wouterv
     
    Wouter van Vugt, Jan 11, 2006
    #3
    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. Fernando Lopes
    Replies:
    0
    Views:
    3,195
    Fernando Lopes
    Apr 28, 2005
  2. Dan Sikorsky
    Replies:
    2
    Views:
    11,486
    SiliconViper
    Apr 30, 2009
  3. H5N1
    Replies:
    0
    Views:
    2,721
  4. Marc Pavo
    Replies:
    1
    Views:
    663
    Marc Pavo
    Nov 17, 2006
  5. D
    Replies:
    0
    Views:
    219
Loading...

Share This Page