Column data overlapping after hiding the columns

14 posts, 0 answers
  1. Hrushikesh
    Hrushikesh avatar
    33 posts
    Member since:
    Sep 2010

    Posted 07 Jul 2012 Link to this post

    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>
  2. WILLIAM
    WILLIAM avatar
    134 posts
    Member since:
    Jun 2012

    Posted 18 Feb 2013 Link to this post

    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!
  3. DevCraft banner
  4. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 19 Feb 2013 Link to this post

    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.

  5. WILLIAM
    WILLIAM avatar
    134 posts
    Member since:
    Jun 2012

    Posted 05 Apr 2013 Link to this post

    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!!
  6. Nick
    Admin
    Nick avatar
    593 posts

    Posted 08 Apr 2013 Link to this post

    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.

  7. WILLIAM
    WILLIAM avatar
    134 posts
    Member since:
    Jun 2012

    Posted 08 Apr 2013 Link to this post

    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!
  8. Nick
    Admin
    Nick avatar
    593 posts

    Posted 09 Apr 2013 Link to this post

    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.

  9. Scott
    Scott avatar
    14 posts
    Member since:
    Nov 2011

    Posted 12 Dec 2013 Link to this post

    Has this problem been addressed?  We are experiencing it too.  Is there a PITS?
  10. Nick
    Admin
    Nick avatar
    593 posts

    Posted 13 Dec 2013 Link to this post

    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 >>
  11. Josh
    Josh avatar
    27 posts
    Member since:
    Feb 2012

    Posted 10 Jan 2014 Link to this post

    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.

  12. Jeff
    Jeff avatar
    25 posts
    Member since:
    Feb 2009

    Posted 31 Mar 2014 Link to this post

    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
  13. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 31 Mar 2014 Link to this post

    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.

     
  14. Tom
    Tom avatar
    8 posts
    Member since:
    Feb 2011

    Posted 02 Jun 2014 Link to this post

    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
  15. Jeff
    Jeff avatar
    25 posts
    Member since:
    Feb 2009

    Posted 02 Jun 2014 in reply to Tom Link to this post

    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.
Back to Top
DevCraft banner