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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Error because of GridTemplateColumn

Thread ID:

Created:

Updated:

Platform:

Replies:

112542 Sep 27,2013 07:17 AM Sep 30,2013 07:06 AM WinRT 1
loading
Tags: SfDataGrid
Khurram Bhatti
Asked On September 27, 2013 07:17 AM

I have a Win RT syncfusion Grid, which is having GridTemplateColumn and its CellTemplate  contain the button. but when ever I  click on header to sort it throw the error.

Note: Following is the code i am using for the cancel button column and the issue came just after adding this column.


Please suggest me the way to solve this.





<Grid1:GridTemplateColumn Width="120"  HeaderText="Action" TextAlignment="Left" HorizontalHeaderContentAlignment="Left" AllowSorting="False">
                                <Grid1:GridTemplateColumn.HeaderStyle>
                                    <Style TargetType="Grid1:GridHeaderCellControl">
                                        <Setter Property="Background" Value="#1F6996" />
                                    </Style>
                                </Grid1:GridTemplateColumn.HeaderStyle>
                                <Grid1:GridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <Button Width="120" HorizontalAlignment="Left" Margin="-15,-2"
                                    Height="45" BorderBrush="Black" BorderThickness="1" Background="#3E61B9" Foreground="White"
                                    Command="{Binding Path=CancelCommand}"
                                     CommandParameter="{Binding AppointmentID}" 
                                    Content="Cancel" Click="Button_Tapped" />
                                    </DataTemplate>
                                </Grid1:GridTemplateColumn.CellTemplate>
                            </Grid1:GridTemplateColumn>


Jai Ganesh S [Syncfusion]
Replied On September 30, 2013 07:06 AM

Hi Khurram,

 

Thanks for contacting Syncfusion support.

 

We have analyzed your query. You must define the MappingName for the GridTemplateColumn to perform the Sorting, Grouping and Filtering operations. If your application doesn’t have any bounded property to define the MappingName for the GridTemplateColumn then you can use GridUnBoundColumn instead of GridTemplateColumn to achieve your requirement. For GridUnBoundColumn you can define any string value as MappingName.  Following code snippet to illustrate how to use the GridUnboundColumn,

 

Code snippet[Xaml]:

 

<syncfusion:GridUnBoundColumn AllowSorting="True" HeaderText="Action" MappingName="Property">

                        <syncfusion:GridUnBoundColumn.CellTemplate>

                            <DataTemplate>

                                <Button Width="120"

                                    Height="45"

                                    HorizontalAlignment="Left"

                                    Background="#3E61B9"

                                    BorderBrush="Black"

                                    BorderThickness="1"

                                    Command="{Binding Path=CancelCommand}"

                                    CommandParameter="{Binding EmployeeCountry}"

                                    Content="Cancel"

                                    Foreground="White" />

                            </DataTemplate>

                        </syncfusion:GridUnBoundColumn.CellTemplate>

                    </syncfusion:GridUnBoundColumn>

 

Please let us know if you need further assistance.

 

Thank you,

Jai Ganesh S


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

;