This is a migrated thread and some comments may be shown as answers.

GridView Paging bug when using custom row control template element loaded

4 Answers 46 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tomas Cyzas
Top achievements
Rank 1
Tomas Cyzas asked on 11 Nov 2015, 01:39 PM

GridView Paging bug when using custom row control template element loaded.

When the first element is loaded and its set to IsEnabled = false then the first element on the next page is also set to IsEnabled to false.

bet when i go to the page number 3 and go back then is everything ok. 

XAML:

 <CheckBox Name="assembledCheckBox"
  Margin="0,0,0,0"
  FontWeight="Bold"
  FontSize="10"
  Grid.Row="1"
  Grid.Column="1"
  VerticalAlignment="Center"
  HorizontalAlignment="Left" Content="Assembled"
  IsChecked="{Binding a_status}" Loaded="assembledCheckBox_Loaded"
 >​

 

 private void assembledCheckBox_Loaded(object sender, RoutedEventArgs e)
        {

            CheckBox temp = new CheckBox();
            temp = (CheckBox)sender;
            if (temp.IsChecked == true)
            {
                temp.IsEnabled = false;
            }
        }​

 

4 Answers, 1 is accepted

Sort by
0
Tomas Cyzas
Top achievements
Rank 1
answered on 12 Nov 2015, 10:53 AM
Maybe there is a workaround, to solve this problem or i'm doing something wrong?
0
Yoan
Telerik team
answered on 16 Nov 2015, 06:43 AM
Hello Tomas,

Generally, it is not recommended to work with visual elements directly when they are placed in GridView's row or cell. This is because of GridView's UI Virtualization mechanism which ensures recycling of the grid's rows and cells. This means that the Loaded event of your checkbox will be raised when RadGirdView reloads its rows. The recommended approach would be to work with the data items. In order to help you further, you can share more information about your scenario.

Regards,
Yoan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Tomas Cyzas
Top achievements
Rank 1
answered on 16 Nov 2015, 11:40 AM

Hello Yoan,

The scenario is simple the custom row has 3 checkbox's.

The checked value is selected from database values true or false. If the value is true the checkbox should be checked and isEnabled set to false.  If value is false  for the first checkbox should be not checked and enabled, but all the subs should be disabled. 

And if the first is checked then the secod should be enabled and so on...

 Tomas

 

0
Yoan
Telerik team
answered on 19 Nov 2015, 08:36 AM
Hello Tomas,

This should be easy to achieve using only your business object. I have created a sample project which demonstrates a possible approach. Please give it a try and let me know how it works for you.

Regards,
Yoan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Tomas Cyzas
Top achievements
Rank 1
Answers by
Tomas Cyzas
Top achievements
Rank 1
Yoan
Telerik team
Share this question
or