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

Column data overlapping after hiding the columns

15 Answers 181 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Hrushikesh
Top achievements
Rank 1
Hrushikesh asked on 07 Jul 2012, 11:45 AM
The column data get merged with other column data if we hide the column dynamically. i have taken a gridview and the columns are defined in the xaml. we have option to show and hide the columns dynamically. when we hide columns dynamically the data of hidden column get merge with the next visible column. If i reload the page containing that grid it shows properly. Images attached.

Please review this and provide a solution, we have a customer delivery pending for this.

if you ask for sample code i can't , but i can do GoToMeeting session.

here is he code snippet which we used to hide the column :
indVis = 0;
foreach (var itemcur in ListItemsCurrent)
{
    foreach (var item in dg.Columns)
    {
 
        if (itemcur.Id == item.UniqueName)
        {
            item.IsVisible = true;
            item.DisplayIndex = indVis;
            item.AggregateFunctions.Clear();
 
            if (indVis == 0)
            {
                CountFunction f = new CountFunction();
                f.Caption = "Total Items: ";
                item.AggregateFunctions.Add(f);
            }
 
            break;
        }
    }
    indVis++;
}
Here is the XAML code snippet:
<my:CustomDataGrid   x:Name="grdList" CanUserFreezeColumns="False" ShowGroupPanel="False" ShowColumnFooters="True" Tag="Program Activities"
      AutoGenerateColumns="False" Margin="0,32,0,29" IsReadOnly="True" KeyDown="grdList_KeyDown" RowActivated="grdList_RowActivated"
                   KeyUp="grdList_KeyUp" MouseRightButtonUp="grdList_MouseRightButtonUp" MouseRightButtonDown="grdList_MouseRightButtonDown"  
                   SelectionChanged="grdList_SelectionChanged" ItemsSource="{Binding Path=Data, ElementName=DomainDataSourceActivity}"
                     SelectionMode="Single" >
    <telerikGridView:RadGridView.Columns>
        <telerikGridView:GridViewDataColumn Header="Completed" DataMemberBinding="{Binding complete}" IsReadOnly="True"/>
        <telerikGridView:GridViewDataColumn Header="Activity" DataMemberBinding="{Binding action_type}" IsReadOnly="True">
            <!--<telerikGridView:GridViewDataColumn.AggregateFunctions>
                <telerikData:CountFunction Caption="Total Items: "  />
            </telerikGridView:GridViewDataColumn.AggregateFunctions>-->
        </telerikGridView:GridViewDataColumn>
        <telerikGridView:GridViewDataColumn Header="Facility Name" DataMemberBinding="{Binding facility_name}" IsReadOnly="True"/>
        <telerikGridView:GridViewDataColumn Header="Date Due" DataMemberBinding="{Binding Due_Date, Converter={StaticResource DateConverter}}" IsReadOnly="True"/>
        <telerikGridView:GridViewDataColumn Header="Date Completed" DataMemberBinding="{Binding date_completed, Converter={StaticResource DateConverter}}" />
        <telerikGridView:GridViewDataColumn Header="Staff Name" DataMemberBinding="{Binding compltedBy}" />
        <telerikGridView:GridViewDataColumn Header="Contact" DataMemberBinding="{Binding full_name}" IsVisible="False"  />
        <telerikGridView:GridViewDataColumn Header="County" DataMemberBinding="{Binding county}" IsVisible="False"/>
        <telerikGridView:GridViewDataColumn Header="District" DataMemberBinding="{Binding district_id}" IsVisible="False"/>
        <telerikGridView:GridViewDataColumn Header="State/Local" DataMemberBinding="{Binding locale}" IsVisible="False" />
        <telerikGridView:GridViewDataColumn Header="Topic Code" DataMemberBinding="{Binding topic_Item}" IsVisible="False" />
        <telerikGridView:GridViewDataColumn Header="Topic Description" DataMemberBinding="{Binding topic_desc }" IsVisible="False" />
        <telerikGridView:GridViewDataColumn Header="Topic Comments" DataMemberBinding="{Binding topic_comment}" IsVisible="False" TextTrimming="WordEllipsis" />
        <telerikGridView:GridViewDataColumn Header="Activity Comment" DataMemberBinding="{Binding concerns}" TextTrimming="WordEllipsis"  IsVisible="False" />
        <telerikGridView:GridViewDataColumn Header="Instances" DataMemberBinding="{Binding Instances}" IsVisible="False" />
        <telerikGridView:GridViewDataColumn Header="Time Spent(Minutes)" DataMemberBinding="{Binding time_spent}" IsVisible="False" />
        <telerikGridView:GridViewDataColumn Header="Travel Spent(Minutes)" DataMemberBinding="{Binding travel_time}" IsVisible="False" />
        <telerikGridView:GridViewDataColumn Header="Contact Phone" DataMemberBinding="{Binding ContactPhone, Converter={StaticResource PhoneConverter}}" IsVisible="False"  />
        <telerikGridView:GridViewDataColumn Header="Staff Work Phone" DataMemberBinding="{Binding StaffWorkPhone, Converter={StaticResource PhoneConverter}}" IsVisible="False"  />
        <telerikGridView:GridViewDataColumn Header="Staff Home Phone" DataMemberBinding="{Binding StaffHomePhone, Converter={StaticResource PhoneConverter}}" IsVisible="False"  />
        <telerikGridView:GridViewDataColumn Header="# of Attachments" DataMemberBinding="{Binding NoOfAttachments}" IsVisible="False"  />
        <telerikGridView:GridViewDataColumn Header="# of Cases Associated" DataMemberBinding="{Binding NoOfCasesAssociated}" IsVisible="False"  />
        <telerikGridView:GridViewDataColumn Header="Training Topic" DataMemberBinding="{Binding TrainingTopic}" IsVisible="False"  />
        <telerikGridView:GridViewDataColumn Header="Number of Participants" DataMemberBinding="{Binding NoOfParticipants}" IsVisible="False"  />
        <telerikGridView:GridViewDataColumn Header="Number of Trainees" DataMemberBinding="{Binding NoOfTrainees}" IsVisible="False"  />
        <telerikGridView:GridViewDataColumn Header="# of Associated activities" DataMemberBinding="{Binding NoOfAssociatedActivities}" IsVisible="False"  />
        <telerikGridView:GridViewDataColumn Header="Activity ID" DataMemberBinding="{Binding ActivityID}"  />
    </telerikGridView:RadGridView.Columns>
