1- how can wirite following code in xaml?
this
.XamDataGrid_SearchResults.ScrollInfo.ScrollOwner.VerticalScrollBarVisibility = SCrollBarVisibility.Visible;
2- how can wirite access to inner XamDataGrid represented in a hierachical view?
(i need use code in part 1 to it)
Hello,
I see you mean the FieldLayouts collection. However, do you want to be able to target the separate fieldLayouts and set the ScrollBarVisibility on that.. Based on what you say, it seems you want to be able to show/hide the scrollbar on a FieldLayout basis. This will be a complicated task. First, just to target the appropriate FieldLayout, you have to use RelativeSource binding and use the FindAncestor type along with a Converter. Inside of the converter, we can find the appropriate field layout the RecordListControl is for and return the visibility that you need. However, once this is done, you will see a scrollbar in the child grid, but it will not be active because the child grid area will resize to its contents based on the template defined for the control. Digging in to a way around this may take some time to research. Please reply and let me know if you want to be able to have a scrollbar in the child grid and I will find any information that I can to help you through this.
Yes. i am meaning FieldLayouts collection.
xamDataGrid.FieldLayouts[0] -> "outer"
xamDataGrid.FieldLayouts[1] -> nested, "inner"
Q2. I think you are meaning FieldLayouts collection.
...
Alex.
If you want to write the above code in xaml while using the grid, you will have to target the RecordListControl object within the grid and retemplate it. For your puppose, you would just change the VerticalScrollBarVisibility to visible.
<my:XamDataGrid x:Name="m_grdResult" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"> <my:XamDataGrid.Resources> <Style TargetType="{x:Type my:RecordListControl}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type my:RecordListControl}"> <ScrollViewer CanContentScroll="False" Focusable="False" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled"> <ItemsPresenter/> </ScrollViewer> </ControlTemplate> </Setter.Value> </Setter> </Style> </my:XamDataGrid.Resources> </my:XamDataGrid>
For your second question, I am not completerly sure what you are referring to. Once you have implemented the solution above, let me know what you are referring to in your second question and I will be happy to help you with it.