Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

ASP.NET 2.0 GridView Item Selection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ABHIJIT B - 08 Feb 2008 20:46 GMT
Hi,

I am using GridView in my web page.In that form after clicking Add
button I am again binding GridView with newly added record.

The problem I am facing is how to highlight newly inserted data in
GridView.

Regards,
Abhijit B
S. Justin Gengo - 10 Feb 2008 13:54 GMT
Abhijit,

I would suggest using the GridView's RowDatabound event which fires every
time a row's data is bound. Within that event handler subroutine you will
have access to the rows information and separate cells. You'll be able to
identify which is the new row. For example here is how you could check the
text in the third cell of a row:

If e.Row.RowType = DataControlRowType.DataRow Then
   If e.Row.Cells(2).Text = "My Text" Then
       '---Text was found
   End If
End If

Then when you know you have the right row you can set the row's background
color via its style property or via your own css stylesheet by changing the
row's css class: e.Row.Style or e.Row.CssClass

Signature

Sincerely,

S. Justin Gengo, MCP

Free code and component libraries at:
http://www.aboutfortunate.com

> Hi,
>
[quoted text clipped - 6 lines]
> Regards,
> Abhijit B

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.