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

Command on CellContentTemplate

3 Answers 165 Views
DataGrid
This is a migrated thread and some comments may be shown as answers.
eSimSE
Top achievements
Rank 1
eSimSE asked on 11 Jul 2018, 07:14 PM

this is my XAML, but when I press a little long on button with binding command, the button gray out and froze the app. It also happen with image that has command binding if it's in CellContentTemplate 

<telerikDataGrid:RadDataGrid x:Name="PigDataGrid" ItemsSource="{Binding Measurements}" AutoGenerateColumns="False" SelectionMode="Single" SelectionUnit="Cell" SelectionChanged="SelectedItem" >
        <telerikDataGrid:RadDataGrid.Columns>
            <telerikDataGrid:DataGridDateColumn PropertyName="MEASUREMENT_DATE" HeaderText="Date"/>
            <telerikDataGrid:DataGridTextColumn PropertyName="PIG_BARREL_TYPE_STRING" HeaderText="Pig"/>
            <telerikDataGrid:DataGridTextColumn PropertyName="PIG_TYPE" HeaderText="Pig Type"/>
            <telerikDataGrid:DataGridTemplateColumn HeaderText="Info">
                <telerikDataGrid:DataGridTemplateColumn.CellContentTemplate>
                    <DataTemplate>
                        <StackLayout Orientation="Horizontal" HorizontalOptions="Center" VerticalOptions="Center">
                            <Button Image="info_black.png" BackgroundColor="Transparent" Command="{Binding Path=ButtonCommand, Source={x:Reference PiggingListView}}" CommandParameter="{Binding .}" BorderWidth="0" HeightRequest="25" WidthRequest="25" HorizontalOptions="End" VerticalOptions="Center"/>
                            <Image WidthRequest="25" HeightRequest="25" HorizontalOptions="End">
                                <Image.Style>
                                    <Style TargetType="{x:Type Image}">
                                        <Style.Triggers>
                                            <DataTrigger TargetType="Image" Binding="{Binding IsUploaded}" Value="False">
                                                <Setter Property="Source" Value="clock.png"/>
                                            </DataTrigger>
                                            <DataTrigger TargetType="Image" Binding="{Binding IsUploaded}" Value="True">
                                                <Setter Property="Source" Value="upload.png"/>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </Image.Style>
                            </Image>
                        </StackLayout>
                    </DataTemplate>
                </telerikDataGrid:DataGridTemplateColumn.CellContentTemplate>
            </telerikDataGrid:DataGridTemplateColumn>
            <telerikDataGrid:DataGridTemplateColumn HeaderText="Delete">
                <telerikDataGrid:DataGridTemplateColumn.CellContentTemplate>
                    <DataTemplate>
                        <Button Image="rubbish_bin" BackgroundColor="Transparent" Command="{Binding Path=DeleteCommand, Source={x:Reference PiggingListView}}" CommandParameter="{Binding .}" BorderWidth="0" HeightRequest="25" WidthRequest="25" HorizontalOptions="Center" VerticalOptions="Center"/>
                    </DataTemplate>
                </telerikDataGrid:DataGridTemplateColumn.CellContentTemplate>
            </telerikDataGrid:DataGridTemplateColumn>
        </telerikDataGrid:RadDataGrid.Columns>
    </telerikDataGrid:RadDataGrid>

3 Answers, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 13 Jul 2018, 02:04 PM
Hi Chris,

Thank you for the provided XAML.

I have created an example based on it to test the issue you have reported but on my side it works fine.
Please take a look at the provided project and may I ask you to modify it according your setup? This way we could investigate the exact setup and advise you further.
You could open a private support ticket and attach it there as only image attachments are allowed in the forums.

Thank you in advance for your cooperation.

Regards,
Didi
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
0
eSimSE
Top achievements
Rank 1
answered on 13 Jul 2018, 07:08 PM

Hello Chris, 

it's only happened in iOS, I ran you project and that problem also occurred, but it work fine in Android. 

When you hold the button a little long, the button gray out and does nothing, then if you hit it again it run the code in side.

And also if you click it fast enough, it runs. But if you click second time, it's not respond. 

0
Didi
Telerik team
answered on 17 Jul 2018, 02:34 PM
Hi Chris,

We needed some time to research the described scenario in details when Button is put inside the CellContentTemplate. Indeed, the issue is reproduced on iOS platform only. I am afraid at this point there is no suitable workaround I could suggest. Since this is a critical issue, we will do our best to provide a potential fix with some of the upcoming minor releases.

I have logged this in our Feedback Portal and you can follow the item on the provided link below:
https://feedback.telerik.com/Project/168/Feedback/Details/252313-datagrid-ios-button-can-not-be-clicked-when-put-inside-a-cellcontenttemplate

I have also updated your Telerik points for reporting this to us.

Regards,
Didi
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
DataGrid
Asked by
eSimSE
Top achievements
Rank 1
Answers by
Didi
Telerik team
eSimSE
Top achievements
Rank 1
Share this question
or