8 Replies - 6834 Views - Last Post: 21 September 2013 - 02:20 AM Rate Topic: -----

#1 synlight  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 90
  • View blog
  • Posts: 582
  • Joined: 14-September 11

Datagrid? ComboBox? Something Else?

Posted 19 September 2013 - 06:49 AM

I'm new to WPF and have a question.

I'm writing a desktop application where the user will need to choose a record displayed in a control. There could be a couple hundred records to choose from.

Right now I'm using a datagrid for this, but it's just not very attractive. I thought about a combo box, but I felt like there were too many records for that. Is there another option I'm not thinking of?

If the datagrid is indeed the best choice, what steps do you recommend to make it look.. idk.. more polished?

Is This A Good Question/Topic? 0
  • +

Replies To: Datagrid? ComboBox? Something Else?

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13568
  • View blog
  • Posts: 54,137
  • Joined: 12-June 08

Re: Datagrid? ComboBox? Something Else?

Posted 19 September 2013 - 07:41 AM

Do these records have a title? A public number or something? I would say load just those values in a dropdown/combo box where the display value is those words and the data value is the public key for that record in the database..
Was This Post Helpful? 0
  • +
  • -

#3 synlight  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 90
  • View blog
  • Posts: 582
  • Joined: 14-September 11

Re: Datagrid? ComboBox? Something Else?

Posted 19 September 2013 - 07:45 AM

The data would be either a device or a user.

Devices are only uniquely identified by the ID in the database, but the user wouldn't have access to that data. To them, the device will be recognizable by it's type, host name, and location (i.e. Router, Linksys, Room222) I think I need to display those 3 items at a minimum so the wrong device doesn't get selected.

The functionality of this is, say a user wants to delete a device from the database. They would be able to go to the Delete Device form, choose a device, then click delete. The code behind would then handle the deletion.

This post has been edited by synlight: 19 September 2013 - 07:46 AM

Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13568
  • View blog
  • Posts: 54,137
  • Joined: 12-June 08

Re: Datagrid? ComboBox? Something Else?

Posted 19 September 2013 - 07:46 AM

Then there's nothing wrong with jamming three text description columns together to make a display value someone can read.
Was This Post Helpful? 0
  • +
  • -

#5 synlight  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 90
  • View blog
  • Posts: 582
  • Joined: 14-September 11

Re: Datagrid? ComboBox? Something Else?

Posted 19 September 2013 - 07:49 AM

View Postmodi123_1, on 19 September 2013 - 09:46 AM, said:

Then there's nothing wrong with jamming three text description columns together to make a display value someone can read.


My concern was having a couple of hundred possibles in a dropdown/combo box.. I've never made a GUI before so I'm still learning best practices. It seemed like the datagrid was the best way to go with so many records.

Or maybe I could limit their selection of device types... then have a dropdown where they select from a list of device types.. then show records based on that selection?

This is what it looks like right now.. still dirty.. I'm working on it.

Posted Image

This post has been edited by synlight: 19 September 2013 - 07:54 AM

Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13568
  • View blog
  • Posts: 54,137
  • Joined: 12-June 08

Re: Datagrid? ComboBox? Something Else?

Posted 19 September 2013 - 07:51 AM

Sure.. there's just the "toss it all in one list" route.. or have multiple dropdowns that are used to filter down the results. Have one drop down for device type.. one for location.. then one for the specific device.. etc.
Was This Post Helpful? 1
  • +
  • -

#7 synlight  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 90
  • View blog
  • Posts: 582
  • Joined: 14-September 11

Re: Datagrid? ComboBox? Something Else?

Posted 19 September 2013 - 07:57 AM

View Postmodi123_1, on 19 September 2013 - 09:51 AM, said:

Sure.. there's just the "toss it all in one list" route.. or have multiple dropdowns that are used to filter down the results. Have one drop down for device type.. one for location.. then one for the specific device.. etc.


If you don't mind me asking, how would you do it?

I imagine the user will come in with an idea that they want to delete X machine from X location. They won't remember host names and such with so many records. So maybe I should filter by location... but they could still have a couple hundred locations... so that won't work.

Ugh. I'm confusing myself.
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13568
  • View blog
  • Posts: 54,137
  • Joined: 12-June 08

Re: Datagrid? ComboBox? Something Else?

Posted 19 September 2013 - 08:28 AM

It sort of all depends on the business usage, users, requirements, etc.

If you feel your intended users won't have the exact name then I would have a series of filtering drop downs (as I mentioned) and a free text search box for the assist.
Was This Post Helpful? 1
  • +
  • -

#9 MrShoes  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 331
  • View blog
  • Posts: 512
  • Joined: 13-June 12

Re: Datagrid? ComboBox? Something Else?

Posted 21 September 2013 - 02:20 AM

I'm going to throw my opinion in here. This sort of problem is often approached in WPF by using a ListView, or a ListBox. You can use a DataTemplate to define how your items appear in the list, then bind the ListView to the list of items. Then you might have a box showing more detail, which wi be bound to the SelectedItem of the ListView. You might also want to extend your ListView with search and filter functionality.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1