I use a telerik datagrid to display my data in UWP. I want to hide the Id column because this is automatically increased field in my SQLite database. I use it however in various methods. the command this.["Name of the grid"].Columns[1].Visability = false produces an exeption,
I tried various other solutions but nothing seems to work.
Regards Rob
I use: Visual studio 2019
Telerik.UI.for.UWP 1.0.2.9
code XAML:
<Pagex:Class="GolfComp.Views.KlasseListPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:telerikGrid="using:Telerik.UI.Xaml.Controls.Grid"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<RelativePanel>
<CommandBar x:Name="mainCommandBar" HorizontalAlignment="Stretch" IsEnabled="{x:Bind enableCommandBar}">
<AppBarButton
Click="Insert_new_entry"
Icon="Add"
Label="New"
ToolTipService.ToolTip="New record"/>
<AppBarButton
Click="Delete_Click"
Icon="Delete"
Label="Delete"
ToolTipService.ToolTip="Delete record" />
<AppBarButton
Click="Refresh_Click"
Icon="Refresh"
Label="Update"
ToolTipService.ToolTip="Update record" />
</CommandBar>
<StackPanel
x:Name="newRecordStackPanel"
Orientation="Horizontal"
RelativePanel.Below="mainCommandBar">
<TextBox
Header="Naam Competitie"
PlaceholderText="naam"
Margin="8,8,16,8"
MinWidth="200"
x:Name="NaamTextBox" />
<TextBox
Header="Klasse"
PlaceholderText="klasse"
Margin="8,8,16,8"
MinWidth="200"
x:Name="klasseTextBox" />
<AppBarButton x:Name="DeleteNewRecord" Click="DeleteNewRecord_Click" Icon="Cancel"/>
<AppBarButton x:Name="SaveNewRecord" Click="SaveNewRecord_Click" Icon="Save"/>
</StackPanel>
<telerikGrid:RadDataGrid
x:Name="DataGrid"
BorderThickness="0"
ColumnDataOperationsMode="Flyout"
GridLinesVisibility="None"
GroupPanelPosition="Left"
RelativePanel.AlignLeftWithPanel="True"
RelativePanel.AlignRightWithPanel="True"
RelativePanel.Below="newRecordStackPanel"
ItemsSource="{x:Bind klasse}"
UserEditMode="Inline"
SelectedItem="{x:Bind SelectedItem, Mode=TwoWay}"/>
</RelativePanel>
</Grid>
</Page>