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

Image on column header

Thread ID:

Created:

Updated:

Platform:

Replies:

146844 Aug 22,2019 12:32 PM UTC Aug 26,2019 05:36 AM UTC Xamarin.Forms 3
loading
Tags: SfDataGrid
RAFAEL FELIPE SACOMANI
Asked On August 22, 2019 12:32 PM UTC

It´s possible add an image on header column in sfdatagrid in Xamarin forms?


Look the attachment for details

Balasubramani Sundaram [Syncfusion]
Replied On August 23, 2019 12:37 PM UTC

Hi Rafael,  
 
Thank you for contacting Syncfusion support. 
 
We could able to achieve you requirement of add an image in header column through “HeaderTemplate” support in “SfDataGrid” on each data column. However, we don’t have auto fit support for the data template, so you must set the “HeaderHeightRequest” based on the image height you define in application. 
 
Please refer the following sample and code snippet, 
 
Code Snippet [MainPage.xaml] 
 
<dataGrid:SfDataGrid 
     ...... 
     HeaderRowHeight="100" 
        > 
    <dataGrid:SfDataGrid.Columns x:TypeArguments="syncfusion:Columns"> 
        <dataGrid:GridTextColumn  MappingName="OrderID"  Padding="0,0,0,0"> 
            <dataGrid:GridTextColumn.HeaderTemplate> 
                <DataTemplate> 
                    <StackLayout> 
                        <Image x:Name="headerImage" Source="Right.jpg"  HeightRequest="100" WidthRequest="50"/> 
                    </StackLayout> 
                </DataTemplate> 
            </dataGrid:GridTextColumn.HeaderTemplate> 
        </dataGrid:GridTextColumn> 
        <dataGrid:GridTextColumn  MappingName="EmployeeID"/> 
        <dataGrid:GridTextColumn   MappingName="CustomerID"/> 
    </dataGrid:SfDataGrid.Columns> 
</dataGrid:SfDataGrid> 
 
 
 
We hope this helps. Please let us know, if need any further assistance. 
  
Regards,
Balasubramani Sundaram.
 


RAFAEL FELIPE SACOMANI
Replied On August 23, 2019 02:00 PM UTC

Thanks!! Solve my problem! <3

Farjana Parveen Ayubb [Syncfusion]
Replied On August 26, 2019 05:36 AM UTC

Hi Rafael, 
 
Thanks for the update. 
 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 
 
Regards, 
Farjana Parveen A  


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon