We have recently upgraded from v11.1 to v12.1 and SL4 to SL5. After performing this upgrade, we encountered some severe breaking issues with TemplateColumns that are likely to force us to rollback, but wanted to check to see if these are known issues or if there are workaround before we rollback.
The first issue that we have is that in 11.1, we did not have to specify an EditorTemplate; it appears that the grid picked up the EditorTemplate from the ItemTemplate.
The second issue is that we have implemented a checkbox column in order to address the issue where the user has to click twice in order to check the checkbox, but some change between 11 and 12 seems to have broken this functionality. This is a huge productivity issue for our users and is critical to the adoption and use of our application.
There are other issues, but I think once these are addressed, the others will fall into line.
Here is the definition of the template column that we are trying to use:
<ig:TemplateColumn Key="IsSelected" HeaderText=" " HorizontalContentAlignment="Center" HeaderTextHorizontalAlignment="Center" IsFilterable="False" Width="24" IsSortable="False"> <!-- This is needed to prevent the checkbox from showing in the filter row --> <ig:TemplateColumn.FilterItemTemplate> <DataTemplate> <TextBlock /> </DataTemplate> </ig:TemplateColumn.FilterItemTemplate> <!-- Remove the padding from the cell contents so that the checkbox is fully displayed --> <ig:TemplateColumn.CellStyle> <Style TargetType="ig:CellControl"> <Setter Property="Padding" Value="0"/> </Style> </ig:TemplateColumn.CellStyle> <ig:TemplateColumn.ItemTemplate> <DataTemplate> <CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" /> </DataTemplate> </ig:TemplateColumn.ItemTemplate> <!-- Add a handler to check and uncheck all rows when the checkbox in the header is changed --> <ig:TemplateColumn.HeaderTemplate> <DataTemplate> <CheckBox Checked="HeaderCheckBox_Checked" Unchecked="HeaderCheckBox_Unchecked" /> </DataTemplate> </ig:TemplateColumn.HeaderTemplate></ig:TemplateColumn>
What if it is Hyper Link Instead of Check Box...I need to Add filter for that Hyperlink... <ig:TemplateColumn Key="ItemNumber" Width="100"> <ig:TemplateColumn.HeaderTemplate> <DataTemplate> <TextBlock Text="Project No" FontWeight="Bold"/> </DataTemplate> </ig:TemplateColumn.HeaderTemplate> <ig:TemplateColumn.FilterItemTemplate> <DataTemplate> <TextBlock Text="{Binding ItemNumber}" /> </DataTemplate> </ig:TemplateColumn.FilterItemTemplate> <ig:TemplateColumn.EditorTemplate> <DataTemplate> <TextBox x:Name="xMyname" Background="#FFFFE17F" Foreground="OrangeRed" Text="{Binding Value, Mode=TwoWay}"/> </DataTemplate> </ig:TemplateColumn.EditorTemplate> <ig:TemplateColumn.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding ItemNumber}" Cursor="Hand" TextDecorations="Underline" MouseLeftButtonDown="TextBlock_MouseLeftButtonDown" > </TextBlock> </DataTemplate> </ig:TemplateColumn.ItemTemplate> </ig:TemplateColumn >
Filter is not working instantly....After Enter Text in Text Box and Pressing Enter Instantiate search.
So on the TemplateColumn's Editor template issue - before 12.1 release the behavior is - When there is no EditorTemplate specified the cell cannot enter edit mode and suppose that's why you though that the EditorTemplate was picked up from the ItemTemplate. In 12.1 the support for implicit DataTemplates was introduced and the behavior has been changed a little - now if there is no editor template provided it uses ContentPresenter as an editor.
To achieve the behavior prior to 12.1 you need to set the column's IsReadOnly to true.
HTH,
Hi,
I'll run a few tests on the matter of template column resolving the editor template - I suppose it has something to do with the Implicit DataTemplate Support that has been added in 12.1 release.
About your second question - I am not sure what exactly is the problem with your custom column, however if you did it only to workaround the issue that you need to enter edit mode for the cell first in order to interact with the editor I would recommend using a standard CheckBoxColumn. In 11.2 release we added a feature for few of the xamGrid's columns that main purpose were exactly your case. For columns with editors:
These columns contain a property called EditorDisplayBehaviour you could set to Always - this allows you to interact immediately with the editor in the cell. Check out detailed help page.
Regards,