We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Swipe feature can not be use with Grid Template Column

Thread ID:

Created:

Updated:

Platform:

Replies:

123959 May 3,2016 10:28 AM UTC May 4,2016 07:27 PM UTC Xamarin.Forms 1
loading
Tags: SfDataGrid
Yim Suet Joe
Asked On May 3, 2016 10:28 AM UTC

Hi I`m currently facing a problem in using Grid Template Column together with Swipe feature, when I swipe the row it keep saying that "Exception has been thrown by the target of an invocation."

here is my code

<sfgrid:SfDataGrid x:Name="dataGrid"
                       AllowSwiping="True"
                       SwipeStarted="OnSwipeStart"
                       SwipeEnded="OnSwipeEnded"
                       Swiping="OnSwiping"
                       HeaderRowHeight="0"
                       AutoGenerateColumns="False"
                       ColumnSizer="Star"
                       ItemsSource="{Binding ItemsSource}">

      <sfgrid:SfDataGrid.Columns x:TypeArguments="syncfusion:Columns">

        <sfgrid:GridTemplateColumn HeaderText=""
                                   MappingName="PatientPic">
          <sfgrid:GridTemplateColumn.CellTemplate>
            <DataTemplate>
              <Grid>
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="Auto" />
                  <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Image Grid.Column="0"
                       Source="{Binding PatientPic, Converter={StaticResource Convert}}"/>
                <Label Grid.Column="1"
                       Text="{Binding QueueEntryDto.PatientName}" TextColor="Black"
                       XAlign="Center" YAlign="Center"/>
              </Grid>
            </DataTemplate>
          </sfgrid:GridTemplateColumn.CellTemplate>
        </sfgrid:GridTemplateColumn>
        <!--<sfgrid:GridTextColumn MappingName="Mrn" />
        <sfgrid:GridTextColumn MappingName="PatientName" />
        <sfgrid:GridTextColumn MappingName="VisitId" />-->
      </sfgrid:SfDataGrid.Columns>

      <!--Left Swipe Template-->
      <sfgrid:SfDataGrid.LeftSwipeTemplate>
        <DataTemplate>
          <Grid x:Name="leftSwipe"  BackgroundColor="#009EDA">
            <Grid.ColumnDefinitions>
              <ColumnDefinition/>
              <ColumnDefinition/>
            </Grid.ColumnDefinitions>

            <Label Grid.Column="1"
                   Text ="Call"
                   HorizontalTextAlignment="Start"
                   VerticalTextAlignment="Center"
                   LineBreakMode ="NoWrap"
                   BackgroundColor="Transparent"
                   TextColor ="White" >
              <Label.GestureRecognizers>
                <TapGestureRecognizer
                        Tapped="OnCallTapGestureRecognizerTapped"
                        NumberOfTapsRequired="1" />
              </Label.GestureRecognizers>
            </Label>

          </Grid>
        </DataTemplate>
      </sfgrid:SfDataGrid.LeftSwipeTemplate>

      <!--Right Swipe Template-->
      <sfgrid:SfDataGrid.RightSwipeTemplate>
        <DataTemplate>
          <Grid  BackgroundColor="#1AAA87">
            <Grid.ColumnDefinitions>
              <ColumnDefinition/>
              <ColumnDefinition/>
            </Grid.ColumnDefinitions>

            <Label FontSize="15"
                   Grid.Column="1"
                   HorizontalTextAlignment ="Center"
                   Text ="Attend"
                   TextColor ="White"
                   VerticalTextAlignment ="Center"
                   BackgroundColor="Transparent"
                   LineBreakMode ="HeadTruncation" >
            </Label>
          </Grid>
        </DataTemplate>

      </sfgrid:SfDataGrid.RightSwipeTemplate>

    </sfgrid:SfDataGrid>

Attachment: Views_16bf672f.rar

Vimal Prabhu Manohkaran [Syncfusion]
Replied On May 4, 2016 07:27 PM UTC

Hi Yim Suet Joe, 
 
Thank you for using Syncfusion Products. 
 
We were unable to reproduce the reported issue from our side. We have attached the working sample which we created based on your codes and a video reference of the sample. 
 
 
 
In case, if the issue still persists at your side, please do revert us with a modified sample to reproduce the issue with clear replication procedure. 
 
Regards, 
Vimal Prabhu

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;