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

Grid Height extends Past Size of Rows

I want to add a border to my datagrid, but when I add BorderThickness="1,1,0,0"  for some reason the left-side border extends below my last row.  Can I tell the grid to be only as tall as my rows somehow?

I modified one of your samples to illustrate and also have added a screenshot to the zip.

Attachment: SfDataGrid_322467e7.zip

1 Reply

JG Jai Ganesh S Syncfusion Team June 22, 2016 01:54 PM UTC

Hi Deanna, 
 
You can achieve your requirement by setting the VerticalAlignment= Top in Grid like below, 
 
<syncfusion:SfDataGrid x:Name="sfgrid" 
                               AllowFiltering="True" 
                               AllowGrouping="False" 
                               AllowResizingColumns="True" 
                               AutoGenerateColumns="True" 
                               ColumnSizer="Star" VerticalAlignment="Top" 
                               ItemsSource="{Binding MyProperty, 
                                                     Mode=TwoWay}" 
                               ShowGroupDropArea="True" BorderThickness="1,1,0,0" SelectionMode="None" Margin="30,0" RowHeight="30"> 
             
 </syncfusion:SfDataGrid> 
 
 
 
Regards, 
Jai Ganesh S 


Loader.
Up arrow icon