Highlight row in a gridview after formview insert

F

Feege

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
 
W

Wouter van Vugt

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top