I want to freeze a table's header. The table class is derived from XamDataPresenter. How to implement freeze ?
Fixed Fields (aka Frozen Column Headers) will be built in by default in the next release of NetAdvantage for WPF (~Early April).
Kind Regards,
Andrew M. FlickProduct Manager, Windows ClientInfragistics
Thanks for your information!
- Daniel
Hello Bharathi,
Please give us little bit more information on what you are trying to freeze. Do you want to freeze the field label or the header of the ExpandableFieldRecord? Maybe a screenshot would help understand what your requirement is.
Thanks.
Hi Alex
Thanks for the quick reply.
I wanted to freeze field lable so that I can see, headers all the time when I scroll.
For some reason Grouping and sorting is not working If I have textbox to display field value.
Can you please tell me how to Fix this? Please see the screenshot
If I see data records in OnRecordsInViewChanged event while debugging it added only one group instead of adding several. Please see the screen shot
Regarding RecordsInViewChanged event, it will fire for each record which is being scrolled into/out of view.
Regarding the TextBox, this would be because of the ControlTemplate. The CellValuePresenter contains PART elements, which name is important. You can see the default templates in the DefaultStyles directory and see the full template and retemplate it accordingly.
I am still not sure about the headers. By default, they are always on top at all times.
Alex, You are right about the freezing headers in 9.2v. It works fine to me after upgrading to 9.2.
My biggest problem is grouping and sorting is not working in the following code. Can you please help me to fix this?
<AcpUINS:AcpXamDataPresenter KeyboardNavigation.TabNavigation="Continue" KeyboardNavigation.AcceptsReturn="True" Grid.Row="1" x:Name="ZoneChannelAssignmentList"> <AcpUINS:AcpXamDataPresenter.IsAcpVisible> <MultiBinding Converter="{StaticResource acpXamDataPresenterVisibilityConverter}" Mode="OneWay"> <Binding Source="{x:Static AcpCommonLibNS:AppInfoManager.AppInfoHelper}" Path="AppMode" /> <Binding Source="{x:Static AcpCommonLibNS:AppInfoManager.AppInfoHelper}" Path="AppHideMatches" /> <Binding Source="{StaticResource GetParentFeature}" Path="_HasDiffs"/> <Binding RelativeSource="{RelativeSource Self}" Path="IsAcpVisible"/> <Binding RelativeSource="{RelativeSource Self}" Path="FieldLayouts[0].Fields[0].Visibility"/> </MultiBinding> </AcpUINS:AcpXamDataPresenter.IsAcpVisible> <AcpUINS:AcpXamDataPresenter.FieldLayoutSettings> <igcontrols:FieldLayoutSettings AutoGenerateFields="false"/> </AcpUINS:AcpXamDataPresenter.FieldLayoutSettings> <AcpUINS:AcpXamDataPresenter.FieldLayouts> <igcontrols:FieldLayout> <igcontrols:FieldLayout.Fields> <igcontrols:UnboundField Name="Fly In"> <igcontrols:UnboundField.Settings> <igcontrols:FieldSettings CellValuePresenterStyle="{StaticResource myZoneChannelAssignmentListStyle}" /> </igcontrols:UnboundField.Settings> <igcontrols:UnboundField.Visibility> <MultiBinding Converter="{StaticResource flyInVisibilityConverter}" Mode="OneWay"> <Binding Source="{StaticResource GetFeatureNode}" Path="Zone.ZnChanCfgZoneZoneName_A9724_Visible" /> <Binding Source="{StaticResource GetFeatureNode}" Path="Zone.ZnChanCfgZoneTopDisplayZone_A19772_Visible" /> <Binding Source="{StaticResource GetFeatureNode}" Path="Zone.ZoneVoiceAnnouncementID_A21514_Visible" /> <Binding Source="{StaticResource GetFeatureNode}" Path="FPPProtection.ZnChanCfgFPPProtectionProtectedZone_A8765_Visible" /> <Binding Source="{StaticResource GetFeatureNode}" Path="FPPProtection.ZnChanCfgFPPProtectionFPPEnable_A19562_Visible" /> </MultiBinding> </igcontrols:UnboundField.Visibility> </igcontrols:UnboundField> <igcontrols:UnboundField Name="Position" Label="Position" BindingPath="Zone" BindingMode="OneWay" DataType="{x:Type AcpBLNS:FeatureSection}" > <igcontrols:UnboundField.Settings> <igcontrols:FieldSettings CellValuePresenterStyle="{StaticResource PositionStyle}"/> </igcontrols:UnboundField.Settings> </igcontrols:UnboundField> <!-- Zone Name --> <igcontrols:UnboundField Name="Zone Name" 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> <!-- Top Display Zone --> <igcontrols:UnboundField Name="Top Display Zone" BindingPath="Zone" BindingMode="OneWay" Visibility="{Binding Source={StaticResource GetFeatureNode}, Path=Zone.ZnChanCfgZoneTopDisplayZone_A19772_Visible, Converter={StaticResource BooleanToVisibility}}"> <igcontrols:Field.Settings> <igcontrols:FieldSettings CellValuePresenterStyle="{StaticResource ZnChanCfgZoneTopDisplayZone_A19772CellStyle}"/> </igcontrols:Field.Settings> </igcontrols:UnboundField> <!-- Zone Announcement --> <igcontrols:UnboundField Name="Zone Announcement" BindingPath="Zone" BindingMode="OneWay" Visibility="{Binding Source={StaticResource GetFeatureNode}, Path=Zone.ZoneVoiceAnnouncementID_A21514_Visible, Converter={StaticResource BooleanToVisibility}}"> <igcontrols:Field.Settings> <igcontrols:FieldSettings CellValuePresenterStyle="{StaticResource ZoneVoiceAnnouncementID_A21514CellStyle}"/> </igcontrols:Field.Settings> </igcontrols:UnboundField> <!-- Protected Zone --> <igcontrols:UnboundField Name="Protected Zone" BindingPath="FPPProtection" BindingMode="OneWay" Visibility="{Binding Source={StaticResource GetFeatureNode}, Path=FPPProtection.ZnChanCfgFPPProtectionProtectedZone_A8765_Visible, Converter={StaticResource BooleanToVisibility}}"> <igcontrols:Field.Settings> <igcontrols:FieldSettings CellValuePresenterStyle="{StaticResource ZnChanCfgFPPProtectionProtectedZone_A8765CellStyle}"/> </igcontrols:Field.Settings> </igcontrols:UnboundField> <!-- FPP Enable --> <igcontrols:UnboundField Name="FPP Enable" BindingPath="FPPProtection" BindingMode="OneWay" Visibility="{Binding Source={StaticResource GetFeatureNode}, Path=FPPProtection.ZnChanCfgFPPProtectionFPPEnable_A19562_Visible, Converter={StaticResource BooleanToVisibility}}"> <igcontrols:Field.Settings> <igcontrols:FieldSettings CellValuePresenterStyle="{StaticResource ZnChanCfgFPPProtectionFPPEnable_A19562CellStyle}"/> </igcontrols:Field.Settings> </igcontrols:UnboundField> </igcontrols:FieldLayout.Fields> </igcontrols:FieldLayout> </AcpUINS:AcpXamDataPresenter.FieldLayouts> </AcpUINS:AcpXamDataPresenter>
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.