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.

Gridview & Dynamic Formatting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
katmagic - 04 Feb 2008 16:32 GMT
I am trying to dynamically format a gridview based on results.  basically
I'm
saying if the datasource does not returns the same number of records as
another datasource (iNumberToMatch), I want the gridview in red.  But it is
being ignored; I have taken off all skins and even moved the code to a
separate application and separate webpage with no masters or skins and it
still doesn't display in red like it should.  When I debug it is landing on
the row style change correctly, but it's not appearing in red.  What am I
doing wrong?

Here is my code:

This is a nested grid, and eRow is being passed from the parent grid's
rowdatabound event:

           gv = cType(eRow.findControl("gvClientMatch"), gridview)
           If not gvClientOrderMatch is nothing
               Dim sID as String
               Dim ds as New DataSet
               lbl = cType(erow.FindControl("lblOrderID"), label)
               If not lbl is nothing
                    sID = lbl.text
                    ds = GetClientMatch(sID)
                    If not ds is nothing
                         If iNumberToMatch > 1
                         If ds.Tables(0).Rows.Count <> iNumberToMatch-1
                              gv.RowStyle.Font.Italic=True
                              gv.RowStyle.ForeColor=Drawing.Color.Red
                         End If
                End if
           End If
                gv.datasource=ds
                gv.DataBind
       End If
katmagic - 04 Feb 2008 16:56 GMT
Never mind, I found what I was doing wrong.

>I am trying to dynamically format a gridview based on results.  basically
>I'm
[quoted text clipped - 32 lines]
>                 gv.DataBind
>        End If

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.