Hi,
I have a gridview to show only some columns of a table the first time, and some others after the first time. The problem is if I do not include all columns in the first query when the query is changed the gridview do not update those columns.
Please assist me in this regard
Thank you
XAML
<telerik:RadGridView Grid.Row="1" Grid.ColumnSpan="4" Name="GridNewDate" ItemsSource="{Binding Path=dataTable}" ActionOnLostFocus="None"
AutoGenerateColumns="False" HorizontalAlignment="Left" CanUserInsertRows="False" CanUserDeleteRows="True"
ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Visible" Margin="0,5,0,0" CanUserFreezeColumns="True">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="A" DataMemberBinding="{Binding A}" />
<telerik:GridViewDataColumn Header="B" DataMemberBinding="{Binding B}" />
<telerik:GridViewDataColumn Header="C" DataMemberBinding="{Binding C}" />
<telerik:GridViewDataColumn Header="D" DataMemberBinding="{Binding D}" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
C# (Model)
DataTable dataTable;
…
If (firstTime)
{
_View.GridNewDate.ItemsSource = GetData(“SELECT A, C FROM T”);
firsTime = false;
}
else
{
_View.GridNewDate.ItemsSource = GetData(“SELECT A, B, C, D FROM T”);
}