|
|
Rank: Member Groups: Member
Joined: 1/8/2008 Posts: 28 Points: 84
|
Hi,
May I know is there anyway we could let the user drag and drop to rearrange the thumbnail?
Please advice.
Thanks in advance.
|
|
Rank: Advanced Member Groups: Administration
, Member
Joined: 1/31/2005 Posts: 386 Points: 403
|
Hello,
Try to set ThumbnailListView.UseDragToMove property to "true".
Best wishes, Alex.
|
|
Rank: Member Groups: Member
Joined: 1/8/2008 Posts: 28 Points: 84
|
Alex Kon wrote:Hello,
Try to set ThumbnailListView.UseDragToMove property to "true".
Hi, May I know which event will be fired when the user "dragtomove"? Please advice.
|
|
Rank: Member Groups: Member
Joined: 1/8/2008 Posts: 28 Points: 84
|
Alex Kon wrote:Hello,
Try to set ThumbnailListView.UseDragToMove property to "true".
Hi Beside that _thl.Items.Insert(PageIndex, New Aurigma.GraphicsMill.WinControls.ThumbnailListItem(pidl)) When I insert item, seems like it will still appear @ the last item in the list and now following the index. If I call _thl.Refresh, it seems like doesn't work too.
|
|
Rank: Advanced Member Groups: Administration
, Member
Joined: 1/31/2005 Posts: 386 Points: 403
|
Hello, Regarding to the first question - all standart drag-n-drop events will be fired (DragOver, DragEnter, DragDrop). As for Insert(...) method - there is no obligatory correspondence between index in the ThumbnailListView.Items collection and visual order. Here is method which inserts item into the control and updates thumbnails visual order. Code:
private void InsertItemToIndex(IListItem item, int index)
{
if (index < 0 || index > _thumbList.Items.Count)
throw new ArgumentOutOfRangeException("index");
_thumbList.Items.Add(item);
if (index < _thumbList.Items.Count)
{
int[] indexes = new int[_thumbList.Items.Count - index - 1];
for (int k = index, i = 0; k < _thumbList.Items.Count - 1; k++)
indexes[i++] = k;
_thumbList.Items.Swap(indexes, _thumbList.Items.Count);
}
}
Best wishes, Alex.
|
|
Rank: Member Groups: Member
Joined: 1/8/2008 Posts: 28 Points: 84
|
Great !!! The Rearrange code works great !!!
And here is the issue... We are trying to let the user rearrange the Thumbnail as we mentioned... But, we do have internal array that keep track of the sequence together with details. Thus, we would like the array to be rearrange while the Thumbnail is being Rearranged. And yet, we would like to prevent the user to rearrange the 1st and the last thumbnail, (means the 1st and last thumbnail position is fix)
We also would like to prevent the Thumbnail being drag outside the Thumbnail Viewer, and also nothing else should be drag into the Thumbnail viewer.
Thanks in advance.
|
|
Rank: Advanced Member Groups: Administration
, Member
Joined: 1/31/2005 Posts: 386 Points: 403
|
Hello,
As for internal array: the best way I see is to bind all your additional data to IListItems using IListItem.Tag property. Maybe you will be able to get rid of the internal array at all and use ThumbnailListView.Items collection instead.
Regarding to drag-n-drop specific of your application - as you understand, we have no such built-in feature. In your case simple "UseDragToMove" is useless, so you should to re-implement this functionality with additional restrictions for the first/last elements.
You can look at Aurigma.GraphicsMill.WinControls source code (not available in trial version) or at MultFrameTiff demo source code and use them as base point for your implementation.
Best wishes, Alex.
|
|
|
Guest |