This question is locked. New answers and comments are not allowed.
Hi and as always, thanks ...
In a RadGrid I've created a button column using a DataTemplate (seperate file for reuse). In this particular grid I'm trying to have it all readonly while maintaining the buttons click ability immediately on load (i.e. no need for the user to double click a row to enable). What I'm finding (probably because of a code issue on my part) is that I can only click the button if I double click a cell, leave it and return. Can you please point out where I'm missing something.
The Grid looks like:
The button template looks like:
At this point I'm focusing on the delete button (btn_delSOLine).
On initial load the edit button is clickable but the delete button is not. As you can see above there is currently no binding to commands in respect to the edit button.
If I double click the cell it enters edit mode (buttons are no longer visible). If I click out of the cell and click to a different row, the buttons become visible and the btn_delSOLine also becomes clickable. The edit button (btn_editSOLine) remains clickable at all times.
The command seems straight forward and works without issue after the button becomes clickable.
In a RadGrid I've created a button column using a DataTemplate (seperate file for reuse). In this particular grid I'm trying to have it all readonly while maintaining the buttons click ability immediately on load (i.e. no need for the user to double click a row to enable). What I'm finding (probably because of a code issue on my part) is that I can only click the button if I double click a cell, leave it and return. Can you please point out where I'm missing something.
The Grid looks like:
<telerik:RadGridView x:Name="dg_tblSOLines" telerik:StyleManager.Theme="Expression_Dark" Height="Auto" Width="Auto" ShowGroupPanel="False" AutoGenerateColumns="False" ShowInsertRow="False" Background="#FFA4A6A9" telerikDragDrop:RadDragAndDropManager.AllowDrop="True" ShowColumnFooters="True" > <telerik:RadGridView.Columns> <telerik:GridViewDataColumn IsFilterable="False" CellTemplate="{StaticResource EditDeleteButtonsTemplate}" /> <telerik:GridViewDataColumn UniqueName="dc_quantitySO" Header="Quantity" IsReadOnly="True" DataMemberBinding="{Binding Path=quantity}" IsFilterable="False" IsGroupable="False" IsReorderable="False" /> ............ </telerik:RadGridView.Columns> </telerik:RadGridView>The button template looks like:
<Grid x:Name="LayoutRoot" > <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Button x:Name="btn_editSOLine" HorizontalAlignment="Center" VerticalAlignment="Center" Width="Auto" Height="Auto" Style="{StaticResource OpacityButton}"> <Image Source="/RoasterWerks;component/Images/edit-4.png" Stretch="None"/> </Button> <Button x:Name="btn_delSOLine" HorizontalAlignment="Center" VerticalAlignment="Center" Width="Auto" Height="Auto" Grid.Column="1" Style="{StaticResource OpacityButton}" Command="{Binding deleteCommand, Source={StaticResource TelerikGridViewCommands}}" CommandParameter="{Binding SelectedItem, Source={StaticResource RoasterWerksDomainContext}}"> <Image Source="/RoasterWerks;component/Images/edit-delete-5.png" Stretch="None" /> </Button> </Grid>At this point I'm focusing on the delete button (btn_delSOLine).
On initial load the edit button is clickable but the delete button is not. As you can see above there is currently no binding to commands in respect to the edit button.
If I double click the cell it enters edit mode (buttons are no longer visible). If I click out of the cell and click to a different row, the buttons become visible and the btn_delSOLine also becomes clickable. The edit button (btn_editSOLine) remains clickable at all times.
The command seems straight forward and works without issue after the button becomes clickable.
public class TelerikGridViewCommands { public ICommand deleteCommand { get { return RadGridViewCommands.Delete; } } }