tabular, scrollable data control?

Listview-ish control with selectable subitems?

Page 1 of 1

2 Replies - 816 Views - Last Post: 10 June 2009 - 07:19 PM Rate Topic: -----

#1 plnelson  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 31
  • Joined: 11-February 09

tabular, scrollable data control?

Posted 10 June 2009 - 02:59 PM

I have a desktop C# app used in scheduling musicians at a music camp. It presents ensembles in a ListView - 1 row per ensemble, each player is a subitem.

I've been asked to make the players individually selectable, but I can't see any way to make Listview subitems individually selectable.

Is there a way, and if not is there a better control to do this?

Note that the data is NOT coming from a database, just a data file

Thanks in advance.

Is This A Good Question/Topic? 0
  • +

Replies To: tabular, scrollable data control?

#2 papuccino1  Icon User is offline

  • His name was Robert Paulson.
  • member icon

Reputation: 62
  • View blog
  • Posts: 1,121
  • Joined: 02-March 08

Re: tabular, scrollable data control?

Posted 10 June 2009 - 03:24 PM

Hey there.

I suggest looking into UserControls. You can make custom user controls by right click your solution and add->UserControl.

You'll be greeted with a panel like window, just drag and drop controls from the toolbox here. In your case you could have a couple of labels and when the label is clicked, change the .BackColor of that labels row.

Once you have a usercontrol, say, named: "CampPerson", it's just a matter of adding that control you created dynamically to a Panel and you're done.

So here's what you can do right now. First design your control how you feel is correct. Then I'll help you with introducing it at run-time to your WinForm Panel.
Was This Post Helpful? 0
  • +
  • -

#3 plnelson  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 31
  • Joined: 11-February 09

Re: tabular, scrollable data control?

Posted 10 June 2009 - 07:19 PM

Since posting my OP I've made an alternate by embedding Label controls in a TableLayoutPanel. It seems to work pretty well although the idea of embedding hundreds and hundreds of Label controls seems a little weird. But it seems to work pretty well.

It was easy to handle Click events for ALL the embedded controls with a single event-handler, because the object sender params can be interrogated to see which of the hundreds of Label controls received the Click.

One problem I still have is how to handle a context menu (pop-up menu) on a per-control basis. I'd like to right-click over one Player (i.e., one label control) and bring up a context menu. But I don't see any way in the handler for the menu click to see WHICH label control it was over when it was clicked!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1