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("QueueP
aramsEvent
" + "\n\tQueue:\t\t" + qe.Queue + "\n\tServiceLevel:\t" + qe.ServiceLevel);
}
else if (e is QueueMemberEvent)
{
QueueMemberEvent qme = (QueueMemberEvent)e;
lvQueues.Items.Add("QueueM
emberEvent
" + "\n\tQueue:\t\t" + qme.Queue + "\n\tLocation:\t" + qme.Location);
}
else if (e is QueueEntryEvent)
{
QueueEntryEvent qee = (QueueEntryEvent)e;
lvQueues.Items.Add("QueueE
ntryEvent"
+ "\n\tQueue:\t\t" + qee.Queue + "\n\tChannel:\t" + qee.Channel + "\n\tPosition:\t" + qee.Position);
}
}
Start Free Trial