Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Matt Sogla #1
Updating database through a datagrid using checkboxes
I need to update items in a database queue, so I am attempting to
write a ASP.NET utility to do this instead of the users just typing
SQL. I am using C# to write the code and have the basics layed out.
I am using a template column and have put a checkbox in the template
(cbxSelect).
Here's what I need to have done:
1. The user clicks on row(s) to be removed from the queue.
2. The user will click on a REMOVE button, thus firing off the SQL to
update the queue
3. Post the updated queue back to the datagrid after it's been
updated (and maybe have a message saying [x]rows have been updated.
Here's where I have problems:
In step #2 from above, I cannot get the queue_id from the datagrid row
(the queue_id is not the same number as the row number). I have read
numerous posts that say to use DataKeys[e.Item.ItemIndex], but when I
do this, there isn't and Item.ItemIndex being passed.
I currently have the logic set up so it goes through each row and
checkes if the checkbox is checked/unchecked. After this, I get
stuck. Can anyone offer and code examples or links to check out?
Everything I've seen is either too different or I can't get to work.
I am not interested in updating the rows on the fly, but would rather
do a batch update so I only have one update statement.
Any guidance would be helpful.
Thanks.
Matt Sogla Guest
-
Updating database records in a datagrid
In a datagrid, I read that you cannot add validation controls to the textboxes, you want to update, because they are using BoundColumns. I want to... -
Checkboxes in Datagrid
I have found a script for selecting and deselcting all of the checkboxes in a datagrid by using a master checkbox. This is similar to the hotmail... -
DataGrid with Checkboxes
I have a datagrid with checkboxes for each row. The user is able to select the ones he wants, then hit a "Save" button, which then loops through... -
Datagrid not updating database
I am using a dropdown box to query a database and populate a datagrid. Everything works except the update button. When the update button is... -
Updating a DataAdapter, DataGrid after changing the database
I currently have a page which displays data in a DataGrid from a DataSet filled by an OleDbDataAdapter. It also has buttons to carry out events...



Reply With Quote

