views:

216

answers:

2

I have a form which requires that you filter on 2 variables before the record is displayed. The year is repeated for each unique visit when you activate the 1st filter. The 2nd filter displays the unique visit.

How do I display the year or any variable once in my first listview filter and still display the unique items per year as an example in the 2nd listview filter.

C#.Net is the language I'm using in Visual Studio 2005. thanks

+1  A: 

Either I'm slow today or this question is extremely confusing. Please provide an example of a record as well as the filter strings you are using.

alexD
This is not an answer. Please provide this as commentary to the question rather than an answer. Otherwise, yes, good point.
Jeff Yates
I upvoted one of your questions to get you the 50 rep to leave comments.
Austin Salonen
Thankyou Austin...I wondered why I couldn't add commentary to questions!
alexD
A: 

If I am understanding this correctly your data is something like:

2009 uniquevisit

And you want it to look like:

2009 uniquevisit1
     uniquevisit2
     uniquevisit3
2008 uniquevisit4
2007 uniquevisit5
     uniquevisit6
     uniquevisit7

If yes, just make a template and store a global var and on the databinding of the year literal or label check for the year in your global and set the text to blank in your control and if they are not equal set the global and set the text.

Assuming you are binding it to something, it would work kind of like this:

int lastYear = 0;
protected void litYourYearControl_DataBinding(object sender, System.EventArgs e)
{
    Literal lit = (Literal)(sender);
    string displayText = "";
    int year = (int)(Eval("YourYearField"));
    if (year != lastYear)
    {
        displayText = year.ToString();
        lastYear = year;
    }
    lit.Text = displayText;
}

Your question is really confusing but that's my best shot at understanding what your asking :)

Kelsey