DataGrid newbie questions

  • Thread starter Thread starter Michael A. Covington
  • Start date Start date
M

Michael A. Covington

Greetings,

I'm new to DataGrids, but I want to use one. Basically, I want to show the
user a list of files with some information about each one (obtained by
having my application look inside the files), and let the user choose which
files to process, either by means of checkboxes, or by deleting rows from
the grid, and also sorting.

I've prototyped this using a DataSet and DataTable, which is sortable, but
sorting the DataGrid has no effect on the underlying DataSet. How can I
make it do so?

Or, for an app this simple, should I be binding the DataGrid to an array of
structs? I've tried that too, and it does not seem to offer sorting as an
option.

I haven't even gotten as far as how to offer the user the ability to delete
rows; presumably through a context menu. Wise advice would be welcome.

Thanks!
 
Hi,

Maybe you should consider using a dataview?
A dataview acts in between your dataset and your datagrid. The datagrid
would databind to the dataview. Then you can iterate through the rows
of your dataview.

Deleting a row could be done many ways. Datagrid lets you include a
delete button.
Context menu would work as well; you would just need to get the
cell/row currently selected, then delete it, and refresh your table.

Hope this helps,
Steven Nagy
 
Back
Top