Click here to Skip to main content
15,888,803 members
Home / Discussions / C#
   

C#

 
GeneralRe: Trying to create a new array Pin
turbosupramk316-Dec-10 15:33
turbosupramk316-Dec-10 15:33 
GeneralRe: Trying to create a new array [modified] Pin
turbosupramk316-Dec-10 15:42
turbosupramk316-Dec-10 15:42 
GeneralRe: Trying to create a new array Pin
PIEBALDconsult16-Dec-10 16:37
mvePIEBALDconsult16-Dec-10 16:37 
AnswerRe: Trying to create a new array Pin
Hiren solanki16-Dec-10 19:07
Hiren solanki16-Dec-10 19:07 
QuestionC# - How to call database records one-by-one and display it in ListView? [modified] Pin
LAPEC16-Dec-10 10:50
LAPEC16-Dec-10 10:50 
AnswerRe: C# - How to call database records one-by-one and display it in ListView? Pin
Luc Pattyn16-Dec-10 11:06
sitebuilderLuc Pattyn16-Dec-10 11:06 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC16-Dec-10 11:12
LAPEC16-Dec-10 11:12 
AnswerRe: C# - How to call database records one-by-one and display it in ListView? Pin
Henry Minute16-Dec-10 11:30
Henry Minute16-Dec-10 11:30 
I was a bit rude to you earlier, sorry.

I'll try to help you.

Try this.

C#
private void cmdOlives_Click(object sender, EventArgs e)
{
  if (result.Count > 0)
  {
    TableOrderListView.Items.Clear();  //<============ Note only have this line if you only want one item in your listview

    ListViewItem newItem = new ListViewItem(result[1][0]) // <==== get the item (Olives)

    // Now get the sub items associated with Olives
    for (int i = 1; i < result[1].Length; i++)
    {
      newItem.SubItems.Add(result[1][i]);  // <==== and add them to the Olives Item
    }

    TableOrderListView.Items.Add(newItem);  // <== Now add the Item to the ListView
  }
}


DONT FORGET: If you want the item to be added to the listview instead of replacing existing item delete the Items.Clear() line.

You will still have the problem of differentiating your different buttons doing things this way but try this out and I will try to help you with the rest.
Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”

AnswerRe: C# - How to call database records one-by-one and display it in ListView? Pin
Luc Pattyn16-Dec-10 11:36
sitebuilderLuc Pattyn16-Dec-10 11:36 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC16-Dec-10 12:21
LAPEC16-Dec-10 12:21 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
Luc Pattyn16-Dec-10 12:26
sitebuilderLuc Pattyn16-Dec-10 12:26 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC16-Dec-10 12:59
LAPEC16-Dec-10 12:59 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
Luc Pattyn16-Dec-10 13:26
sitebuilderLuc Pattyn16-Dec-10 13:26 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC16-Dec-10 13:32
LAPEC16-Dec-10 13:32 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
Henry Minute16-Dec-10 12:27
Henry Minute16-Dec-10 12:27 
AnswerRe: C# - How to call database records one-by-one and display it in ListView? Pin
Henry Minute17-Dec-10 9:48
Henry Minute17-Dec-10 9:48 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC17-Dec-10 14:30
LAPEC17-Dec-10 14:30 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
Henry Minute17-Dec-10 14:40
Henry Minute17-Dec-10 14:40 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC17-Dec-10 14:56
LAPEC17-Dec-10 14:56 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
Henry Minute17-Dec-10 15:03
Henry Minute17-Dec-10 15:03 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
Henry Minute17-Dec-10 14:56
Henry Minute17-Dec-10 14:56 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC17-Dec-10 15:11
LAPEC17-Dec-10 15:11 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC18-Dec-10 12:28
LAPEC18-Dec-10 12:28 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
Henry Minute18-Dec-10 13:13
Henry Minute18-Dec-10 13:13 
GeneralRe: C# - How to call database records one-by-one and display it in ListView? Pin
LAPEC18-Dec-10 13:25
LAPEC18-Dec-10 13:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.