|
-
Jun 5th, 2005, 09:02 AM
#1
Thread Starter
Fanatic Member
Database problem - ListView or DataView [Resolved]
Hello all,
I am currently working on project that is a database-driven mp3-player. So, there is a database file with the songs (and a lot of info on them), connected to a player. The database is a DataSet control.
Now, to show this information to the user, most logically either a ListView or DataGrid control can be used. There only seem to be problems with both of them:
The ListView:
- It will not let you edit information in columns other that the first.
- It's not very hard to create a custom way to change the text in the subitems (e.g. by putting a textbox above the subitem). But, there is no property of the ListView that tells you which subitem is selected.
The DataGrid:
- It will let you add new lines easily, which should not happen (they should be added, by adding files with an OpenFileDialog or FolderBrowserDialog).
- It will not let you rearrange columns.
- Data can not be different from database info (e.g. filesize will be in bytes in the database, but should be in KB in view)
Does anybody know a solution for the problems with one of these controls?
Or is there a different control that will allow you to do these things?
Thanks in advance,
Alex.
Last edited by arsmakman; Jun 8th, 2005 at 04:19 AM.
Reason: Resolved
No matter how fool-proof your program is, there will always be a better fool.
Was a post helpful to you? Rate it!
-
Jun 5th, 2005, 10:06 AM
#2
Fanatic Member
Re: Database problem - ListView or DataView
 Originally Posted by arsmakman
The DataGrid:
- It will let you add new lines easily, which should not happen (they should be added, by adding files with an OpenFileDialog or FolderBrowserDialog).
- It will not let you rearrange columns.
- Data can not be different from database info (e.g. filesize will be in bytes in the database, but should be in KB in view)
Does anybody know a solution for the problems with one of these controls?
Or is there a different control that will allow you to do these things?
Thanks in advance,
Alex.
I think you should use a datagrid. To solve the problem of only having data in the database displaying you can add unbound columns that contain no information, so you could put the filesize in KB in this and then not show the filesize column where the filesize is show in bytes.
-
Jun 5th, 2005, 10:14 AM
#3
Thread Starter
Fanatic Member
Re: Database problem - ListView or DataView
Okay that sounds good, but how do I create an unbound column and hide
others?
And this still leaves me with the other two problems...
No matter how fool-proof your program is, there will always be a better fool.
Was a post helpful to you? Rate it!
-
Jun 5th, 2005, 11:39 AM
#4
Fanatic Member
Re: Database problem - ListView or DataView
 Originally Posted by arsmakman
Okay that sounds good, but how do I create an unbound column and hide
others?
And this still leaves me with the other two problems...
I'm not quite sure, its done at design time, through the datagrid properties, have a play around with it and you'll probably figure it out.
What are the other problems?
-
Jun 5th, 2005, 12:11 PM
#5
Thread Starter
Fanatic Member
Re: Database problem - ListView or DataView
 Originally Posted by x-ice
What are the other problems?
As I said in the first post: new lines can be added easily (by typing into them) and the columns can't be rearranged.
A user shouldn't be allowed to create new lines just by typing something into them and rearrangement of the columns adds a lot of user-friendliness.
No matter how fool-proof your program is, there will always be a better fool.
Was a post helpful to you? Rate it!
-
Jun 5th, 2005, 12:42 PM
#6
Fanatic Member
Re: Database problem - ListView or DataView
 Originally Posted by arsmakman
As I said in the first post: new lines can be added easily (by typing into them) and the columns can't be rearranged.
A user shouldn't be allowed to create new lines just by typing something into them and rearrangement of the columns adds a lot of user-friendliness.
Set the "READ ONLY" property of the datagrid to TRUE and the user won't be able to edit the data or add a new row. I don't know about reorganising the columns sorry.
-
Jun 5th, 2005, 01:41 PM
#7
Thread Starter
Fanatic Member
Re: Database problem - ListView or DataView
I know about setting the "ReadOnly"-property, but I want the users to be able to change the data, just not to be able to add columns.
The use of the datagrid asks for a lot of complicated work-arounds, so it would be easier if there was a way to edit subitems in a listview. All other functions are present in the listview, or easily achievable.
No matter how fool-proof your program is, there will always be a better fool.
Was a post helpful to you? Rate it!
-
Jun 5th, 2005, 08:44 PM
#8
Re: Database problem - ListView or DataView
I use ListViews quite a bit for this type of thing as I think they present a more attractive interface to the average user. I usually use the DoubleClick event handler to open a dialogue box containing the fields of the selected row. When the user OKs the dialogue I simply update the selected row from the dialogues controls. This also helps to prevent accidental edits as the user has to confirm all changes.
-
Jun 8th, 2005, 04:19 AM
#9
Thread Starter
Fanatic Member
Re: Database problem - ListView or DataView
That sounds good, I'll do that! Thanks.
No matter how fool-proof your program is, there will always be a better fool.
Was a post helpful to you? Rate it!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|