I want to freeze a table's header. The table class is derived from XamDataPresenter. How to implement freeze ?
We find the problem, which is binding. If I use direct binding like below, Then it is working
<igcontrols:UnboundField Name="Zone Name" x:Name="tEST" BindingPath="Zone.ZnChanCfgZoneZoneName_A9724" BindingMode="OneWay" Visibility="{Binding Source={StaticResource GetFeatureNode}, Path=Zone.ZnChanCfgZoneZoneName_A9724_Visible, Converter={StaticResource BooleanToVisibility}}">
But if I use CellValuePresenterStyle like below, It is not working
<igcontrols:UnboundField Name="Zone Name" x:Name="tEST" BindingPath="Zone" BindingMode="OneWay" Visibility="{Binding Source={StaticResource GetFeatureNode}, Path=Zone.ZnChanCfgZoneZoneName_A9724_Visible, Converter={StaticResource BooleanToVisibility}}"> <igcontrols:Field.Settings> <igcontrols:FieldSettings CellValuePresenterStyle="{StaticResource ZnChanCfgZoneZoneName_A9724CellStyle}"/> </igcontrols:Field.Settings> </igcontrols:UnboundField>
--- Inside page resources---
<Style TargetType="{x:Type igcontrols:CellValuePresenter}" x:Key="ZnChanCfgZoneZoneName_A9724CellStyle"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igcontrols:CellValuePresenter}"> <AcpUINS:AcpTextBox Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Value).ZnChanCfgZoneZoneName_A9724Value, Mode=TwoWay}" MyExpander="{Binding ElementName=ExpanderZoneChannelAssignmentZone}" MyBLObject="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Value).ZnChanCfgZoneZoneName_A9724, Mode=OneWay}" IsAcpValid="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Value).ZnChanCfgZoneZoneName_A9724_Valid, Mode=TwoWay}" GotFocus="OnFieldNameDoubleClick"> <AcpUINS:AcpTextBox.IsAcpEditable> <MultiBinding Converter="{StaticResource editabilityConverter}" Mode="OneWay"> <Binding Source="{x:Static AcpCommonLibNS:AppInfoManager.AppInfoHelper}" Path="AppMode"/> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(Value).ZnChanCfgZoneZoneName_A9724_Editable"/> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(Value).ZnChanCfgZoneZoneName_A9724"/> </MultiBinding> </AcpUINS:AcpTextBox.IsAcpEditable> <AcpUINS:AcpTextBox.IsAcpApplicable> <MultiBinding Converter="{StaticResource CellVisibilityStatus}"> <MultiBinding.Bindings> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(Value).ZnChanCfgZoneZoneName_A9724_Visible"/> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(Value).ZnChanCfgZoneZoneName_A9724_Applicable"/> </MultiBinding.Bindings> </MultiBinding> </AcpUINS:AcpTextBox.IsAcpApplicable> </AcpUINS:AcpTextBox> </ControlTemplate> </Setter.Value> </Setter> </Style>
Plaese let me know how to fix sorting and grouping in the above example
As far as I can see, this is a custom/user control inside the cell. You might want to take a look at this blog post by Andrew Smith on how to host elements in the cells of the XamDataGrid:
http://blogs.infragistics.com/blogs/andrew_smith/archive/2009/03/27/hosting-wpf-controls-in-a-xamdatagrid-cell.aspx
Here is the control template. Please somebody answer how fix "In Xamdatapresenter sorting and grouping is not working"
<Style TargetType="{x:Type igcontrols:CellValuePresenter}" x:Key="ZnChanCfgChannelsTopDisplayChannel_A19774CellStyle"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igcontrols:CellValuePresenter}"> <AcpUINS:AcpTextBox Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Value).ZnChanCfgChannelsTopDisplayChannel_A19774Value, Mode=TwoWay}"
MyExpander="{Binding ElementName=ExpanderZoneChannelAssignmentChannels}" MyBLObject="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Value).ZnChanCfgChannelsTopDisplayChannel_A19774, Mode=OneWay}" IsAcpValid="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Value).ZnChanCfgChannelsTopDisplayChannel_A19774_Valid, Mode=TwoWay}" GotFocus="OnFieldNameDoubleClick" > <AcpUINS:AcpTextBox.IsAcpEditable> <MultiBinding Converter="{StaticResource editabilityConverter}" Mode="OneWay"> <Binding Source="{x:Static AcpCommonLibNS:AppInfoManager.AppInfoHelper}" Path="AppMode"/> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(Value).ZnChanCfgChannelsTopDisplayChannel_A19774_Editable"/> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(Value).ZnChanCfgChannelsTopDisplayChannel_A19774"/> </MultiBinding> </AcpUINS:AcpTextBox.IsAcpEditable> <AcpUINS:AcpTextBox.IsAcpApplicable> <MultiBinding Converter="{StaticResource CellVisibilityStatus}"> <MultiBinding.Bindings> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(Value).ZnChanCfgChannelsTopDisplayChannel_A19774_Visible"/> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(Value).ZnChanCfgChannelsTopDisplayChannel_A19774_Applicable"/> </MultiBinding.Bindings> </MultiBinding> </AcpUINS:AcpTextBox.IsAcpApplicable> </AcpUINS:AcpTextBox> </ControlTemplate> </Setter.Value> </Setter> </Style> <!-- Autogen code for 35402--> <Style TargetType="{x:Type igcontrols:CellValuePresenter}" x:Key="ZnChanCfgChannelsChannelType_A22241CellStyle"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igcontrols:CellValuePresenter}"> <AcpUINS:AcpComboBox ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Value).ZnChanCfgChannelsChannelType_A22241.Items, Mode=OneWay}" DisplayMemberPath="ItemName" SelectedValuePath="ItemName" SelectedValue="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Value).ZnChanCfgChannelsChannelType_A22241_UIValue, Mode=TwoWay}" MyExpander="{Binding ElementName=ExpanderZoneChannelAssignmentChannels}" MyBLObject="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Value).ZnChanCfgChannelsChannelType_A22241, Mode=OneWay}" IsAcpValid="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Value).ZnChanCfgChannelsChannelType_A22241_Valid, Mode=TwoWay}" GotFocus="OnFieldNameDoubleClick" > <AcpUINS:AcpComboBox.IsAcpEditable> <MultiBinding Converter="{StaticResource editabilityConverter}" Mode="OneWay"> <Binding Source="{x:Static AcpCommonLibNS:AppInfoManager.AppInfoHelper}" Path="AppMode"/> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(Value).ZnChanCfgChannelsChannelType_A22241_Editable"/> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(Value).ZnChanCfgChannelsChannelType_A22241"/> </MultiBinding> </AcpUINS:AcpComboBox.IsAcpEditable> <AcpUINS:AcpComboBox.IsAcpApplicable> <MultiBinding Converter="{StaticResource CellVisibilityStatus}"> <MultiBinding.Bindings> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(Value).ZnChanCfgChannelsChannelType_A22241_Visible"/> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="(Value).ZnChanCfgChannelsChannelType_A22241_Applicable"/> </MultiBinding.Bindings> </MultiBinding> </AcpUINS:AcpComboBox.IsAcpApplicable> </AcpUINS:AcpComboBox> </ControlTemplate> </Setter.Value> </Setter> </Style>
I am not completely sure where the problem might be coming from. One place that I would look is inside the ControlTemplate and check if is correctly defined. If the sorting and grouping does not work only with the custom control template, please give us the style for the CellValuePresenter so that we can look into it.
Sorry, I clicked several times post button.