We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Hide row under a group

Thread ID:

Created:

Updated:

Platform:

Replies:

108460 Apr 22,2013 04:58 PM UTC Apr 24,2013 09:04 AM UTC WinRT 3
loading
Tags: SfGridSplitter
bhavani sangannagari
Asked On April 22, 2013 04:58 PM UTC

hi,

Enclosed is a sample. 

a) I would like to display grouped row **Empty Group**, but would like nothing to appear under it showing that group as empty. This is to show there is a group called Empty Group but there is nothing inside it. I tried by showing empty cells or by collapsing related VirtualizingCellsControl but cannot get rid of empty line under it. Please advice

b) Setting AutoExpandGroups="True" in xaml is having a refresh issue with Expander direction. If groups are auto expanded from loaded event, it works good.

Thanks


SfGrid_3708d108.zip

Prakash Selvaraj [Syncfusion]
Replied On April 23, 2013 12:37 PM UTC

Hi Bhavani,

 

Sorry for the inconvenience caused.

 

We have analysed your query,

 

For Query a):

You can achieve your requirements by cancelling the GroupExpanding event for the empty group. We have created a simple sample to achieve this. Please refer the below sample.

Sample link: SfGrid.zip

 

For Query b):

We were able to reproduce the issue, we will fix the issue and it will be available in our next release which is expected by mid of May 2013.

 

Regards,

Prakash S.


bhavani sangannagari
Replied On April 23, 2013 06:32 PM UTC

Thanks for reply. I get the following exception.

System.NullReferenceException
   at Syncfusion.UI.Xaml.Grid.RowGenerator.CreateDataRow(Int32 rowIndex, VisibleLinesCollection visibleColumns)
   at Syncfusion.UI.Xaml.Grid.RowGenerator.EnsureRows(VisibleLinesCollection visibleRows)
   at Syncfusion.UI.Xaml.Grid.VisualContainer.EnsureItems(Boolean ensureColumns)
   at Syncfusion.UI.Xaml.Grid.VisualContainer.MeasureOverride(Size constraint)   at Windows.UI.Xaml.UIElement.Measure(Size availableSize)
   at Syncfusion.UI.Xaml.Grid.ScrollableContentViewer.MeasureOverride(Size availableSize)

To reproduce it, just place the grid within scrollviewer like below. I need to be able to scroll through multiple grids on a page, hence need a scrollviewer. Please advice

 <ScrollViewer Grid.Row="1">
                <syncfusion:SfDataGrid x:Name="datagrid"
                               AutoGenerateColumns="True"
                               ShowColumnWhenGrouped="False"
                               ColumnSizer="Star"
                               ItemsSource="{Binding Stocks}">

            <syncfusion:SfDataGrid.GroupColumnDescriptions>
                <syncfusion:GroupColumnDescription ColumnName="Account" />
            </syncfusion:SfDataGrid.GroupColumnDescriptions>
        </syncfusion:SfDataGrid>
        </ScrollViewer>

I tried collapsing all groups and expanding just the groups having valid rows, but this approach is having refresh issues. Sample code i tried is as below.  

         datagrid.CollapseAllGroup();
            if (this.datagrid.View != null)
            {                 
                    foreach (var item in datagrid.View.TopLevelGroup.Groups)
                    {
                        if (item.Records.Count > 1)
                        {
                            item.IsExpanded = true;
                        }
                    }
            }

Prakash Selvaraj [Syncfusion]
Replied On April 24, 2013 09:04 AM UTC

Hi Bhavani,

 

Sorry for the inconvenience caused.

 

We are able to reproduce the reported issues. We will fix this issue and it will be available in our next release which is expected by mid of May 2013. At present you can use the below work around to achieve your requirements. We have created the simple sample based on that, Please refer the below sample.

 

Code Snippet [C#]:

var updaterowcount = this.datagrid.GetType().GetRuntimeMethods().FirstOrDefault(method => method.Name == "UpdateRowCount");

updaterowcount.Invoke(datagrid, null);

 

Sample Link: SfGrid.zip

 

Please let us know if you need further assistance.

 

Regards,

Prakash S.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;