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. Image for the cookie policy date

Resize GridDataControl (according to row number)

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 ?


1 Reply

FP Farjana Parveen Ayubb Syncfusion Team 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

Live Chat Icon For mobile
Up arrow icon