This question is locked. New answers and comments are not allowed.
Hi,
I am facing an issue while modifying the GridViewDataColumn.
Attached is the image of the requirement that i need to accomplish. I have already set the template using the grid in the datatemplate. Below is my code for it.
And my grid is getting viewed in a similar fashion. Now i simply want to hide some of the quarter columns according to the quarter count. So from the code behind according to the count value of "Number of Quarters" i simply wish to hide some the textboxes and textblocks. Is this achievable? and if yes. How will i be able to achieve it.
It would be great if anyone can post a sample of this.
Thanks and Regards,
Rohan Kondvilkar
I am facing an issue while modifying the GridViewDataColumn.
Attached is the image of the requirement that i need to accomplish. I have already set the template using the grid in the datatemplate. Below is my code for it.
<telerik:GridViewDataColumn x:Name="columnValue1" UniqueName ="Value" Width="300"> <telerik:GridViewDataColumn.Header> <Grid> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> </Grid.ColumnDefinitions> <TextBlock Text="Value ($)" HorizontalAlignment="Center" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="6"/> <TextBlock Text="Qtr1" Foreground="White" FontStyle="Normal" Grid.Row="1" Grid.Column="0"/> <TextBlock Text="Qtr2" Foreground="White" FontStyle="Normal" Grid.Row="1" Grid.Column="1"/> <TextBlock Text="Qtr3" Foreground="White" FontStyle="Normal" Grid.Row="1" Grid.Column="2"/> <TextBlock Text="Qtr4" Foreground="White" FontStyle="Normal" Grid.Row="1" Grid.Column="3"/> <TextBlock Text="Qtr5" Foreground="White" FontStyle="Normal" Grid.Row="1" Grid.Column="4"/> <TextBlock Text="Qtr6" Foreground="White" FontStyle="Normal" Grid.Row="1" Grid.Column="5"/> </Grid> </telerik:GridViewDataColumn.Header> <telerik:GridViewDataColumn.CellTemplate> <DataTemplate> <Grid> <Grid.RowDefinitions> <RowDefinition/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> </Grid.ColumnDefinitions> <TextBlock Text="{Binding Value1, Mode=TwoWay}" Grid.Row="1" Grid.Column="0"/> <TextBlock Text="{Binding Value2, Mode=TwoWay}" Grid.Row="1" Grid.Column="1"/> <TextBlock Text="{Binding Value3, Mode=TwoWay}" Grid.Row="1" Grid.Column="2"/> <TextBlock Text="{Binding Value4, Mode=TwoWay}" Grid.Row="1" Grid.Column="3"/> <TextBlock Text="{Binding Value5, Mode=TwoWay}" Grid.Row="1" Grid.Column="4"/> <TextBlock Text="{Binding Value6, Mode=TwoWay}" Grid.Row="1" Grid.Column="5"/> </Grid> </DataTemplate> </telerik:GridViewDataColumn.CellTemplate> <telerik:GridViewDataColumn.CellEditTemplate> <DataTemplate> <Grid> <Grid.RowDefinitions> <RowDefinition/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> <ColumnDefinition /> </Grid.ColumnDefinitions> <TextBox Text="{Binding Value1, Mode=TwoWay}" Grid.Row="1" Grid.Column="0"/> <TextBox Text="{Binding Value2, Mode=TwoWay}" Grid.Row="1" Grid.Column="1"/> <TextBox Text="{Binding Value3, Mode=TwoWay}" Grid.Row="1" Grid.Column="2"/> <TextBox Text="{Binding Value4, Mode=TwoWay}" Grid.Row="1" Grid.Column="3"/> <TextBox Text="{Binding Value5, Mode=TwoWay}" Grid.Row="1" Grid.Column="4"/> <TextBox Text="{Binding Value6, Mode=TwoWay}" Grid.Row="1" Grid.Column="5"/> </Grid> </DataTemplate> </telerik:GridViewDataColumn.CellEditTemplate> </telerik:GridViewDataColumn>And my grid is getting viewed in a similar fashion. Now i simply want to hide some of the quarter columns according to the quarter count. So from the code behind according to the count value of "Number of Quarters" i simply wish to hide some the textboxes and textblocks. Is this achievable? and if yes. How will i be able to achieve it.
It would be great if anyone can post a sample of this.
Thanks and Regards,
Rohan Kondvilkar