This is a migrated thread and some comments may be shown as answers.

Grouping causes first row of the grid to disappear

6 Answers 208 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Arpit
Top achievements
Rank 1
Arpit asked on 04 Feb 2011, 03:05 PM
Hi,

I am using RadGridView with multiple/single field groupings based on conditions. When grid is first bound, it eats away first row of each group, which is event present in the datasource of the grid.

Code for setting default grouping when RadGridView is bound:
private void setGrouping() {
       if (this.grdScope != null) {
           this.grdScope.GroupDescriptors.Clear();
           GroupDescriptor serviceDescriptor = new GroupDescriptor();
           serviceDescriptor.Member = "Service";
           serviceDescriptor.SortDirection = ListSortDirection.Ascending;
           this.grdScope.GroupDescriptors.Insert(0, serviceDescriptor);
       }
   }

Edited: The missing row is restored when I toggle the radio buttons to change the mode (as below)
Below is the code to change the grouping:

//if radiobutton 1 is checked
private void rbService_Checked(object sender, RoutedEventArgs e) {
       if (this.grdScope != null) {
            this.grdScope.GroupDescriptors.Clear();
            GroupDescriptor serviceDescriptor = new GroupDescriptor();
            serviceDescriptor.Member = "Service";
            serviceDescriptor.SortDirection = ListSortDirection.Ascending;
            this.grdScope.GroupDescriptors.Insert(0, serviceDescriptor);
        }
    }
 
//if radiobutton 2 is checked
    private void rbPhase_Checked(object sender, RoutedEventArgs e) {
        if (this.grdScope != null) {
            GroupDescriptor phaseDescriptor = new GroupDescriptor();
            phaseDescriptor.Member = "Phase";
            phaseDescriptor.SortDirection = ListSortDirection.Ascending;
            this.grdScope.GroupDescriptors.Insert(0, phaseDescriptor);
            this.grdScope.ShowGroupPanel = false;
        }
    }

Any ideas suggestions on this?

6 Answers, 1 is accepted

Sort by
0
Arpit
Top achievements
Rank 1
answered on 04 Feb 2011, 03:56 PM
Could anyone please address this issue? I need it very hard.
0
Maya
Telerik team
answered on 04 Feb 2011, 04:35 PM
Hello Arpit,

I was not able to reproduce the issue you defined. I am sending you the sample project I used for testing it. You may take a look at it and let me know in case there are some discrepancies according to your scenario. 
Furthermore, as we had a similar issue, but it has already been fixed, I would encourage you to download our current official release - Q3 2010 SP1 or better our Latest Internal Build.
On the other hand you may try to define ColumnGroupDescriptors instead of GroupDescriptors. You may take a look at our online documentation for a reference.

Regards,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Arpit
Top achievements
Rank 1
answered on 04 Feb 2011, 05:13 PM
Thanks for your response Maya,

I will try using ColumnGroupDescriptors.

Can I use ColumnGroupDescriptors for columns which I haven't defined in my RadGridView?
0
Arpit
Top achievements
Rank 1
answered on 04 Feb 2011, 05:29 PM
Replacing the dlls with the latest release fixed my problem.

Thank you so much!!
0
Karan
Top achievements
Rank 1
answered on 21 Nov 2011, 09:46 PM
Hi Arpit and Maya, 
         I am facing this issue again. I have an ObservableSortedDictionary bound to the grid. For me this case happens when 
         I do a bulk change i.e remove 3-4 rows and add 3-4 rows in my ObservableSortedDictionary. The first row for each group is eaten always.When i do some changes on grid say edit some value , it comes back. What is the root cause of this problem I cannot understand.
0
Maya
Telerik team
answered on 22 Nov 2011, 07:48 AM
Hello Karan,

Did you manage to get the same behavior on the sample I attached ?
 

Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Arpit
Top achievements
Rank 1
Answers by
Arpit
Top achievements
Rank 1
Maya
Telerik team
Karan
Top achievements
Rank 1
Share this question
or