Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TreeDataGrid and VerticalScrollBarVisibility & VerticalScrollBarVisibility don't work #264

Open
KentSwan opened this issue Feb 26, 2024 · 3 comments

Comments

@KentSwan
Copy link

TreeDataGrid rejects the VerticalScrollBarVisibility and HorizontalScrollBarVisibility properties which relate to setting up its internal scrollbars. Am I missing something here? Per my previous post, all of this is being tested at the most recent implementation Version levels.

		<TreeDataGrid	Name="countries"
						Source="{Binding Source}"
						Height="Auto"
						Width="Auto"
						VerticalScrollBarVisibility="Auto"
						HorizontalScrollBarVisibility="Auto"
						AutoDragDropRows="True">

What I'm trying to test here is what code I have to add so that the TreeDataGrid scroll viewport will move to ensure that a selected item comes into view if not already visible in the scroll viewport. A not-in-view condition occurs when a key up/down page up/down, home, or end selects an out-of-viewport item. It can also happen when a search or insertion selection in a key column causes TreeDataGrid to select an item outside of the current scroll viewport.

@KentSwan
Copy link
Author

Some more info. In the design viewer, the TreeDataGrid shows the treedatagrid's vertical scroll bars in the viewable collapsed state and allows mouse thumb scrolling but when I run the app in debug mode in VS2022 the scrollbars are not present. I'm running everything at the current version levels including the TreeDataGrid package from Nuget which is after the latest theme changes to bases styled controls on a generic base theme.

@KentSwan
Copy link
Author

More information. In VS2022 the scrollbars show up and work in the axaml designer window of the individual views but when those views are installed in a TabControl's TabItem content in MainWindow, the views scroll bars don't show up.

The control axaml setup in the MainWindow view is as follows.


	<StackPanel>
		<Border BorderBrush="Black"
				BorderThickness="1"
				Background="AliceBlue">
			<TextBlock Text="{Binding Greeting}"
					   FontWeight="Bold"
					   HorizontalAlignment="Center"/>
		</Border>

		<TabControl>
			<TabItem Header="Countries">
				<v:CountriesPageView/>
			</TabItem>
			<TabItem Header="Files">
				<v:FilesPageView/>
			</TabItem>
			<TabItem Header="DragDrop">
				<v:DragDropPageView/>
			</TabItem>
			<TabItem Header="Wikipedia">
				<v:WikipediaPageView/>
			</TabItem>
		</TabControl>

	</StackPanel>

@KentSwan
Copy link
Author

Well, I think I found the interference problem. In the current Avalonia UI, the scroll bars of a TreeDataGrid control will be suppressed if the control is a control inside of a stack panel, apparently at any nested level. NFC as how or why that occurs or if it's an inherent UI design constraint related to Stack Panels. (NFC is short for No F***ing Clue) For this reason, I'm switching my demo over to using a Dock on the main window with a top dock to handle the header and the tabbed views below that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant