Friends,
Now a day every person wants drag-drop functionality i.e., No more steps, easy and fast. Yes, I have tried this functionality on ListView Control.
Try this steps
Step: 1
Create one form and add two new List view control in Design named ListView, ListView1.
Step: 2
Open ListView Property change,
SingleSelection : No
ViewType : Report
DragDrop : Manual
NOTE : Change property in two ListView control.
Step: 3
Override method init() method in form and write this code,
public void init()
{
FormListControl listControl;
FormListColumn column;
CustTable custTable;
super();
ListView.addColumn(1, new FormListColumn("Customer Account"));
ListView1.addColumn(1, new FormListColumn("Customer Account"));
while select custTable
{
ListView.add(custTable.AccountNum);
}
}
Step: 4
Override method drop() method in ListView1 control and write this code,
public void drop(FormControl _dragSource, FormDrag _dragMode, int _x, int _y)
{
int i;
FormListItem listItem;
FormDrag formDrag = FormDrag::Copy;
i = ListView.getNextItem(FormListNext::Selected);
while( i != -1)
{
listItem = ListView.getItem(i);
ListView1.add(listItem.text());
ListView.delete(i);
i = ListView.getNextItem(FormListNext::Selected, i-1);
}
}
Step: 5
Override method drop() method in ListView control and write this code,
public void drop(FormControl _dragSource, FormDrag _dragMode, int _x, int _y)
{
int i;
FormListItem listItem;
FormDrag formDrag = FormDrag::Copy;
i = ListView1.getNextItem(FormListNext::Selected);
while( i != -1)
{
listItem = ListView1.getItem(i);
ListView.add(listItem.text());
ListView1.delete(i);
i = ListView1.getNextItem(FormListNext::Selected, i-1);
}
}
Output will be as like below,
Now a day every person wants drag-drop functionality i.e., No more steps, easy and fast. Yes, I have tried this functionality on ListView Control.
Try this steps
Step: 1
Create one form and add two new List view control in Design named ListView, ListView1.
Step: 2
Open ListView Property change,
SingleSelection : No
ViewType : Report
DragDrop : Manual
NOTE : Change property in two ListView control.
Step: 3
Override method init() method in form and write this code,
public void init()
{
FormListControl listControl;
FormListColumn column;
CustTable custTable;
super();
ListView.addColumn(1, new FormListColumn("Customer Account"));
ListView1.addColumn(1, new FormListColumn("Customer Account"));
while select custTable
{
ListView.add(custTable.AccountNum);
}
}
Step: 4
Override method drop() method in ListView1 control and write this code,
public void drop(FormControl _dragSource, FormDrag _dragMode, int _x, int _y)
{
int i;
FormListItem listItem;
FormDrag formDrag = FormDrag::Copy;
i = ListView.getNextItem(FormListNext::Selected);
while( i != -1)
{
listItem = ListView.getItem(i);
ListView1.add(listItem.text());
ListView.delete(i);
i = ListView.getNextItem(FormListNext::Selected, i-1);
}
}
Step: 5
Override method drop() method in ListView control and write this code,
public void drop(FormControl _dragSource, FormDrag _dragMode, int _x, int _y)
{
int i;
FormListItem listItem;
FormDrag formDrag = FormDrag::Copy;
i = ListView1.getNextItem(FormListNext::Selected);
while( i != -1)
{
listItem = ListView1.getItem(i);
ListView.add(listItem.text());
ListView1.delete(i);
i = ListView1.getNextItem(FormListNext::Selected, i-1);
}
}
Output will be as like below,
Comments
Post a Comment