<gridColumns:BetaTextBoxColumn Header="Price" Width="80" IsVisible="{Binding Source={StaticResource ParentViewModel}, Path=DataSource.PositionsColumnsVisible}" > <telerik:GridViewColumn.CellTemplate> <DataTemplate > <TextBox Text="{Binding [_20047].Value,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" commonUI:ExtendedProperties.RegEx="{Binding Path=[_20047].RegEx}" IsEnabled="{Binding Path=[_20047].IsEnabled}" Height="20" MinHeight="20"> </TextBox> </DataTemplate> </telerik:GridViewColumn.CellTemplate> </gridColumns:BetaTextBoxColumn>
In the above XAML i need to remove Tabstop for when the Textbox is disabled. Is there a way I can bind the Gridviewtabstop to "IsEnabled" property of templated textbox ?
6 Answers, 1 is accepted
You can set the column to be IsEnabled="False" instead. That will remove the TabStop. Would this be a valid option for you?
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Indeed you are right. Please excuse me for misleading you, it turns out that there is not such a property for the column.
In that case you can bind the value for the TabStopMode to a new property that you can expose in your ViewModel. Based on whether the TextBox should be enabled or disabled, you will return the appropriate value (Skip, Stop) for that new property.
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
I need something that can bind to gridviewcell based the contained templated control inside the cell is enabled or not ?
I need to bind some property on the gridviewcell to IsEnabled property of the control.
Any suggestions would be appreciated..
Thanks.
In order to have the TabStop be specific for the GridViewCell, you can define a Style controlling the "IsEnabled" property for the GridViewCell via a Binding to a property of the bound business object. It will be applied per item (cell from the column) and allow/deny the TabStop on that cell.
For example I have defined a property IsEnabled for the bound item and this is the code I have used to control the enabled state per GridViewCell:
<
Style
x:Key
=
"disabledStyle"
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"IsEnabled"
Value
=
"{Binding IsEnabled}"
/>
</
Style
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Name}"
CellStyle
=
"{StaticResource disabledStyle}"
>
<
telerik:GridViewColumn.CellTemplate
>
<
DataTemplate
>
<
TextBox
Text
=
"{Binding Name}"
/>
</
DataTemplate
>
</
telerik:GridViewColumn.CellTemplate
>
</
telerik:GridViewDataColumn
>
I hope this can be applied to your solution.
Regards,
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.