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
1455
xamGrid with outside filters does not change Groupby Numbers
posted

i have a grid which is being filer by a xammulticolumn out side of the grid with the exact code off your sample site 'Programmatically Create a Filter' .  The grid is grouped, when the filter is changed the group by numbers.  if you scroll out of view and come back in the numbers will change.  when you then clean the numbers will not go back.   please proivde a fix asap

 <ig:XamMultiColumnComboEditor AutoGenerateColumns="False"                                                       SelectionChanged="cboLE_SelectionChanged"                                                       Margin="10,5"                                                       Grid.Row="2"                                                       x:Name="cboLE"                                                       DisplayMemberPath="LEName">                             <ig:XamMultiColumnComboEditor.Columns>                                 <ig:TextComboColumn Key="LEID"                                                     Width="80"                                                     HeaderText="LEID" />                                 <ig:TextComboColumn Key="LEName"                                                     Width="*"                                                     HeaderText="Name" />                             </ig:XamMultiColumnComboEditor.Columns>                         </ig:XamMultiColumnComboEditor>

                        <ig:XamGrid x:Name="dgAll"                                     Loaded="dgAll_Loaded"                                     Margin="10,5"                                     Grid.Row="3"                                     HeaderVisibility="Collapsed"                                     AutoGenerateColumns="False"                                     ItemsSource="{Binding Path=Queue, Source={StaticResource myQ}}"                                     SelectedRowsCollectionChanged="XamGrid_SelectedRowsCollectionChanged">

                            <!--  Columns  -->                             <ig:XamGrid.Columns>

                                <ig:TextColumn Key="ActivityType"                                                IsGroupBy="True"                                                Visibility="Collapsed" />

                                <ig:TemplateColumn Key="LEID"                                                    Width="*">                                     <ig:TemplateColumn.ItemTemplate>                                         <DataTemplate>                                             <StackPanel>                                                 <StackPanel Orientation="Horizontal"                                                             Width="290">

                                                    <TextBlock FontFamily="{StaticResource AppHeaderFont}"                                                                FontSize="18"                                                                TextWrapping="Wrap"                                                                Text="{Binding Path=LEID}" />                                                     <!--LEID-->                                                     <TextBlock FontFamily="{StaticResource AppHeaderFont}"                                                                FontSize="18"                                                                Text=" - " />                                                     <TextBlock FontFamily="{StaticResource AppHeaderFont}"                                                                FontSize="18"                                                                Text="{Binding Path=ActivityID}" />

                                                </StackPanel>                                                 <TextBlock Text="{Binding Path=LegalEntity.LEName}" />                                                 <TextBlock Text="{Binding Path=AssocAuditAssign.DisplayName}" />                                                 <TextBlock Text="{Binding Path=QueueStatu.StatusDesc}"                                                            Foreground="{Binding Path=QueueStatu.StatusDesc, Converter={StaticResource myNumColorConverter}}"                                                            FontWeight="Bold" />                                                 <TextBlock Text="{Binding Path=ModifiedDate, StringFormat='MM/dd/yyyy'}" />

                                            </StackPanel>                                         </DataTemplate>                                     </ig:TemplateColumn.ItemTemplate>                                 </ig:TemplateColumn>                    

                            </ig:XamGrid.Columns>

                            <!--  Settings  -->                             <ig:XamGrid.SelectionSettings>                                 <ig:SelectionSettings CellClickAction="SelectRow"                                                       CellSelection="None"                                                       ColumnSelection="None"                                                       RowSelection="Single" />                             </ig:XamGrid.SelectionSettings>                         </ig:XamGrid>

 

-------------------------------------------

private void cboLE_SelectionChanged(object sender, Infragistics.Controls.Editors.SelectionChangedEventArgs e)         {             var cbo = sender as XamMultiColumnComboEditor;                         if (cbo.SelectedItem != null)             {                 //Enable filtering                 dgAll.FilteringSettings.AllowFiltering = FilterUIType.FilterMenu;                 dgAll.FilteringSettings.FilteringScope = FilteringScope.ColumnLayout;

                var le = cbo.SelectedItem as LegalEntity;

                //Add a filter to the ProductID columns, specifying values must be greater than 15                 dgAll.Columns.DataColumns["LEID"].FilterColumnSettings.FilterCellValue = le.LEID;                 dgAll.Columns.DataColumns["LEID"].FilterColumnSettings.FilteringOperand = new EqualsOperand();//GreaterThanOperand

            }             else             {                 //dgAll.Columns.DataColumns["ActivityType"].IsGroupBy = false;

                dgAll.FilteringSettings.RowFiltersCollection.Clear();                                 ClearFilterCells(dgAll.Rows);

                //dgAll.Columns.DataColumns["ActivityType"].IsGroupBy = true;

            }         }

----THIS CELAR FUCNTION IS A HACK THAT I GOT FROM YOUR TEAM YEARS AGO CAUSE YOUR FILTERS DONT CLEAR PROPERLY----

 

public void ClearFilterCells(RowCollection rows)         {             if (rows != null)             {                 if (rows.Count() > 0)                 {                     if (rows[0].RowType == Infragistics.Controls.Grids.RowType.DataRow)                     {                         foreach (Cell cell in ((RowsManager)rows[0].Manager).FilterRowTop.Cells)                         {                             (cell as FilterRowCell).FilterCellValue = null;                         }

                        foreach (Row dr in rows)                         {                             if (dr.HasChildren)                             {                                 foreach (ChildBand childBand in dr.ChildBands)                                 {                                     childBand.RowFiltersCollection.Clear();                                 }                                 ClearFilterCells(dr.ChildBands[0].Rows);                             }                         }                     }                     else                     {                         if (rows[0].GetType() == typeof(GroupByRow))                         {                             foreach (GroupByRow gbr in rows)                             {                                 gbr.RowFiltersCollection.Clear();                                 ClearFilterCells(gbr.Rows);

                                foreach (Cell cell in ((RowsManager)gbr.Rows[0].Manager).FilterRowTop.Cells)                                 {                                     (cell as FilterRowCell).FilterCellValue = null;                                 }                             }                         }                     }                 }

            }         }

 

 

Parents
No Data
Reply
  • 34430
    Offline posted

    Hello,

    Thank you for your post.

    Before I begin creating a sample project to test this, I would like to be sure I am under the correct impression for the issue you are describing. I am unsure what you mean by "The grid is grouped, when the filter is changed the group by numbers." I am under the impression that you are grouping the XamGrid and you are applying a filter to it. After applying the filter, the number representing the number of rows in each group-by section does not update until after you scroll the group by rows out of view and then back into view. Then, the numbers do not get refreshed when you clear the XamGrid filters either.

    Am I under the correct impression here? If not, would it be possible for you to please provide some more detail on the issue you are seeing?

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

Children