How to determine selected rows on server

How to determine selected rows on server

neebsneebs Posts: 5Questions: 0Answers: 0
edited October 2011 in General
I need to display a table and allow the user to select multiple rows. The data displayed will be small so I'm not using any pagination. I have successfully implemented a checkbox column and a single checkbox in the header that toggles all checkboxes. I have also implemented this without checkboxes, where the user can click on the row to select it. A select all button allows me to toggle all rows to selected/de-selected. I have a Submit button and I need to obtain the identity of those rows which were selected, on the server. Seems like a simple application, but I've had no luck. I just need to be nudged in the general direction I think. FYI: This is an ASP.NET MVC application written in C#.

Replies

  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    does your database have unique or primary keys for your data? you can/should send those keys to your DataTable (you can hide the column if you want). this way you have an identifying feature for any row. you can use this for any routines that need to act on a specific row.
  • neebsneebs Posts: 5Questions: 0Answers: 0
    Yes, that is what I'm doing, but I'm still trying to figure out what you use to access the rows in the code-behind on the server. Right now I'm going to use the approach of storing the keys in a delimited string in a hidden field, updating them as rows are selected/de-selected. That will ultimately allow me to implement this with pagination on the table.
This discussion has been closed.