Click here to Skip to main content
       

C#

 
GeneralRe: Running an exe PinmvpRichard MacCutchan22-Jan-13 7:15 
AnswerRe: Running an exe Pinmemberjschell22-Jan-13 8:09 
AnswerRe: Running an exe PinmemberJoe Woodbury22-Jan-13 10:14 
GeneralRe: Running an exe PinmemberTheGermoz22-Jan-13 10:50 
GeneralRe: Running an exe Pinmemberjibesh22-Jan-13 14:50 
GeneralRe: Running an exe PinmemberTheGermoz22-Jan-13 18:55 
GeneralRe: Running an exe Pinmemberjibesh22-Jan-13 19:25 
QuestionDrag items to Listview Pinmemberjenya722-Jan-13 4:01 
Hi All,
I have a ListView with 3 groups.
I drag an item from TreeView to ListView:
private void listViewDemo_DragDrop(object sender, DragEventArgs e)
{
    if (!is_listview) //treeview item
    {
        //get a text of a draged item
        string str = e.Data.GetData(DataFormats.Text).ToString();
        //get information about hovered item
        ListViewHitTestInfo hit_info = listViewDemo.HitTest(listViewDemo.PointToClient(new Point(e.X, e.Y)));
        //check position - must be on an item
        if (hit_info.Location == ListViewHitTestLocations.None) return;
        ListViewItem prev_item = hit_info.Item;
        ListViewGroup group = prev_item.Group;
        int idx = prev_item.Index;
        //create a new key
        Guid key = Guid.NewGuid();
        string item_key = key.ToString();
        //create a new item
        //option 1
        group.Items.Add(listViewDemo.Items.Insert(idx,item_key, str, ""));
        //option2
        //group.Items.Insert(idx,listViewDemo.Items.Insert(idx, item_key, str, ""));
    }
}
I expect to add an item in place of pointed item, but any option adds element in the end of the group.
How can i add the item in the spot where mouse hover?
AnswerRe: Drag items to Listview PinmemberBobJanova22-Jan-13 22:49 
QuestionHow to call a "Windows Form Application" in a "Windows Service"? PinmemberDaKhucBuon22-Jan-13 1:40 
AnswerRe: How to call a "Windows Form Application" in a "Windows Service"? PinmemberPIEBALDconsult22-Jan-13 2:21 
AnswerRe: How to call a "Windows Form Application" in a "Windows Service"? PinmvpDave Kreskowiak22-Jan-13 2:27 
AnswerRe: How to call a "Windows Form Application" in a "Windows Service"? PinmemberCollin Jasnoch22-Jan-13 3:34 
GeneralRe: How to call a "Windows Form Application" in a "Windows Service"? PinmemberDaKhucBuon22-Jan-13 13:56 
GeneralRe: How to call a "Windows Form Application" in a "Windows Service"? PinmemberPIEBALDconsult22-Jan-13 15:50 
AnswerRe: How to call a "Windows Form Application" in a "Windows Service"? PinmemberDaKhucBuon23-Jan-13 15:59 
Question(solved) grab selected text from anywhere [modified] Pinmembermsickel21-Jan-13 23:34 
AnswerRe: grab selected text from anywhere PinmvpRichard MacCutchan21-Jan-13 23:59 
AnswerRe: grab selected text from anywhere PinmemberSledgeHammer0122-Jan-13 4:53 
AnswerRe: grab selected text from anywhere PinmemberRavi Bhavnani22-Jan-13 10:20 
GeneralRe: grab selected text from anywhere Pinmembermsickel23-Jan-13 0:58 
QuestionSocket chat client & Server help PinmemberDioblos21-Jan-13 11:52 
AnswerRe: Socket chat client & Server help PinmvpEddy Vluggen21-Jan-13 13:00 
GeneralRe: Socket chat client & Server help PinmemberDioblos21-Jan-13 13:24 
GeneralRe: Socket chat client & Server help PinmvpEddy Vluggen21-Jan-13 13:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 26 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid