Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9270021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:16:06+00:00 2026-06-18T15:16:06+00:00

I have a control that is derived from MT.D StringElement . The element can

  • 0

I have a control that is derived from MT.D StringElement. The element can be created with a blank/empty Caption which is subsequently updated when the user adds text to a different control. Caption is a field in the MT.D Element class and setting it doesn’t automatically update the associated control. So in order to try to update the control I created a property that updates the base field and then attempts to update the control.

public new string Caption {
    get {
        return base.Caption;
    }
    set {
        base.Caption = value;
        var cell = GetActiveCell();
        if (cell != null) {
            cell.TextLabel.Text = value;
        }
    }
}

Sadly it’s not updating the UI with the new value. Using the debugger I can see it sets the new value correctly but it’s not displaying the text. If I create the control with a non-blank Caption then it is displayed correctly. I use a similar approach to update the control’s ImageView which works correctly.

private void SetUiState(){
    var cell = this.GetActiveCell();
    if (cell != null) {
        var imgView = cell.ImageView;
        if (imgView != null) {
            imgView.Image = _isEnabled ? _enabledImage : _disabledImage;
        }
        cell.SelectionStyle = _isEnabled ? UITableViewCellSelectionStyle.Blue : UITableViewCellSelectionStyle.None;
    }
}

Any idea why it doesn’t work for the cell’s TextLabel?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:16:08+00:00Added an answer on June 18, 2026 at 3:16 pm

    I’ve seen this before, the cell needs to be re-laid out because the frame of the TextLabel needs to be changed to accomodate the change in text.

    public class TestElement : StringElement
    {
        public TestElement() : base("")
        {
    
        }
    
        public new string Caption {
            get 
            {
                return base.Caption;
            }
    
            set 
            {
                base.Caption = value;
                var cell = GetActiveCell();
                if (cell != null) 
                {
                    cell.TextLabel.Text = value;
                    cell.SetNeedsLayout();
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a control derived from a CWnd object that has its custom implemented
I have a customized WPF control that is derived from UserControl. In the Resources
I have a class derived from slider which uses a custom control template and
I have a custom control that is derived from TabItem , and I want
I have a custom control that is derived from ListView . This list view
I have a DesignerCanvas (derived from canvas) that I can add UIElements to, then
I have my own custom control derived from System.Windows.Forms.TreeView which is present on the
I have a custom control that i have derived from the Control class. I
I created a control, derived from Canvas , that should plot a live diagram,
I have a control derived from System.Windows.Forms.UserControl which is placed in a customized grid.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.