Home Forums WinForms controls Xceed Grid for WinForms Help: Can’t figure out how to resize headers

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17214 |

    Hey…

    Just a quick question hoping for a quick answer 🙂 I searched the forum but couldn’t find the solution I was looking for.

    I had a grid that I databind to a DataTable. I would like to have it resize the column Headers to fit the header text in them. Column.GetFittedWidth is not what I need since that resizes the columns based on the data in them. I am looking to resize the Headers to fit the titles they contain. 

    How do I do that?

    Thanks

     

    Imported from legacy forums. Posted by Nazeeh (had 1151 views)

    User (Old forums)
    Member
    Post count: 23064

    hmm…does anyone from Xceed look at these forums anymore? Where can I get support for this product?

    Imported from legacy forums. Posted by Nazeeh (had 660 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,

    All of Microsoft employees share the Vanguard subscription bought by Microsoft since it’s license site.  This means that you should always address your question to priority@xceed.com .  Actually, I can see that you sent your question (at priority@xceed.com) on Tue, 28 Jul 2009 16:18:43.  You got your response on Wed, 29 Jul 2009 11:37:13.

    If, as a Vanguard user, you decide to use the forums to ask a question, you should always send a notification at priority@xceed.com referring to the thread you have created.  Otherwise, the forum posts are answered as soon as we have some spare time (so to speak, because we don’t really have any). 

    To this day, the forums are still not linked to our CRM (Custormer Relationship Management) so it makes it impossible for us to know who is Vanguard on the forums and who is not.  This is supposed to change in the (not so distant) future but we are not there yet. 

    This being said, the answer to your original question is:

          foreach (Row row in gridControl1.FixedHeaderRows)
          {
            if (row is ColumnManagerRow)
            {
              foreach (Cell cell in (row as ColumnManagerRow).Cells)
                cell.ParentColumn.Width = cell.GetFittedWidth();
              break;
            }
          }

    This is not what I have sent you.  (A GroupByRow row could be at index 0 of the FixedHeaderRows.)   You should use this version.

    Imported from legacy forums. Posted by Ghislain (had 812 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.