iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello,
UXStackButton under Interactivity has a check box that says AllowRemoveItem. What even fires when when a item is removed? Also, who do i know what item was removed?
Thanks
Andre
Hello Andre,
Thank you for your patient.
I found out how to trigger the event when we remove an item from UXStackButton. You can use ISDragDrop.DragEndEvent that is available in Routed Events architecture. To learn more about the events, please refer to the following link:
http://www.intersoftpt.com/Support/ClientUI/Documentation/#url=Drag-dropFrameworkOverview.html.
You might want to know about routed events, please refer to the following link:
http://www.intersoftpt.com/Support/ClientUI/Documentation/#url=RoutedEventsOverview.html
Use ISEventManager to register the event handler like following:
public UXStackButton() { InitializeComponent(); ISEventManager.RegisterInstanceHandler( this.UXStackButton1, ISDragDrop.DragEndEvent, new Intersoft.Client.UI.Controls.Interactivity.DragEventHandler(UXStackButton1_Drop), true); }
Then, you can customize any operation you want to perform in the following code:
private void UXStackButton1_Drop(object sender, Intersoft.Client.UI.Controls.Interactivity.DragEventArgs e) { DragDropEventData data = e.Data as DragDropEventData; if (data != null && !data.Cancel) { if (data.Sender.IsRemove()) { MessageBox.Show("The item is removed."); } else MessageBox.Show("The item is moved."); } }
Hope this helps. Thank you.
Regards,
-Martin-
First of all, you can add the following namespace into you code-behind:
using Intersoft.Client.UI.Aqua.UXStackMenu;
Next, add the following code in order to get the selected item that is being removed:
String item = ((UXStackItem)(data.SourceElement)).Text;
Here is the complete code to obtain the removed item:
private void UXStackButton1_Drop(object sender, Intersoft.Client.UI.Controls.Interactivity.DragEventArgs e) { DragDropEventData data = e.Data as DragDropEventData; String item = ((UXStackItem)(data.SourceElement)).Text; if (data != null && !data.Cancel) { if (data.Sender.IsRemove()) { MessageBox.Show(item +" is removed."); } else MessageBox.Show(item + " is moved."); } }
If you enable AllowRemoveItem property, you will be able to remove the item in UXStackButton.
To remove the item, simply drag and drop the item outsite the UXStackButton area.
I am not clear enough with your question. Could you explain it in more details? Do you want to know what event is triggered when AllowRemoveItem is executed, or do you want to know the code/method to execute remove item?
Thank you.
HI After I drag and drop the Item outside the uxstackbutton, what will tell me that an Item was removed? After it's been removed I need to update the database so I will need to know when to update and what Item was removed from the collection.
I was looking for an event that would tigger, like Click event would fire after a click, what event will be raised after remove?
I am currently investigating the event that will be triggered after we remove the stack item. So far, I've been trying to use DragEnter, DragLeave, Drop events with no luck. Those events does not get invoked when we remove an item.
Then, I tried StackOpened and StackClosed, but these events will be triggered when we open/close the stack button.
I will let you know the progress. Thank you for your patient.
Thank you
HI, just one more question. using the code:
How do i find what element was deleted?
I have created my own template and i have added a Navigation button. on click to find the sender of the click event i use this. UXNavigationButton s = sender as UXNavigationButton; var ss = s.DataContext as myobject; but the code you sent me the sender is the stack button. I need to know find what control was removed so I an update the database. thanks
UXNavigationButton s = sender as UXNavigationButton; var ss = s.DataContext as myobject;
but the code you sent me the sender is the stack button. I need to know find what control was removed so I an update the database. thanks
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname