DropDownLists & Checkboxes in DataGrids

rosmiq
10-12-2006, 09:16 AM
I am writing an asp application in vb.

I have a datagrid which is bound to data using SQL Express. I have used the Edit, Update, Cancel options and have inserted dropdownlists in some of the fields instead of the usual text boxes, this works all fine.

I would like to add a delete button, but I don't want the record to physically delete I just want the database to mark the record, i.e. in a field I have it as a boolean, so this is hidden but still stored as deleted.

The thing I would like to do is add a CheckBox or use the Delete option (either way), when they click on this button/checkbox, a dropdownList appears asking them to select a reason for deleting record (whether it be in the datagrid or out), once they have selected their option the record selected gets marked for deletion.

Does anybody have any good suggestions to show me please?

I have created a checkbox click event but I will need the value of the dropdownlist before it gets marked and not sure quite how to achieve this.

Please help!

Thanks,
rosmiq

wayneph
10-12-2006, 12:01 PM
Are you currently using the "Select" command in your datagrid? What I would do is update the SelectedItem template to have your Delete Options. Then you can have the Delete button there with a DropDownList.

Just in your SQLDataSource control, you can replace the default "DELETE" command with the appropriate "UPDATE" SQL Statement that marks as deleted and saves the reason.

rosmiq
10-13-2006, 05:38 AM
Are you currently using the "Select" command in your datagrid? What I would do is update the SelectedItem template to have your Delete Options. Then you can have the Delete button there with a DropDownList.

Just in your SQLDataSource control, you can replace the default "DELETE" command with the appropriate "UPDATE" SQL Statement that marks as deleted and saves the reason.


Hi Wayneph, thank you very much for your response..

Only I'm not quite sure what you mean..?

I have inserted a Select Link Button and made that into a Template Column. When the users click on that (Text displayed will be 'Delete') they would get a dropdownlist appear (like they do when they click on Edit. Can I do this in the Select command?

wayneph
10-14-2006, 07:21 AM
well, you'll only use the select command to get to the dropdown list. then you'll use the delete command from the selected template. unfortunately, i don't have access to visual studio so I can't test anything. can you post the relavent portions, and i'll see if i can possibly whip something up on monday....

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum