0

I have two listboxes with dataTable datasources. the first datatable is filled from a database. the other datatable is filled when a player in the first datatable is selected and a "move" button is clicked. this move button moves the datarow from datatable one to datatable two. players can also be moved back to datatable one if a mistake was made or they didn't end up playing.

Datatable one has 4 columns. PlayerId, shortname, fullname and currentplayer.

When the main form is loaded, I have datatable one populated with DataRows there the currentplayer value is equal to true. I also have a chkbox on the for that i want to be able to display all player irrelevant of currentplayer value.

is there a way to get a filter working.

Blair
  • 93
  • 1
  • 13
  • I looked into the DataView suggestion that you gave me. Worked exactly how i wanted it to. – Blair Jan 27 '14 at 17:28

1 Answers1

0

Take a look at this SO post https://stackoverflow.com/a/13012660/1339616 You can also use the datatable "Select" command with parameters for filtering and sorting:

datatable.Select(filterExp, sortExp, rowstatevalue).

See this post http://www.akadia.com/services/dotnet_filter_sort.html and this one from MSDN http://msdn.microsoft.com/en-us/library/zk13kdh0(v=vs.71).aspx

Community
  • 1
  • 1
mrrodd
  • 126
  • 1
  • 6
  • Took a look at the first link you posted and saw it mentioned DataView as did Grants comment. Dug a bit deeper as to what and how to use DataView and it works great. Thanks guys.. – Blair Jan 27 '14 at 17:30