Jump to content

Show simple table on a form in c# [help]

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
jimbo2779

jimbo2779

    Newbie

  • Members
  • Pip
  • 3 posts
Hey guys, Im a long time lurker but first time poster here. I did a degree in software engineering a few years back using mainly c# and java. Since then I have been mainly doing web apps in PHP and hadn't looked back until the other day.

I had a great idea for an app, one that involves contacting web APIs and receiving back the data and showing it in a table. In PHP this would have taken me about 2.5 hours (in fact it did take that long) but in C# I feel like Im trying to roll a ciggie with oven mitts on.

Can anyone help me on how to just create a table and stick some random values in it, it can even just be a 2 column table but it just seems so hard.

I have looked around and around at creating and using 2d arrays to hold the data but then remembered c# arrays are fixed in size so I would have to use an ArrayList but then all examples I have seen show how to do this using a dataset from an SQL DB and bind it to a datagridview.... how is that the simplest example?

Sorry if I have just rambled a bunch but I struggle to explain what I am trying to do, If I have a point in the right direction of how to display a frickin table in a c# form I shouldn't struggle with too much more hopefully.

Thanks in advance guys.

Jim

#2
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Try using a ListView from the Toolbox, and then setting its View property to Columns. You can edit its Items collection to add rows to the ListView, with every SubItem being a new cell in the row.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#3
jimbo2779

jimbo2779

    Newbie

  • Members
  • Pip
  • 3 posts
On first checking through google it looks like a listview is exactly what I was looking for.

I could kiss you.........


don't worry I wont.

#4
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Lol you could always pay me through PayPal.. :D

I'm glad I could help.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums