This question is locked. New answers and comments are not allowed.
Hi There,
I have created a style for CheckboxColumn in which i have placed a image and aligned that in the center of the cell, this style is implicit style, but when i double click on cell to edit the value, then i see a default checkbox which is aligned to right side, i have no problem to have that checkbox, but i want to align that checkbox to center. but i don't know where i can do that. can you please guide me.
Attached a image please check.
Style which i have created is below:
Thanks in advance for your precious help.
Regards,
Srinivas.
I have created a style for CheckboxColumn in which i have placed a image and aligned that in the center of the cell, this style is implicit style, but when i double click on cell to edit the value, then i see a default checkbox which is aligned to right side, i have no problem to have that checkbox, but i want to align that checkbox to center. but i don't know where i can do that. can you please guide me.
Attached a image please check.
Style which i have created is below:
<ControlTemplate x:Key="GridViewCheckBoxTemplateWithIcon" TargetType="telerik:GridViewCheckBox"> <Grid HorizontalAlignment="Left" Height="13" VerticalAlignment="Center" Width="13"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CheckStates"> <VisualState x:Name="Checked"> <Storyboard> <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="CheckedPath"> <DiscreteObjectKeyFrame KeyTime="0"> <DiscreteObjectKeyFrame.Value> <Visibility>Visible</Visibility> </DiscreteObjectKeyFrame.Value> </DiscreteObjectKeyFrame> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Unchecked"/> <VisualState x:Name="Indeterminate"> <Storyboard> <ObjectAnimationUsingKeyFrames BeginTime="0" Duration="0" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="IndeterminatePath"> <DiscreteObjectKeyFrame KeyTime="0"> <DiscreteObjectKeyFrame.Value> <Visibility>Visible</Visibility> </DiscreteObjectKeyFrame.Value> </DiscreteObjectKeyFrame> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> <Border> <Border> <Border> <Grid Margin="0"> <Path x:Name="IndeterminatePath" Data="M14.708333,144.5 L20.667,144.5" HorizontalAlignment="Center" Height="7" Margin="0" Stretch="Fill" Stroke="#FF8D8D8D" StrokeThickness="1.5" Visibility="Collapsed" VerticalAlignment="Center" Width="7"/> <Path x:Name="CheckedPath1" Data="M32.376187,77.162509 L35.056467,80.095277 40.075451,70.02144" HorizontalAlignment="Center" Margin="0" Stretch="Fill" Stroke="#FF8D8D8D" StrokeThickness="1.5" Visibility="Collapsed" VerticalAlignment="Center"/> <Image x:Name="CheckedPath" Source="/Check.png" Visibility="Collapsed"/> </Grid> </Border> </Border> </Border> </Grid> </ControlTemplate> <Style x:Key="GriViewCheckboxStyle" TargetType="telerik:GridViewCheckBox"> <Setter Property="Template" Value="{StaticResource GridViewCheckBoxTemplateWithIcon}"/> <Setter Property="HorizontalAlignment" Value="Center"/> </Style> <Style BasedOn="{StaticResource GriViewCheckboxStyle}" TargetType="telerik:GridViewCheckBox"/>Thanks in advance for your precious help.
Regards,
Srinivas.