Objectlistview doubleclick explained

血红的双手。 提交于 2019-12-06 15:26:38

Which comes up with a value for each double clicked row. But how do I get the details from that row?

I think you have to access the RowObject using the underlying OLVListItem like this:

private void treeListView_ItemActivate(object sender, EventArgs e) {
    var item = treeListView.GetItem(treeListView.SelectedIndex).RowObject;     
}

This is how I'm now getting the data out of the treelistview:

private void treeListView_ItemActivate(object sender, EventArgs e)
{
    try
    {
        var se = (StructureElement)treeListView.GetItem(treeListView.SelectedIndex).RowObject;
        MessageBox.Show(se.id.ToString());
    }
    catch (Exception e3)
    {
        globals.logfile.error(e3.ToString());
        globals.logfile.flush();
    }
    finally
    {
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!