Advertisement

05.21.2008 at 10:56AM PDT, ID: 23421853
[x]
Attachment Details

Listview display how to?

Asked by YANKAUSKAS in Microsoft Visual C#.Net, C# Programming Language, Visual Studio .NET 2005

Tags: Miscrosoft, Visual Studio, 2005, C#

I get a string value return from the server and want to display it on a list view, but when i use the code below, I get the vertical display, not the horizontal display as I expected.
It show:
QueueParamsEvent | QueueMemberEvent | QueueEntryEvent  | .....  
Queue: Q1                 | Queue: Q1                  | Queue: Q1             | .....  
ServiceLevel: SL1    |ServiceLevel: SL2      |ServiceLevel: SL3 | .....

But I want to display it like this.
QueueParamsEvent
Queue: Q1
ServiceLevel: SL1    

QueueMemberEvent
Queue: Q2
ServiceLevel: SL2

QueueEntryEvent
Queue: Q3
ServiceLevel: SL3

Please help me correct this error:

foreach (ManagerEvent e in re.Events)
            {
                if (e is QueueParamsEvent)
                {
                    QueueParamsEvent qe = (QueueParamsEvent)e;
                    lvQueues.Items.Add("QueueParamsEvent" + "\n\tQueue:\t\t" + qe.Queue + "\n\tServiceLevel:\t" + qe.ServiceLevel);
                }
                else if (e is QueueMemberEvent)
                {
                    QueueMemberEvent qme = (QueueMemberEvent)e;
                    lvQueues.Items.Add("QueueMemberEvent" + "\n\tQueue:\t\t" + qme.Queue + "\n\tLocation:\t" + qme.Location);
                }
                else if (e is QueueEntryEvent)
                {
                    QueueEntryEvent qee = (QueueEntryEvent)e;
                    lvQueues.Items.Add("QueueEntryEvent" + "\n\tQueue:\t\t" + qee.Queue + "\n\tChannel:\t" + qee.Channel + "\n\tPosition:\t" + qee.Position);
                }
            }Start Free Trial
[+][-]05.21.2008 at 11:13AM PDT, ID: 21617530

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, C# Programming Language, Visual Studio .NET 2005
Tags: Miscrosoft, Visual Studio, 2005, C#
Sign Up Now!
Solution Provided By: dweppenaar
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.21.2008 at 11:35AM PDT, ID: 21617722

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 11:41AM PDT, ID: 21617776

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 11:53AM PDT, ID: 21617913

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 12:07PM PDT, ID: 21618028

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2008 at 12:12PM PDT, ID: 21618079

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628