1 Replies - 16396 Views - Last Post: 26 April 2012 - 09:02 AM

#1 ScottinTexas   User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 284
  • Joined: 13-March 12

How should I proceed?

Posted 16 March 2012 - 10:38 AM

Hope this is the correct forum. I am trying to decide the best method for accomplishing a task and thought I would get input from the gurus here. I don't want to go too far because it seems undoing something in Visual Studio is more difficult than doing something.

I have records in a database that I want to display in a listview. The listview is so the user can see what records are attached to a project, so the data is limited and just for reference. That's why I am thinking listview. The listview is on a tab page. The data to fill that view will come from the user's input (a click on a folder in a treeview on a separate tab page). What I was thinking was add a table adapter to the listview, binding the litsview to it and executing an SQL. Something like myListview.tblAdapter.FillByRSID(13) (pseudo code, of course). My question is; am I thinking this correctly or have I misunderstood the processes?

You can tell I am really new to this, so be gentle with me. This screen shot is where the user would select the folder (the last node) gives up the data (018 in this case) which is used as they key to the data. The tab titled Runsheet is where the data will appear.

Should the table adapter be placed on the listview or on the tab page?

I'm using Visual Studio 10 Professional, Windows 7.

Thanks for the input.

Attached image(s)

  • Attached Image

Is This A Good Question/Topic? 0
  • +

Replies To: How should I proceed?

#2 motcom   User is offline

  • D.I.C Lover
  • member icon

Reputation: 293
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Re: How should I proceed?

Posted 26 April 2012 - 09:02 AM

Hi, the TableAdapter if you drag it from data sources will be available to you for the whole form (its class). If it is related data, you will have to iterate trough each related table and add the information manually. The control you are showing is a treeview so adding each tree/sub tree is done manually, unfortunately the control is not clever enough to handle it automatically :(.

EDIT: misunderstood you there, list view is fine to show data, gridview even better if you want to go in detail.. you can fill the table adapter by ClientID (i suppose you will have an unique ID) when the user selects a new client. And that data will be available to all tabs/panels/groups etc for that specific form :)..Databinding Treeview is what i first thought you wanted to do.. If you are a bit more clever, you would get all the data and navigate trough the table instead of doing a call to the database/server each time you change client :)

This post has been edited by motcom: 26 April 2012 - 09:06 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1