Hi WiseJ-Team,
is it possible to impelement/use drag’n’drop to change the order of the visible, databounded Data-Items?
I want to implement a scenario that the user can change the order of the items (Training participants) via drag’n’drop and not per button-click.
Kind Regards,
Jan
I thought it was going to be more difficult but it turned out to be quite easy with Wisej!
In general, drag & drop in Wisej works the same as in a desktop windows app:
Plus you can also change the image of the dragging items. You could also take a screenshot of the item being dragged using the Html2Canvas extension (https://wisej.com/extensions/).
See attached.
https://drive.google.com/file/d/1lz6yFWI8MUahEXhErtRADCIvPheiCwHa/view
Padding pads inside the DataRepeaterItem. The DataRepeater is a “virtual” widget composed of vertical or horizontal “cells”. The cells contain the DataRepeaterItem, which in turn contains your controls. The cells must be of the specified size in order to scroll the virtual content – the DataRepeater only creates the visible widgets, that’s why it’s able to manager unlimited records.
What you can do is to:
The screen was created using the demo attached previously plus:
private void dataRepeater1_ItemUpdate(object sender, DataRepeaterItemEventArgs e) { e.DataRepeaterItem.Controls["panel1"].BackColor = e.DataRepeaterItem.ItemIndex % 2 == 0 ? Color.Red : Color.Green; }
HTH
See attached variation. This one uses our Html2Canvas extension (https://wisej.com/extensions/) to take an async screenshot of the item and use that image for the dragging cursor. It’s a bit delayed because of the screenshot. I think the icon looks better, but this is fun code.
Please login first to submit.