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

Default style for GridViewCheckBox

12 Answers 157 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Edward
Top achievements
Rank 1
Edward asked on 17 May 2011, 04:39 PM
I changed my Checkbox to display a ? instead of - when the value is null by changing the IndeterminateIcon from a rectangle to a path that resemble a "?".  Can you provide the default style for the GridViewCheckBox so I can do the same?

12 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 18 May 2011, 10:14 AM
Hello Edward,

 

You may change this by altering the appearance of GridViewCheckBox and replace the indeterminate icon with a TextBlock, which Text property is set to "?", please refer to the attached picture. 
If you need any further assistance do not hesitate to contact us!


Best wishes,
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
Edward
Top achievements
Rank 1
answered on 18 May 2011, 08:02 PM
I made the change and while the ? is showing up, once I switch to edit mode then it defaults back to the -.  Is there a EditTemplate somewhere?
0
Vanya Pavlova
Telerik team
answered on 18 May 2011, 08:12 PM
Hi Edward,

 

When GridViewCheckBoxColumn goes into edit mode the standard CheckBox appears. If you want to maintain the same behavior in edit mode you should change the Indeterminate icon for CheckBox control in the same way and apply it within GridViewCheckBoxColumn's EditorStyle, as shown below:

<Style x:Key="style1" TargetType="CheckBox">
.....The rest of your style
</Style>
 
<telerik:GridViewCheckBoxColumn EditorStyle="{StaticResource style1}" ... />


You may also mark this style as an implicit without specifying the x:Key attribute and it will be applied to all CheckBox in your current application.

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
Vanya Pavlova
Telerik team
answered on 18 May 2011, 08:12 PM
Hi Edward,

 

When GridViewCheckBoxColumn goes into edit mode the standard CheckBox appears. If you want to maintain the same behavior in edit mode you should change the Indeterminate icon for CheckBox control in the same way and apply it within GridViewCheckBoxColumn's EditorStyle, as shown below:

<Style x:Key="style1" TargetType="CheckBox">
.....The rest of your style
</Style>
 
<telerik:GridViewCheckBoxColumn EditorStyle="{StaticResource style1}" ... />


You may also mark this style as an implicit without specifying the x:Key attribute and it will be applied to all CheckBoxes in your current application.


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
Edward
Top achievements
Rank 1
answered on 18 May 2011, 08:17 PM
I already have a implicit checkbox style defined, using the ? instead of -.  However, the checkbox inside the grid still use -, where the checkbox outside of the grid use ?.

In fact, I don't think the checkbox in edit mode is the same as the regular checkbox at all.  The default checkbox in grid edit mode has 2 borders (so the tick in it is smaller), while the normal checkbox only have 1 border.
0
Vanya Pavlova
Telerik team
answered on 18 May 2011, 08:24 PM
Hello Edward,

 

The CheckBox control is one of the native Silverlight controls supported by our theming mechanism.
As you might know we ship our themes as separate projects. You may get the xaml files for any Telerik theme from the Themes folder of your personal installation. May you please open the Themes/Office_Black folder, find the CheckBox.xaml file. Copy this style to your current project change the Indeterminate icon to "?", mark this style as an implict and let me know what happens. 


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
Edward
Top achievements
Rank 1
answered on 18 May 2011, 08:48 PM
I already have a style for checkbox using the ?, defined as implicit in one of my resource dictionary file.  That style is working fine outside of the grid.  I saw that file, but it is largely a duplicate of my own and it is just another implicit style.  

I am guessing the implicit style stored under the theme is overriding my own implicit style.  If that's true then I need to edit then recompile all the themes myself?
0
Vanya Pavlova
Telerik team
answered on 18 May 2011, 08:54 PM
Hi Edward,

 

Indeed the styles are theme specific and they use their own resources for a particular theme. In each theme you have a separate styles for a control and its parts. For example: if you want to change the CheckBox in Windows7Theme you may copy only the style for this control in Windows7 theme to your current project and modify in in a desired way. Then the changes will be reflected correspondingly.  


Please let me know if you need a sample project that demonstrates this approach.



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
0
Edward
Top achievements
Rank 1
answered on 18 May 2011, 09:26 PM
I said I already have a working implicit style with my checkbox.  But anyways, I removed my own working copy, then copy the one from OfficeBlack to my project and modified it there.

At the end, nothings change:  checkbox outside of the grid reflects the changes; checkbox inside the grid does not.  
0
Vanya Pavlova
Telerik team
answered on 24 May 2011, 09:05 AM
Hello Edward,

 

I have prepared an example for you using binaries as part of our latest internal build that demonstrates how this can be achieved.


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
0
arun
Top achievements
Rank 1
answered on 15 Feb 2012, 02:40 PM
Hi Vanya Pavlova,


Iam using gridviewcheckbox column,i want to assign dropshadow effect to my gridviewcheckbox column..

for eg in normal check box in silverlight:

List<CheckBox> chkList = AddFirmUser._addFirmUserInstance.dataGridPortalList.GetVisualOfType<CheckBox>().Where(c => c.Name == "chkActive").ToList();
                       if (chkList.Count > 0)
                       {
                           foreach (CheckBox chk in chkList)
                           {
                               chk.Effect = (DropShadowEffect)Resources["HelpEffect"];
                           }
                           Storyboard.SetTarget(storyForWizard, chkList[0]);
                           storyForWizard.Begin();
                       }

How to write for telerik gridviewcheckbox
column in silverlight.i tried by this ..its not working

List<GridViewCheckBoxColumn> chkList = AddFirmUser._addFirmUserInstance.dataGridPortalList.GetVisualOfType<GridViewCheckBoxColumn>().Where(c => c.UniqueName == "chkActive").ToList();
                       if (chkList.Count > 0)
                       {
                           foreach (GridViewCheckBoxColumn chk in chkList)
                           {
                               chk.Effect = (DropShadowEffect)Resources["HelpEffect"];
                           }
                           Storyboard.SetTarget(storyForWizard, chkList[0]);
                           storyForWizard.Begin();
                       }


Is it possible for grid view check box column telerik silverlight?
0
arun
Top achievements
Rank 1
answered on 17 Feb 2012, 05:52 AM
Pls reply for my Post!
Tags
GridView
Asked by
Edward
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Edward
Top achievements
Rank 1
arun
Top achievements
Rank 1
Share this question
or