Example #1
0
        public void SetSelectedFile(string filename)
        {
            TreeIter iter = new TreeIter();

            store.Foreach((model, path, iterr) =>
            {
                string myPath = store.GetValue(iterr, PATH_ROW).ToString();

                if ((myPath == filename))
                {
                    //iter = iterr;
                    iter = filter.ConvertChildIterToIter(iterr);
                    if (!iter.Equals(TreeIter.Zero))
                    {
                        TreePath tp = filter.GetPath(iter);
                        treeView.ExpandToPath(tp);
                        treeView.ScrollToCell(tp, null, true, 0.9f, 0);
                        //treeView.Selection.UnselectAll();
                        treeView.Selection.SelectIter(iter);
                    }
                    return(true);
                }
                return(false);
            });
        }