</my:CustomDataGrid>

15 Answers, 1 is accepted

Sort by
0
WILLIAM
Top achievements
Rank 1
answered on 18 Feb 2013, 03:03 PM
Hi, We Hide/Show columns as well and I am seeing this behavior.  The only real difference I can see from the original post is that are columns are added the grid dynamically via code behind and not defined in xaml.  We are currently on version 2012.2.607.1050 and I know we are at least a version behind the latest release.  Is there a fix or a workaround for this issue in our current version, or has it been solved in a later release?

Thanks for your help!
0
Vlad
Telerik team
answered on 19 Feb 2013, 09:19 AM
Hi,

 Unfortunately there is no workaround for this problem. 

Kind regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
WILLIAM
Top achievements
Rank 1
answered on 05 Apr 2013, 07:38 PM
Hi Telerik Team,

I was wondering if there was a change in the status of this issue.  Has it been fixed, or is there a work around, is something that is likely or not likely to be looked at in the future?

Thanks!!
0
Nick
Telerik team
answered on 08 Apr 2013, 08:08 AM
Hello William,

We had an improvement in the Columns size measurement back in Q3 2012. May I ask you to try our latest binaries and see if you still get the same behavior?

Looking forward to hearing from you! 

Regards,
Nik
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
WILLIAM
Top achievements
Rank 1
answered on 08 Apr 2013, 01:17 PM
Thanks for the response Nik,

We are on version 2012.3.1129.1050.  I'm not sure if this is the latest version or not, but I think this would indicate Q3 2012.

Thanks for your help!
0
Nick
Telerik team
answered on 09 Apr 2013, 10:58 AM
Hello William,

The fix has been applied after the Q3 SP release. May I ask you to try it out with our latest binaries(Q1 SP 2013)?

