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

Resize GridDataControl (according to row number)

Thread ID:





112278 Sep 16,2013 04:02 PM UTC Nov 18,2014 05:31 AM UTC WPF 1
Tags: GridControl
Laura Frentescu
Asked On September 16, 2013 04:02 PM UTC

Hi ,

I am using a GridDataControl to be displayed inside a popup.
First time when this is displayed it has some rows, if second time there are more rows some scroll appears, if they are less rows then empty space is there.
How to resize the height of the control seeing the fact the the row number depends on the user interactions ?


Farjana Parveen Ayubb [Syncfusion]
Replied On November 18, 2014 05:31 AM UTC

Hi Laura,


Sorry about the delay caused.

We have analyzed your query. You can achieve your requirement by setting the Height and Width of the Popup as Auto. At the time of loading, the height and width of the popup will be set based on the Grid height and width. If you add/ remove records at run time, you need to use InvalidateMeasure method to adjust the popup width and height based on grid.


Please refer the below code snippet and sample in the following location:​

Code Snippet (XAML):

<Popup  Name="popup" Margin="10,10,0,13" Width="Auto" Height="Auto"  IsOpen="False" HorizontalAlignment="Left" Grid.Row="0" VerticalAlignment="Top">

Code Snippet (C#):

   private void Button_Click_2(object sender, RoutedEventArgs e)



            this.popup.IsOpen = false;



Farjana Parveen A

Attachment: Popup_Sample_2a91e95a.zip


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