Which Control???

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
J

Jim Heavey

I have not used the ListView Control much and I was wondering if I should
consider using it rather then the datagrid. I have a very small number of
rows and the datagrid is probably overkill for what I need it for.

I have been sucessful in adding member to a ListView and removing them, but
Have not tried to build in logic to allow the user to edit individual rows.
Perhaps the ListView does not lend itself to this type of processing.

If it does, can you point me to some sample coded where this kind of thing is
being done. If is does not lend itself to this kind of activity, then just
let me know and I will proceed along with the datagrid (or maybe there is
another control which lends it self to this).

Thanks in advance for your assistance!!!!!!!
 
Well, here's my two cents. 1) Datagrids are much more
powerful in many regards and are definitely faster to
populate than listviews with subitems are. 2) You can
sort a datagrid without any extra code, and although you
can implement sorting in a listview, it's a little extra
work (but not too much). 3) Listviews are Read only and
in order to let the user edit a value, you are going to
have to implement a context menu or something else to
allow them to change the value of an item. This is
provided by default in a datagrid.

As far as overkill, grids give you a lot more for a lot
less in most every instance I've seen. That's not to say
that ListViews are somehow inferior or more difficult,
but if you are going to provide a 'table like' display of
data that a user can edit, a grid is normally the better
choice---depending on how much editing is going to
happen. Picture a scenario where you have x columns and
20 rows like in a typical excel spreadsheet. In a grid,
you can key down and edit the next cell. Compare this
with a listview style control such as Windows explorer
in 'details' mode. If you wanted to change 20 filenames
on the right hand side of windows explorer, you'd have a
lot of extra clicking to do (the left part of Win
Explorer is a tree view, so I'm only addresses the right
hand part under 'details'.

Finally, you can bind a grid to a datatable/dataset with
ONE line of code, and if you have a dataset, you can even
provide collapse/expand functionality. It'd take quite a
few more lines of code to do this with a listview.

Ultimately, it depends on your app, but for the most
part, grids are better suited for data entry and
manipulation from a developer's point of view.

Good Luck,

Bill


W.G. Ryan
(e-mail address removed)
www.knowdotnet.com
 
Thanks for your insight!!!!


William Ryan said:
Well, here's my two cents. 1) Datagrids are much more
powerful in many regards and are definitely faster to
populate than listviews with subitems are. 2) You can
sort a datagrid without any extra code, and although you
can implement sorting in a listview, it's a little extra
work (but not too much). 3) Listviews are Read only and
in order to let the user edit a value, you are going to
have to implement a context menu or something else to
allow them to change the value of an item. This is
provided by default in a datagrid.

As far as overkill, grids give you a lot more for a lot
less in most every instance I've seen. That's not to say
that ListViews are somehow inferior or more difficult,
but if you are going to provide a 'table like' display of
data that a user can edit, a grid is normally the better
choice---depending on how much editing is going to
happen. Picture a scenario where you have x columns and
20 rows like in a typical excel spreadsheet. In a grid,
you can key down and edit the next cell. Compare this
with a listview style control such as Windows explorer
in 'details' mode. If you wanted to change 20 filenames
on the right hand side of windows explorer, you'd have a
lot of extra clicking to do (the left part of Win
Explorer is a tree view, so I'm only addresses the right
hand part under 'details'.

Finally, you can bind a grid to a datatable/dataset with
ONE line of code, and if you have a dataset, you can even
provide collapse/expand functionality. It'd take quite a
few more lines of code to do this with a listview.

Ultimately, it depends on your app, but for the most
part, grids are better suited for data entry and
manipulation from a developer's point of view.

Good Luck,

Bill


W.G. Ryan
(e-mail address removed)
www.knowdotnet.com
 
Back
Top