Showing posts with label tie. Show all posts
Showing posts with label tie. Show all posts

Saturday, March 24, 2012

ConfirmButton & Gridview Autogenerated delete button

Any way to tie the confirmbutton control to the GridView to prompt on the delete button?

The only way to currently do this is to turn your delete column into a template column and then add the extender in there with the button:

<TemplateColumn><ItemTemplate> <asp:LinkButton id="delete" runat="server" CommandName="Delete" Text="Delete"/> <atlasToolkit:ConfirmButtonExtender ID="cbe" runat="server> <atlasToolkit:ConfirmButtonExtenderProperties TargetControlID="delete" ... /> </></ItemTemplate></TemplateColumn>

Since TemplateColumn is normally associated with a DataGrid, does this also work for the TemplateField associated with the GridView? I am getting errors when I try to execute this within the TemplateField: "Assertion Failed: unrecognized tag atlascontroltoolkit:confirmbuttonbehavior". Is there anything special I need to do to use this within a GRIDVIEW?

Conditional PopupControlExtender

I've seen all kinds of examples using the popup control extender being tied to textbox, I was wondering if there was a way to tie it to a checkbox or checkboxlist and have it only appear when an item is checked. I havent got any issues getting it to show up, but is it possible and if so how do you make it only appear when the control is being checked.

Thanks for any advice/guidance that you can provide.

You could attach a popup control extender to an invisible control and call its show method in the onclick event handler of the checkbox depending on what value is set.

Here is a post that talks about this problem:

http://forums.asp.net/thread/1466348.aspx