DataGrid newbie questions

  • Thread starter Michael A. Covington
  • 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!
 
S

Steven Nagy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

csv to datagrid 4
Custom Sorting in DataGrid 4
datagrid sorting hassles 1
Datagrid Reset 1
datagrid 3
DataGrid numerical sorted instead alphanumerical... 2
sorting a datagrid 1
Refresh a datagrid 4

Top