Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
165
How to style a Record's FixedLocation
posted

I see from the Infragistics documentation on a Record's FixedLocation that I can set a particular row's fixed location, but I can find a way to set this using a style.  In a test project I tried the below, but it didn't work since the compiler won't let me set a property inside the Record object of the DataRecordPresenter.  Error it gives me is:

"Cannot resolve the Style Property 'FixedLocation'.  Verify that the owning type is the Style's TargetType, or use Class.Property syntax to specify the Property.

<Style TargetType="{x:Type DataPresenter:DataRecordPresenter}">
<Style.Triggers>
     <DataTrigger Binding="{Binding Path=DataItem.State}" Value="OR">
         <Setter Property="Record.FixedLocation" Value="FixedToTop" />
        </DataTrigger>
    </Style.Triggers>
</Style>

 

Parents
  • 69686
    posted

    Hello,

    FixedLocation is a property of the Record and not the DataRecordPresenter.

    You could handle the initialize record event of the XamDataGrid and fix the record from there:

    private void XamDataGrid_InitializeRecord(object sender, Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs e)

            {

                if (e.Record is DataRecord)

                {

                    if((e.Record as DataRecord).Cells[0].Value.ToString() == "or")

                    {

                        e.Record.DataPresenter.ExecuteCommand(DataPresenterCommands.FixRecordTop, e.Record);

                    }

                }

            }

Reply Children