I am having an issue with being able to use the built in sorting capability on columns in my grid which are templated. Columns which don't have a template are fine. In this example, I can sort on AccrualDate, but not on PO#. Any thoughts?
590 <igGrid:XamWebGrid.Columns>
591
592 <igGrid:TextColumn Key="AccrualDate"
593 Width="75"
594 HeaderText="Date"
595 ValueConverter="{StaticResource DateConverter}" />
596
597 <igGrid:TextColumn Key="Task.Task"
598 Width="55"
599 HeaderText="Task#" />
600
601 <igGrid:TemplateColumn Key="PO.POId"
602 Width="60"
603 HeaderText="PO#">
604 <igGrid:TemplateColumn.ItemTemplate>
605 <DataTemplate>
606 <TextBlock Text="{Binding PO.POId}"
607 ToolTipService.ToolTip="{Binding PO.Vendor.VendorName}" />
608 </DataTemplate>
609 </igGrid:TemplateColumn.ItemTemplate>
610 </igGrid:TemplateColumn>
Jason, we are finally in a position to attempt this upgrade again. While I agree that the HeaderTextHorizontalAlignment property will take care of the sorting, I like my solution better of applying a custom style to all of the grids in my application.
I guess we better get busy typing.
Hello Alan,
Do you have any further questions or concerns about this issue?
In 2010 Vol. 2 we introduced a new property on the Column object for alignment of the Headers:
<igGrid:TemplateColumn Key="PersonName.FirstName" HeaderTextHorizontalAlignment="Center"
We also downgraded this change to 2009 Vol. 2 and 2010 Vol. 1 with a service release due to the demand for this feature to be implemented. The recommended approach is to use this property rather than setting the alignment within a style.
Which corresponds to my line 193 above. I had to do a workaround to get this resolved by adding a property to all my grids. Probably 35+ in the app as a whole, so it was a whole lot of fun.
Thanks for following up.
I was able to reproduce your issue by applying a setter for the HorizontalContentAlignment property of the header. In build 2014 this works fine and once I upgrade to 2099 I see the same issue as you do.
I am going to create a private case for you so that I can log a development issue for you which can be used to track this issue further.
Please let me know if you have any further questions or concerns about this matter.