Hi,
I as thinking of using the Reordered server event to catch the reordering of tabs and to save the change to a database. I know e.Offset is the difference between the source index and the destination index, however it is always positive, so if I drag a tab by 1 to the left or to the right, the offset is still always positive 1.
Is there any way to detect the drag direction?
The code I was planning to use is something like this:
I as thinking of using the Reordered server event to catch the reordering of tabs and to save the change to a database. I know e.Offset is the difference between the source index and the destination index, however it is always positive, so if I drag a tab by 1 to the left or to the right, the offset is still always positive 1.
Is there any way to detect the drag direction?
The code I was planning to use is something like this:
void
tabsDescriptions_Reordered(
object
sender, RadTabStripReorderedEventArgs e)
{
int
descriptionId = (
int
.Parse(e.Tab.Value));
int
destinationIndex = (e.Tab.Index + e.Offset);
int
destinationId =
int
.Parse(tabsDescriptions.Tabs[destinationIndex].Value);
if
(e.Offset > 0)
//moving after destination
{
ProductDescriptionsController.MoveProductDescriptionAfter(descriptionId, destinationId,
int
.Parse(txtProductId.Text), System.Threading.Thread.CurrentThread.CurrentUICulture.Name);
}
else
//moving before destination
{
ProductDescriptionsController.MoveProductDescriptionBefore(descriptionId, destinationId,
int
.Parse(txtProductId.Text), System.Threading.Thread.CurrentThread.CurrentUICulture.Name);
}
}