secondary header alignment for invisible columns

3 posts, 0 answers
  1. Kevin Tran
    Kevin Tran avatar
    40 posts
    Member since:
    Apr 2010

    Posted 03 Sep 2010 Link to this post

    Hi support,
    I read this blog which is awesome, I implemented the same in my proj,Only problem is that upon user selection i make some of the columns invisible ,because of that Secondary header alignments gone missing.In btw I am able to change the content of secondary header,here are the changes i made. 

    in mainpage.xaml.cs
    var rows = gvData.ChildrenOfType<CommonHeader>();
                  foreach (var row in rows)
                  {
                      if (row.Name == "Second1")
                          row.ColumnSpan = 5;
                      if (row.Name == "Third1")
                      {
                          row.StartColumnIndex = 7;
                          row.ColumnSpan = 6;
     
                      }
                      if (row.Name == "Fourth1")
                      {
                          row.StartColumnIndex = 13;
                          row.ColumnSpan = 6;
     
     
                      }
                  }
    in commonheader.xaml.cs
    public static readonly DependencyProperty ColumnIndex =
            DependencyProperty.Register("StartColumnIndex", typeof(int), typeof(CommonHeader), new PropertyMetadata(0));
     
            public static readonly DependencyProperty ColSpan =
         DependencyProperty.Register("ColumnSpan", typeof(int), typeof(CommonHeader), new PropertyMetadata(0));
     
              
            public string Caption
            {
                get
                {
                    return (string)this.GetValue(CaptionProperty);
                }
                set
                {
                    this.SetValue(CaptionProperty, value);
                }
            }
            public int StartColumnIndex
            {
                get
                {
                    return (int)this.GetValue(ColumnIndex);
                }
     
                set
                {
                    this.SetValue(ColumnIndex, value);
                }
     
            }
            public int ColumnSpan
            {
                get
                {
                    return (int)this.GetValue(ColSpan);
                }
     
                set
                {
                    this.SetValue(ColSpan, value);
                }
            }

    in ColumnGroupbehaviour.cs
    protected override void OnDetaching()
           {
               base.OnDetaching();
               this.AssociatedObject.DataLoaded +=new EventHandler<EventArgs>(AssociatedObject_DataLoaded);
           }
           void AssociatedObject_DataLoaded(object sender, EventArgs e)
           {
         
               PlaceSecondaryHeader();
           }

    Suggest some solution 
    Thanks
     

  2. Kevin Tran
    Kevin Tran avatar
    40 posts
    Member since:
    Apr 2010

    Posted 07 Sep 2010 Link to this post

    Hi,
    Any help 
  3. DevCraft banner
  4. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 07 Sep 2010 Link to this post

    Hi Kevin Tran,

    Without having your code I may just guess what went wrong . So can you please send me your project in a support ticket (or a simplified version of it ). This way I will be able to step through the code and make the required fixes for you .

    Regards,
    Pavel Pavlov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top