Rank: Member
Groups: Guest
Joined: 1/7/2008(UTC) Posts: 28
|
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: Guest
Joined: 1/31/2005(UTC) Posts: 458
Was thanked: 5 time(s) in 5 post(s)
|
Hello, Try to set ThumbnailListView.UseDragToMove property to "true". |
|
|
|
|
Rank: Member
Groups: Guest
Joined: 1/7/2008(UTC) Posts: 28
|
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: Guest
Joined: 1/7/2008(UTC) Posts: 28
|
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: Guest
Joined: 1/31/2005(UTC) Posts: 458
Was thanked: 5 time(s) in 5 post(s)
|
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);
}
}
|
|
|
|
|
Rank: Member
Groups: Guest
Joined: 1/7/2008(UTC) Posts: 28
|
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: Guest
Joined: 1/31/2005(UTC) Posts: 458
Was thanked: 5 time(s) in 5 post(s)
|
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. |
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.