Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
785
TemplateColumn minimum size override
posted

Hi,

   I'm using a XamWebGrid and I have several columns that just contain a small icon button. I noticed that the TemplateColumn that I use doesn't size itself to the button but is slightly bigger and cannot be made smaller even when I set "Width=" on the TemplateColumn definition.

   Is there such a minimum width limit on the TemplateColumn? Can it be overriden? I'd like my column to be about 16 in width (I disabled the sorting and overrode the Style to make the sort indicator invisible already).

 

Cheers.

Parents
  • 40030
    Verified Answer
    Offline posted

    Hi, 

    You can set the Column's width to Auto, or if you have set size, you can just set it to 16.  

    For sorting, you can set IsSortable = false. 

    If you want no padding around the button, you can modify the cell style for that column, and set the padding to 0. 

    Also there is a MinimumWidth property on the Column that can be set. 

    <Style TargetType="igGrid:CellControl" x:key="cS">

    <Setter Property="Padding" Value="0"/>

    </Style>

    <TemplateColumn IsSortable="False" CellStyle="{StaticResource cS}" Width="Auto"  MinimumWidth  ="16"/>

    Hope this helps,

    -SteveZ

Reply Children
No Data