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
90
XamWebGrid Column Header Freezes Browser on Click
posted

Hi

My problem is simple and easy to repeat.  Whenever I click on a column header in my XamWebGrid control the application/silverlight/browser goes into an infinite loop and must be killed.  Everything else in the grid works fine, I can click my checkbox and they update the view model they are bound to.  I am not sure what is causing this so I have included all the relevant details below.

I have the following XamWebGrid template for which I am dynamically generating the columns based on other controls selected else where.

<infragistics_DG:XamWebGrid x:Name="ContentGrid"

                            AutoGenerateColumns="False"

                            Margin="{TemplateBinding Margin}"

                            MaxDepth="3"

                             DeleteKeyAction="None">                       

    <infragistics_DG:XamWebGrid.ColumnMovingSettings>

        <infragistics_DG:ColumnMovingSettings AllowColumnMoving="Disabled"/>

     </infragistics_DG:XamWebGrid.ColumnMovingSettings>

     <infragistics_DG:XamWebGrid.FilteringSettings>

         <infragistics_DG:FilteringSettings AllowFilterRow="None"/>

     </infragistics_DG:XamWebGrid.FilteringSettings>

     <infragistics_DG:XamWebGrid.ExpansionIndicatorSettings>

         <infragistics_DG:ExpansionIndicatorSettings>

             <infragistics_DG:ExpansionIndicatorSettings.Style>

                 <Style TargetType="igPrim:ExpansionIndicatorCellControl">

                     <Setter Property="Background" Value="Transparent"/>

                 </Style>

             </infragistics_DG:ExpansionIndicatorSettings.Style>

         </infragistics_DG:ExpansionIndicatorSettings>

    </infragistics_DG:XamWebGrid.ExpansionIndicatorSettings>

    <infragistics_DG:XamWebGrid.RowSelectorSettings>

        <infragistics_DG:RowSelectorSettings Visibility="Collapsed" EnableRowNumbering="False"/>

    </infragistics_DG:XamWebGrid.RowSelectorSettings>

    <infragistics_DG:XamWebGrid.AddNewRowSettings>

        <infragistics_DG:AddNewRowSettings AllowAddNewRow="None"/>

    </infragistics_DG:XamWebGrid.AddNewRowSettings>

    <infragistics_DG:XamWebGrid.EditingSettings>

        <infragistics_DG:EditingSettings AllowEditing="None" />

    </infragistics_DG:XamWebGrid.EditingSettings>

</infragistics_DG:XamWebGrid>

  the code for generating the columns is,

ColumnBaseCollection columns = grid.Columns;

columns.Clear();

 

var branchNameCol = new TextColumn();

branchNameCol.Key = "TradingBranchLegalEntityAgreement.LegalEntity.Name";

branchNameCol.HeaderText = "Branch Name";

columns.Add(branchNameCol);

 

var branchProductLookupConverter = new BranchProductDictionaryLookupConverter();

 

foreach (Product product in BranchProductTable.DisplayProducts)

{

    var productCol = new UnboundColumn();

    productCol.Key = product.Id;

    productCol.HeaderText = product.ShortName;

    productCol.ValueConverter = branchProductLookupConverter;

    productCol.ValueConverterParameter = product.Id;

    productCol.HorizontalContentAlignment = HorizontalAlignment.Center;

    productCol.HeaderStyle = new Style(typeof(HeaderCellControl));

    productCol.HeaderStyle.Setters.Add(new Setter(HorizontalContentAlignmentProperty, HorizontalAlignment.Center));

    productCol.HeaderTemplate = (DataTemplate)XamlReader.Load(

        string.Format(

                      @"<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'

                           xmlns:layout='clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit'>

                            <layout:LayoutTransformer>

                                <layout:LayoutTransformer.LayoutTransform>

                                    <RotateTransform Angle='-80'/>

                                </layout:LayoutTransformer.LayoutTransform>

                                <TextBlock Text='{0}'/>

                            </layout:LayoutTransformer>

                        </DataTemplate>",

                        product.ShortName.Replace("&", "&amp;")));

    productCol.ItemTemplate = (DataTemplate)XamlReader.Load(

                        @"<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'>

                            <CheckBox IsChecked='{Binding Value.IsSelected, Mode=TwoWay}'/>

                        </DataTemplate>");

    columns.Add(productCol);

}

 

Parents Reply Children
No Data