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!
I have a problem using ClientUI (Silverlight).
I have two databound listboxes in one form with items of the same structure, the only thing that differs is data values. Those listboxes are sources for draggin items. The task is to distinguish the source of dropped items. I tried to use SetData() method on DragInit event having a goal to get this data back on Drop event. But GetData() in drop event returns null. (I tried to use the approach described here http://www.intersoftpt.com/Support/ClientUI/Documentation/WalkthroughPerformDragdropUsingAPI.html#url=HowtoStoreDataObjectAtDragInitEvent.html)
Looked through documentation, but cannot find another way of attaching custom data to the object being dragged. I hope there is a way to do this.
A string data is attached during DragInit event by using following code.
public StoreDataObjectUsingEventHandler() { InitializeComponent(); ISEventManager.RegisterInstanceHandler( UXListBox1, // any element in the routed path which applicable in your scenario ISDragDrop.DragSourceEvent, // the routed event new DragEventHandler(UXListBox1_DragInit), // the event handler true); } private void UXListBox1_DragInit(object sender, DragEventArgs e) { string sourceData = "Some string data to store..."; byte[] unicodeText = Encoding.Unicode.GetBytes(sourceData); byte[] utf8Text = Encoding.UTF8.GetBytes(sourceData); string uniCodeFormat = "Unicode"; string utf8DataFormat = "UTF-8"; var dataObject = e.Data as DragDropEventData; dataObject.SetData(sourceData); dataObject.SetData(uniCodeFormat, unicodeText); dataObject.SetData(utf8DataFormat, utf8Text); }
The data could then be retrieved in PrepareDrop event by invoking GetData() method.
public StoreDataObjectUsingEventHandler() { InitializeComponent(); ... ISEventManager.RegisterInstanceHandler( UXListBox2, ISDragDrop.PrepareDropEvent, new DragEventHandler(UXListBox2_PrepareDrop), true); } private void UXListBox2_PrepareDrop(object sender, DragEventArgs e) { var dataObject = e.Data as DragDropEventData; if (dataObject != null) { string retrievedData = dataObject.GetData().ToString(); } }
Hope this helps.
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