Showing posts with label prompt. Show all posts
Showing posts with label prompt. 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?

Confirmation message on ReorderList

Using the ReorderList's drag and drop capability is awesome. However, is there to prompt for a confirmation message box before the drop?

What are the possible values for the "OnItemReorder" event? Is this the right event to call?

thanks!

On ItemReorder will fire on the server, so it's too late to put up a confirmation message.

To enable this sort of behavior, you'll need to make modifications to DropWatcherBehavior.js in the toolkit source.

This simplest way is to modify the drop method in DropWatcherBehavior. To make it more sophisticated, maybe add a property to DropWatcherBehavior that lets you specify text here, and then only do the confirm if the text is present, etc.

this.drop = function(dragMode, dataType, data) {if (window.confirm("DropHere?")) { _dragDropList.drop(dragMode, dataType, data);this.doPostBack(data.id); } }

When I make this change, do I have to rebuild the .dll file for this control? any advice?
Yes you'll need to rebuild the AtlasControlToolkit.dll to incorporate the JS change.

sburke,

I finally gotten to make this change. Now, I have a problem. WHen I hit Cancel on the confirmation message, it doesn't put the order list back to its original order. It just freeze there with the drag outline box on the screen. How would I make this change to restore it to its original state?

thanks!