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.
Thanks, the MinimumWidth was the property I was after. I didn't notice it :(
The grid is working as I want it now.
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