Re: format nested repeater

From: Dan Poincelot (dpoincelot_at_masonmadison.com)
Date: 09/21/04


Date: Tue, 21 Sep 2004 05:21:05 -0700

Hi Martin, thanks for the response, I now can get the itemdatabound for
the child repeater to fire. However, it can't seem to locate column
names in the child repeater, the code is below (I put the error mesage
below the code):

protected void CategoryRepeater_ItemDataBound(object sender,
System.Web.UI.WebControls.RepeaterItemEventArgs e)
{
Response.Write("it fired!");

//subprocess, need to only show it once for each list

LabelSubProcess = (Label)e.Item.FindControl("LabelSubProcess");

MainHeading = (string)DataBinder.Eval( e.Item.DataItem, "SubProcess" );

        if (MainHeading == PastHeading)
        {
                LabelSubProcess.Text = "";
        }
        else
        {
                LabelSubProcess.Text = (string)DataBinder.Eval( e.Item.DataItem,
"SubProcess" );
                        }

PastHeading = MainHeading;

//End subprocess code

}

Here is the error message:

Specified cast is not valid.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Specified cast is not
valid.

Source Error:
Line 259: MainHeading = (string)DataBinder.Eval( e.Item.DataItem,
"SubProcess" );

Thanks again for any more help you can offer.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!