A Microsoft platform for building and publishing apps for Windows devices.
The border is not a container control so you cant add controls to it. I would try putting a StackPanel inside the border and add the DataGrid to the stackpanel.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I have Page with BORDER
<Page
x:Class="DGT_TEST.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:DGT_TEST"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
Loaded="Page_Loaded"
>
<Grid>
<Border x:Name="brd1"></Border>
</Grid>
</Page>
In Loaded event I try to put to this border a DataGrid wich I improved a bit.
private void Page_Loaded(object sender, RoutedEventArgs e)
{
brd1.Child = new DGT<MyClass>();
}
public class DGT<T> : DataGrid
{
}
public class MyClass : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
}
But when I try to run this code in release mode, an error occurs.
How to pass this problem?
A Microsoft platform for building and publishing apps for Windows devices.
The border is not a container control so you cant add controls to it. I would try putting a StackPanel inside the border and add the DataGrid to the stackpanel.