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

How do you make a GridViewCheckBoxColumn not look disabled when the column does not have focus?

3 Answers 468 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Geoff Hardy
Top achievements
Rank 1
Geoff Hardy asked on 30 Jul 2010, 11:50 PM
In our RadGridView, we have an editable GridViewCheckBoxColumn. When this column does not have focus, the background of the checkbox square is displayed as grey, giving it a disabled appearance to be disabled. It is not until you click in the cell that the background of the checkbox square changes to white, giving it an enable appearance.

Is this behaviour intentional? The user is unlikely to want to click on the checkbox cell if it is greyed out, since they will think that it is disabled. I expect that I could avoid this appearance by using a checkbox inside the template for the cell, but I was wondering if there is a simpler way of doing this.

I am using version 2010.1.603.1040 of the Telerik controls.

3 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 02 Aug 2010, 07:39 AM
Hello,

 GridViewCheckBoxColumn uses a GridViewCheckBox,and it has the default look you described-if you want to modify it you should edit the template of GridViewCheckBox. This due to the fact that you cannot change the value when the grid is in view mode but only when you enter in edit mode. 

Please let me know if you need any further assistance.

Greetings,
Vanya Pavlova
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Geoff Hardy
Top achievements
Rank 1
answered on 12 Aug 2010, 08:25 PM
Hi Vanya,

Thanks for your response. Do you have an example of how to do this? The best I could come up with was the following, but I suspect there is a better way:

<Controls:GridViewDataColumn Header="Active" Width="50" TextAlignment="Center" CellStyle="{StaticResource centeredCellStyle}">
    <Controls:GridViewDataColumn.CellTemplate>
        <DataTemplate>
            <CheckBox IsChecked="{Binding IsActive,Mode=TwoWay}" />
        </DataTemplate>
    </Controls:GridViewDataColumn.CellTemplate>
    <Controls:GridViewDataColumn.CellEditTemplate>
        <DataTemplate>
            <CheckBox IsChecked="{Binding IsActive,Mode=TwoWay}" />
        </DataTemplate>
    </Controls:GridViewDataColumn.CellEditTemplate>
</Controls:GridViewDataColumn>

Thanks,

Geoff,



0
Vanya Pavlova
Telerik team
answered on 13 Aug 2010, 03:57 PM
Hello Geoff Hardy,

I would suggest you to look at this forum thread.
You can download an example and you can see how to modify the checkBox in GridViewCheckBoxColumn-you can see the working example,you can modify the checkbox ControlTemplate in the way you need. Just change the default brushes that are used in the GridViewCheckBox in the way you need.
Please let me know if you need any further assistance.

All the best,
Vanya Pavlova
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Geoff Hardy
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Geoff Hardy
Top achievements
Rank 1
Share this question
or