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
close icon

Refresh column size

    I have this SfDatagrid:
    <syncfusion:SfDataGrid x:Name="grid"
                            AllowGrouping="False"
                            AllowDraggingColumns="False"
                            AllowResizingColumns="True"
                            AutoGenerateColumns="False"
                            SelectionMode="Single"
                            AllowSorting="True"
                            AllowFiltering="True"
                            NavigationMode="Row"
                            Style="{StaticResource EddyfiBaseSfDataGridStyle}"
                            ItemsSource="{Binding Path=Messages}">
      
      <syncfusion:SfDataGrid.Columns>
        <syncfusion:GridTemplateColumn MappingName="Type" HeaderText="" ColumnSizer="SizeToHeader" x:Name="ColumnType" 
                                       AllowSorting="True" AllowFiltering="True" AllowEditing="False" AllowResizing="False" >
          <syncfusion:GridTemplateColumn.CellTemplate>
            <DataTemplate>
              <eddyfi:MultiSizeImage Source="{Binding Path=Type, Converter={StaticResource MessageTypeToImageConverter}}" />
            </DataTemplate>
          </syncfusion:GridTemplateColumn.CellTemplate>
        </syncfusion:GridTemplateColumn>
        
        <syncfusion:GridTextColumn MappingName="Number" HeaderText="" ColumnSizer="Auto"
                                   AllowSorting="True" AllowFiltering="False" AllowEditing="False" AllowResizing="True"  />
        
        <syncfusion:GridTextColumn MappingName="DateTime" HeaderText="Date/Time" ColumnSizer="Auto"
                                   AllowSorting="True" AllowFiltering="False" AllowEditing="False" AllowResizing="True" />
        
        <syncfusion:GridTextColumn MappingName="Message" HeaderText="Message" ColumnSizer="Star"
                                   AllowSorting="True" AllowFiltering="False" AllowEditing="False" AllowResizing="True" />
        <syncfusion:GridTextColumn MappingName="Source" HeaderText="Source" ColumnSizer="Auto" x:Name="ColumnSource" 
                                   AllowSorting="True" AllowFiltering="True" AllowEditing="False" AllowResizing="True" />
      </syncfusion:SfDataGrid.Columns>
    </syncfusion:SfDataGrid>
  </DockPanel>
</UserControl>

The control behaves correctly except when the number of rows creates a vertical scroll bar. The vertical scrollbar reduces the space available for the columns and, because of that, it created a horizontal scrollbar. Is there a way to "refresh" the column size in order to avoid the horizontal scrollbar from appearing?


3 Replies

AN Ashok N Syncfusion Team November 26, 2014 11:14 AM UTC

Hi Charles,

 

Thank you for contacting Syncfusion Support.

We have tested the reported issue with our sample. But, we are unable to reproduce the issue. So could you please share the details like what are all the styles you are using to SfDataGrid? and please modify the sample based on your application along with the replication procedure? This would be helpful for further analysis. Please find the sample from the below attachment


Please let us know if you require further assistance.

Thanks,

Ashok


Attachment: ScrollBar_WPF_4384ee7d.zip


CR Charles Ricard November 26, 2014 03:35 PM UTC

The problem occurs when I am in touch mode (EnableTouch="True") and when items are added. I'll investigate some more in the next week. 

BTW, where do I put :

<syncfusion:IntegerTextBox

         syncfusion:SkinStorage.EnableTouch="True" >

</syncfusion:IntegerTextBox >

In order to activate the touchmode?



AN Ashok N Syncfusion Team November 27, 2014 05:23 PM UTC

Hi Charles,

We are sorry about the inconvenience caused.

We have analyzed your query but we are unable to understand your query clearly. So could you please share the details like, where you are enable the touch mode? within IntegerTextBox Or SfDataGrid? otherwise please modify our previously updated sample based on your application along with the replication procedure? This would be helpful for us to provide the exact solution to you.

Please let us know if you require further assistance.

Thanks,

Ashok


Loader.
Live Chat Icon For mobile
Up arrow icon