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

Hide default header but show stacked headers

Thread ID:

Created:

Updated:

Platform:

Replies:

149874 Dec 12,2019 01:17 PM UTC Dec 16,2019 12:45 PM UTC Xamarin.Forms 3
loading
Tags: SfDataGrid
Roland Kammerer
Asked On December 12, 2019 01:17 PM UTC

Hi,

I'm trying to dynamically create GridViews using the SfDataGrid component. Most of if works well beside one but essential issue:
I have dynamic table header templates (with colspan, header texts, etc.) coming from the DB. I managed to get this working with the Stacked Header feature. My problem now is that the default header row (showing the column binding variables -> data[0]...) is shown and I couldn't find a way to get rid of it. Setting rowheight=0 also removes the StackedHeaderRows.
Any advice on how to adjust this to my needs?

Many Thanks

Sample

Karthikraja Kalaimani [Syncfusion]
Replied On December 13, 2019 11:37 AM UTC

Hi Roland,

Thanks for contacting Syncfusion support.

Your requirement to hide the header row of SfDataGrid can be achieved by setting the header row height as 0 in SfDataGrid.QueryRowHeight event.

Please refer the below code example,


 
[MainPage.cs] 
…… 
private void Sfgrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e) 
        { 
            //sfgrd.GetHeaderIndex() will return index of the Header Row. 
            if (e.RowIndex == sfgrid.GetHeaderIndex()) 
            { 
                e.Height = 0; 
                e.Handled = true; 
            } 
        }
….
 
 

Sample link : https://www.syncfusion.com/downloads/support/directtrac/general/ze/DataGrid_Demo235139570.zip

We hope this helps, please let us know if need further assistance from us.

Regards, 
Karthik Raja 


Roland Kammerer
Replied On December 13, 2019 12:07 PM UTC

Hi,

Exactly what I was looking for.
Many thanks for the great support!

Regards,
Roland

Karthikraja Kalaimani [Syncfusion]
Replied On December 16, 2019 12:45 PM UTC

Hi Roland,
 
 
Thanks for update. We are happy that the mentioned issue has been resolved at your end.

Regards, 
Karthik Raja 


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