View previous topic :: View next topic |
Author |
Message |
M2M_Brian
Joined: 22 Oct 2010 Posts: 8
|
Posted: Mon Oct 25, 2010 9:56 pm Post subject: Disable Expanding |
|
|
Is it possible to disable the expanding of a row? I am building something similar to the file browser, but don't want the user to be able to expand the right pane, only the left. I am currently setting the right panes data source to match the selected node on the right. Is there an easy way to do this?
Thanks in advance,
Brian |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Oct 26, 2010 12:39 am Post subject: |
|
|
Yes to do this in the FileBrowser sample you would change FileList.GetChildrenForRow method so that it only returns children for the the _rootDirectory see code below:
Code: | protected override IList GetChildrenForRow(Row row)
{
//if (!(row.Item is DirectoryInfo)) return null;
//DirectoryInfo info = row.Item as DirectoryInfo;
//if (!info.Exists) return null;
DirectoryInfo info = row.Item as DirectoryInfo;
if (info != _rootDirectory) return null;
.... |
You would also need to change the RowBinding.ChildPolicy for the Directories from LoadOnExpand to Normal. Otherwise you will still get the expand symbol appearing next to items. To change this you open the FileList control in the designer and click on the RowBindings property in the Property window. This will display the Virtual Tree editor. Select the directory RowBinding and change the ChildPolicy. _________________ Infralution Support |
|
Back to top |
|
|
|