Re: Conditional Row in Repeater

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Wayne Wengert (wayneDONTWANTSPAM_at_wengert.com)
Date: 11/17/04


Date: Wed, 17 Nov 2004 11:31:40 -0700

Thank you - I'll try that.

Wayne

"Lachlan James" <anonymous@discussions.microsoft.com> wrote in message
news:6e6e01c4ccc5$61a603b0$a601280a@phx.gbl...
> Because the Panel is inside the repeater you will need to
> get a reference to it by calling e.Item.FindControl()
> before setting its value.
>
> >-----Original Message-----
> >I am using VB with ASP.NET and I have a repeater control
> which displays a
> >list of records from a dataset. The records are ordered
> by ZIP code. I want
> >to insert an extra row containing the name of the current
> state (with a
> >different background color) when the value of the "State"
> field changes.
> >Based on some information I found via Google I am trying
> to include that
> >conditional row within a Panel control and then use the
> Visible property to
> >enable it when the value of State changes. Portions of my
> page and code are
> >below. When I run this I am getting an error that "Object
> reference not set
> >to an instance of an object" on the line:
> >
> >Panel1.Visible = True
> >
> >Any suggestions or advice appreciated
> >
> >Wayne
> >
> >
> >=========== ItemBound Function ===============
> >Protected Sub NewClassRow(ByVal sender As Object, ByVal e
> As
> >RepeaterItemEventArgs)
> >
> >If e.Item.ItemType = ListItemType.Item Or _
> >
> >e.Item.ItemType = ListItemType.AlternatingItem Then
> >
> >Dim dbr As System.Data.Common.DbDataRecord = CType
> (e.Item.DataItem,
> >System.Data.Common.DbDataRecord)
> >
> >If Not (dbr("State")) = laststate Then
> >
> >Panel1.Visible = True
> >
> >laststate = dbr("State")
> >
> >End If
> >
> >End If
> >
> >End Sub
> >
> >
> >======== portion of repeater control
> ======================
> ><ItemTemplate>
> > <asp:Panel id="Panel1" visible =False runat="server">
> > <tr id="newclass" bgcolor="#ffff66" runat="server"
> height="0">
> > <td id="newclasscol" runat="server" colspan="8"
> align="center"
> >height="0">newstate</td>
> > </tr>
> > </asp:Panel>
> > <tr>
> > <td><%# DataBinder.Eval
> (Container,"DataItem.FullName") %></td>
> > <td align="center"><%# DataBinder.Eval
> (Container,"DataItem.Group")
> >%></td>
> > <td align="center"><%# DataBinder.Eval
> (Container,"DataItem.City")
> >%></td>
> > <td align="center"><%# DataBinder.Eval
> (Container,"DataItem.State")
> >%></td>
> > <td>
> > <asp:HyperLink id="Hyperlink1" runat="server"
> NavigateUrl= '<%#
> >DataBinder.Eval(Container.DataItem,"WebSite") %>'
> Text= '<%#
> >DataBinder.Eval(Container, "DataItem.WebSite") %> '>
> > </asp:HyperLink>
> > </td>
> > </tr>
> ></ItemTemplate>
> >
> >
> >.
> >



Relevant Pages

  • Conditional Row in Repeater
    ... Because the Panel is inside the repeater you will need to ... get a reference to it by calling e.Item.FindControl ... >Protected Sub NewClassRow(ByVal sender As Object, ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Still Fails?
    ... I converted that code to get a reference but I get the same error? ... Dim p1 As Panel ... >>enable it when the value of State changes. ... >>Protected Sub NewClassRow(ByVal sender As Object, ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: help with lloyds helpfile
    ... other procedure listings, but it doesn't work. ... So if you can please let me know how to reference this code, ... Double-click on the Delphi .exe or on a shortcut. ... Click on Panel in the Standard tab sheet of the Component Pallette. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Color matching
    ... You are reading too much....Nothing here has anything to do with Chromatic Adaptation. ... You can certainly generate a look up table to map white point and gamma so that your test display can match your reference display. ... I've been trying to get an LCD TV panel at its native ...
    (sci.engr.color)
  • Re: 2 100amp panel coupler help needed
    ... There is a leviton whole house blocker coupler in each of the 100 amp panels and I have been using one leviton coupler repeater and a capacitor in the other 100 amp panel and a capacitor in each of the sub panels. ... The other panel with the lighting, outlets, etc., has a passive X10 phase coupler on it. ... Of course the X10 signal from my controller has to go out to the meter and back to get to the other panel but it does work. ...
    (comp.home.automation)