While we appreciate comments from our users, please follow our posting guidelines. Have you tried the Cyotek Forums for support from Cyotek and the community?

Styling with Markdown is supported

Original Comment

Gravatar

ViDom

# Reply

public void SetHorizontalExtent()
{
  int maxWith;

  maxWith = 0;
  if (object.ReferenceEquals(this.DataSource, null))
  {
      foreach (object item in this.Items)
      {
          Size textSize;
          textSize = TextRenderer.MeasureText(item.ToString(), this.Font);
          if (textSize.Width > maxWith)
              maxWith = textSize.Width;
      }
  }
  else
  {
      foreach (DataRowView item in this.Items)
      {
          Size textSize;
          textSize = TextRenderer.MeasureText(item.Row[this.DisplayMember].ToString(), this.Font);
          if (textSize.Width > maxWith)
              maxWith = textSize.Width;
      }
  }
  this.SetHorizontalExtent(maxWith);
}

;) Thanks....

Gravatar

Richard Moss

# Reply

I never use the built in data binding so I wasn't aware of this issue. Thank you for pointing it out, and providing the fix!

Regards; Richard Moss