Greetings,
Nik
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Scott
Top achievements
Rank 1
answered on 12 Dec 2013, 04:47 PM
Has this problem been addressed?  We are experiencing it too.  Is there a PITS?
0
Nick
Telerik team
answered on 13 Dec 2013, 07:09 AM
Hello Scott,

I believe the issue has been resolved in our Q1 2013 release. Nevertheless if you are experiencing it with our latest binaries, i would suggest isolating the issue in a sample project and send it to us so we can debug it and deal with the problem.

Thank you in advance! 

Regards,
Nik
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Josh
Top achievements
Rank 1
answered on 10 Jan 2014, 07:40 PM

Hi Scott,

 

We had this issue too and we found a couple workarounds.

 

One option is to turn off Column Virtualization.  The obvious problem with this is if you are loading a lot of data, this will cause the render time to skyrocket.  We sometimes load thousands of rows so this was unacceptable for us.

 

The second option is a little more elaborate, slightly ugly and may not work in your situation, but since it might I thought I'd share it.  We use the PersistenceFramework to allow users to customize the look of some of the grids.  So we essentially load the grid then apply the formatting that is associated with the current user.  To prevent the overlapping data if at least one column is hidden, we had to do the following:

  • Load datasource
  • Loop through grid and hide every column
  • Wait about .25 seconds to allow UI to begin to refresh (this will "reset" the grid)
  • Apply actual column visibility

You have a couple options for how to apply the column visibility.  Since the grid won't get redrawn until the focus returns to the UI, you can loop through the columns again to make them all visible then hide the ones you want hidden, which is what we do.  Or you can just re-enable the visibility to the columns that should be visible since you previously hid them all.  Not pretty, but it works.  Hope this helps.

We're using the Q3 2013 binaries.

0
Jeff
Top achievements
Rank 1
answered on 31 Mar 2014, 02:09 PM
There is a new item in the feedback portal which may be related to this issue. Please vote on it to get it fixed.

Columns data get overlapped after updating simultaneously DisplayIndex and IsVisible properties
http://feedback.telerik.com/Project/143/Feedback/Details/124351-columns-data-get-overlapped-after-updating-simultaneously-displayindex-and-isvisi
0
Yoan
Telerik team
answered on 31 Mar 2014, 03:31 PM
Hi Jeff,

Actually, this is a bug in the current version of RadGridView and we will try to resolve it as soon as possible. Thus, it is not necessary to vote for it. You can use the provided link for tracking the status of the issue. Thank you for the understanding.

Regards,
Yoan
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
0
Tom
Top achievements
Rank 1
answered on 02 Jun 2014, 08:57 AM
Dear Telerik,

Has this issue been solved in the latest binaries? We are experiencing them in version 2012.3.1203.40 and haven't found any solution to this problem so far.

Kind regards,
Tom
0
Jeff
Top achievements
Rank 1
answered on 02 Jun 2014, 10:34 AM
Tom,

Yes, this does appear to be solved in the latest 1st quarter release from 2014 from my personal testing. We are still waiting on more formal testing on our part to call it officially though.
0
Segantii
Top achievements
Rank 1
answered on 05 Feb 2018, 08:52 AM
Hi Jeff, Is the issue resolved? I have the same problem with older version and am keen to know if it has been fixed in the latest version?
0
Dinko | Tech Support Engineer
Telerik team
answered on 07 Feb 2018, 04:01 PM
Hi Roshan,

The behavior discussed here (Feedback Portal) is already fixed in the newest version of our controls. I would recommend you to download the latest version of our controls. This way you can take advantage of the newest controls, features and bug fixes in our UI for Silverlight suite.

Regards,
Dinko
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Hrushikesh
Top achievements
Rank 1
Answers by
WILLIAM
Top achievements
Rank 1
Vlad
Telerik team
Nick
Telerik team
Scott
Top achievements
Rank 1
Josh
Top achievements
Rank 1
Jeff
Top achievements
Rank 1
Yoan
Telerik team
Tom
Top achievements
Rank 1
Segantii
Top achievements
Rank 1
Dinko | Tech Support Engineer
Telerik team
Share this question
or