StatusStrip element message disappear

13 posts, 2 answers
  1. Naunton
    Naunton avatar
    70 posts
    Member since:
    Jun 2010

    Posted 24 Jan 2011 Link to this post

    Hi all,

    Please help, when I set message to statusStrip element and do refresh it shows only 3character.
    eg.   RSS.Items("StatusMessage").Text = "Calculate Total"
           RSS.Refresh()
    then when I run, it shows "Cal..."  , I want it to show all text whatever I set to.
    Here is my designer code
    'RSS
    '
    Me.RSS.AutoSize = True
    Me.RSS.BackColor = System.Drawing.Color.LightCyan
    Me.RSS.Items.AddRange(New Telerik.WinControls.RadItem() {Me.ProcessDateTime, Me.RadToolStripSeparatorItem1, Me.Source, Me.RadToolStripSeparatorItem2, Me.StatusMessage, Me.RadToolStripSeparatorItem3, Me.Count, Me.RadToolStripSeparatorItem4, Me.Version})
    Me.RSS.LayoutStyle = Telerik.WinControls.UI.RadStatusBarLayoutStyle.Stack
    Me.RSS.Location = New System.Drawing.Point(0, 242)
    Me.RSS.Name = "RSS"
    Me.RSS.Size = New System.Drawing.Size(736, 33)
    Me.RSS.SizingGrip = False
    Me.RSS.TabIndex = 0
    Me.RSS.Text = "RadStatusStrip1"
    Me.RSS.ThemeName = "Aqua"
    Me.RSS.UseWaitCursor = True
    '
    'ProcessDateTime
    '
    Me.ProcessDateTime.AutoSize = False
    Me.ProcessDateTime.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren
    Me.ProcessDateTime.Bounds = New System.Drawing.Rectangle(0, 0, 100, 22)
    Me.ProcessDateTime.Margin = New System.Windows.Forms.Padding(1)
    Me.ProcessDateTime.Name = "ProcessDateTime"
    Me.RSS.SetSpring(Me.ProcessDateTime, False)
    Me.ProcessDateTime.Text = "time"
    Me.ProcessDateTime.TextWrap = True
    '
    'RadToolStripSeparatorItem1
    '
    Me.RadToolStripSeparatorItem1.Margin = New System.Windows.Forms.Padding(1)
    Me.RadToolStripSeparatorItem1.Name = "RadToolStripSeparatorItem1"
    Me.RSS.SetSpring(Me.RadToolStripSeparatorItem1, False)
    Me.RadToolStripSeparatorItem1.Text = "RadToolStripSeparatorItem1"
    '
    'Source
    '
    Me.Source.AutoSize = False
    Me.Source.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren
    Me.Source.Bounds = New System.Drawing.Rectangle(0, 0, 69, 20)
    Me.Source.Margin = New System.Windows.Forms.Padding(1)
    Me.Source.Name = "Source"
    Me.RSS.SetSpring(Me.Source, False)
    Me.Source.Text = "source"
    Me.Source.TextWrap = True
    '
    'RadToolStripSeparatorItem2
    '
    '
    'StatusMessage
    '
    Me.StatusMessage.AutoSize = False
    Me.StatusMessage.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren
    Me.StatusMessage.Bounds = New System.Drawing.Rectangle(0, 0, 384, 20)
    Me.StatusMessage.Margin = New System.Windows.Forms.Padding(1)
    Me.StatusMessage.Name = "StatusMessage"
    Me.RSS.SetSpring(Me.StatusMessage, False)
    Me.StatusMessage.Text = "status"
    Me.StatusMessage.TextWrap = True
    '
    'RadToolStripSeparatorItem3
    '
    '
    'Count
    '
    Me.Count.AutoSize = False
    Me.Count.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren
    Me.Count.Bounds = New System.Drawing.Rectangle(0, 0, 80, 27)
    Me.Count.Margin = New System.Windows.Forms.Padding(1)
    Me.Count.Name = "Count"
    Me.RSS.SetSpring(Me.Count, False)
    Me.Count.Text = "count"
    Me.Count.TextWrap = True
    '
    'RadToolStripSeparatorItem4
    '
    '
    'Version
    '
    Me.Version.AutoSize = False
    Me.Version.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren
    Me.Version.Bounds = New System.Drawing.Rectangle(0, 0, 79, 20)
    Me.Version.Margin = New System.Windows.Forms.Padding(1)
    Me.Version.Name = "Version"
    Me.RSS.SetSpring(Me.Version, False)
    Me.Version.Text = "version"
    Me.Version.TextWrap = True

    Thanks and best regards
  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 27 Jan 2011 Link to this post

    Hi naunt,

    Thank you for writing.

    I noticed that you have set the AutoSize property to false for StatusMessage element. I would like to recommend turning AutoSize in order to avoid described behavior, for example:

    Me.StatusMessage.AutoSize = True

    I hope this helps.

    Do not hesitate to contact us if you have other questions.

    Greetings,
    Peter
    the Telerik team
    Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Naunton
    Naunton avatar
    70 posts
    Member since:
    Jun 2010

    Posted 27 Jan 2011 Link to this post

    Hi Peter,

    Thanks for the reply.
    Yes, I have set autosize to false, because of I want to set their size for each RadLabelElement.
    As your recommended have turn all RadLabelElement's Autosize to true and run it,  message still show only 3 character same as previous.

    Please help.

    Thanks and best regards.
  5. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 02 Feb 2011 Link to this post

    Hi naunt,

    Thank you for writing back.

    I would like to suggest removing also the Bound property for this element.
    Please refer to the attached project. Do not hesitate to contact us if you have other questions.

    Greetings,
    Peter
    the Telerik team
    Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
  6. BRiddle
    BRiddle avatar
    24 posts
    Member since:
    Sep 2010

    Posted 02 Feb 2011 Link to this post

    I'm having what sounds like the same problem with my RadStatusStrip.   The one child control, a RadLabelElement, seems to adopt the width of the initial text property.   If I start out with a typical value of "Ready.", then everything I later assign to that text property truncates to that approximate width.  If I set the initial design time Text property to "Ready. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", then everything I later assign truncates to THAT value's size.

    Per this forum, I have tried both AutoSize=true and AutoSize=false,   I've tried assigning the new text and then calling the parent RadStatusStrip.Update().   I've tried removing the RadLabelElement from the RadStatusStrip's "Items" collection, assigning the new label text, and then re-Adding the label to the strip's Items collection (that left the label blank from the time of Remove/Add until the program completed).

    I downloaded this thread's StatusStripVB.zip file, built it, and it does appear to work correctly.  I also compared the properties in your StatusStripVB project to those in my problem and attempted to set everything the same; but no joy.   (ie: AutoSize=true, etc.) But my RadLabelElement still truncates any future Text string to the initial property value's size.

    I'm using VS2010, C#, .Net 4 Client Framework, and RAdControls for WinForms Q3 2010.

    Any idea of where to look next for the truncation?

    Thank you for your help,
    -Bob

    Here are the property settings:
            private void InitializeComponent() {
                this.pnlMailItems = new Telerik.WinControls.UI.RadPanel();
                this.gridviewMailItems = new Telerik.WinControls.UI.RadGridView();
                this.ssMain = new Telerik.WinControls.UI.RadStatusStrip();
                this.sslblMain = new Telerik.WinControls.UI.RadLabelElement();
                this.radLabel1 = new Telerik.WinControls.UI.RadLabel();
                this.windows7Theme1 = new Telerik.WinControls.Themes.Windows7Theme();
                this.txtOutlookPstFileName = new Telerik.WinControls.UI.RadTextBox();
                this.btnBrowseForPstFileName = new Telerik.WinControls.UI.RadButton();
                this.dlgOpenFile = new System.Windows.Forms.OpenFileDialog();
                this.btnListMailItems = new Telerik.WinControls.UI.RadButton();
                this.listMessages = new Telerik.WinControls.UI.RadListControl();
                ((System.ComponentModel.ISupportInitialize) (this.pnlMailItems)).BeginInit();
                this.pnlMailItems.SuspendLayout();
                ((System.ComponentModel.ISupportInitialize) (this.gridviewMailItems)).BeginInit();
                ((System.ComponentModel.ISupportInitialize) (this.ssMain)).BeginInit();
                ((System.ComponentModel.ISupportInitialize) (this.radLabel1)).BeginInit();
                ((System.ComponentModel.ISupportInitialize) (this.txtOutlookPstFileName)).BeginInit();
                ((System.ComponentModel.ISupportInitialize) (this.btnBrowseForPstFileName)).BeginInit();
                ((System.ComponentModel.ISupportInitialize) (this.btnListMailItems)).BeginInit();
                ((System.ComponentModel.ISupportInitialize) (this.listMessages)).BeginInit();
                this.SuspendLayout();
    ...
    ...
                // ssMain
                //
                this.ssMain.Items.AddRange(new Telerik.WinControls.RadItem[] {
                this.sslblMain});
                this.ssMain.LayoutStyle = Telerik.WinControls.UI.RadStatusBarLayoutStyle.Stack;
                this.ssMain.Location = new System.Drawing.Point(0, 650);
                this.ssMain.Name = "ssMain";
                this.ssMain.Size = new System.Drawing.Size(1277, 26);
                this.ssMain.SizingGrip = true;
                this.ssMain.TabIndex = 1;
                this.ssMain.Text = "radStatusStrip1";
                //
                // sslblMain
                //
                this.sslblMain.AutoSize = true;
                this.sslblMain.Margin = new System.Windows.Forms.Padding(1);
                this.sslblMain.MinSize = new System.Drawing.Size(0, 0);
                this.sslblMain.Name = "sslblMain";
                this.ssMain.SetSpring(this.sslblMain, false);
                this.sslblMain.Text = "Ready.";
                this.sslblMain.TextWrap = true;
  7. Answer
    Peter
    Admin
    Peter avatar
    1148 posts

    Posted 07 Feb 2011 Link to this post

    Hello Bob,

    Thank you for writing.

    I was not able to reproduce this behavior with the modified StatusStripVB project - please refer to attached movie StatusStripAndLabelTextCut.swf. Could you try to reproduce the issue on your side with the attached project?

    I am looking for your response.

    Kind regards,
    Peter
    the Telerik team
    Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
  8. Naunton
    Naunton avatar
    70 posts
    Member since:
    Jun 2010

    Posted 08 Feb 2011 Link to this post

    Hi Peter,

    I've got the cause but not the solution.

    If I set the text before Timer_tick event It shows all everything what I set.
    But, when I set after Timer_tick event, It dosen't show all.
    Any idea for this case? Because of in my program I need to use Timer.

    Thanks and best regard..
  9. BRiddle
    BRiddle avatar
    24 posts
    Member since:
    Sep 2010

    Posted 09 Feb 2011 Link to this post

    It looks like the problem is something other than how the RadStatusStrip and label element are configured.   I built and ran your StatusStripVB project with no issues.   I then brought up a 2nd instance of VS2010 and copy-and-pasted your exact full status strip - including its child elements - into my project and onto the main Window whose current status strip label has the issue.

    Next I went into my code and copied in your exact line this.radLabelElement1.Text = xxxx into my code immediately after each assign my code made to my own RadStatusStrip's label element Text property. Your radLabelElement1.Text in your status strip, configured exactly as you had it, truncates identically to mine.

    I next thought it might be a simple timing bug associated with displaying rapid updates and put code into your sample to quickly iterate through displaying the first 500 filenames on my system in the RadLabelElement.  Your sample worked correctly.

    At this point, my app is fairly short and simple.  It uses Outlook 2007 via a VSTO interop to list the EMails in an Outlook Data File (.PST) in a RadGridView.  (I need  to "Diff" to copies of the same .PST file made at different times to see what EMails were in one and not in the other and thought this utility might be a good time to try the Telerik suite.  I've just started writing it and so far the code just lists the EMails in one copy of the .PST).

    I have yet to figure out what's going on within my own sample, but something is obviously interfering with the RadStatusStrip's label element's operation.  Perhaps something connected with the Interop is causing issues?  
  10. Answer
    BRiddle
    BRiddle avatar
    24 posts
    Member since:
    Sep 2010

    Posted 09 Feb 2011 Link to this post

    If not a timing issue, it's some kind of invalidate/update sequence issue.  I found two ways to make mine work.

    I'm using a SetStatusStripLabel(string aText)  method to update the RadLabelElement's Text to avoid having to recode "this.radLabelElement.Text = xxx" followed by "this.radStatusStrip.update()" a bunch of times. 

    1).  I tried adding a regular Systems.Windows.Forms.Label "lblDebug" to the body of the same form (not, of course, within the bounds of the RadStatusStrip).    To the SetStatusStripLabel() method, I simply added the the lines "lblDebug.Text = aText" and "lblDebug.Update()".   So I was now redundantly writing the same text to both the RadStatusStrip and its RadLabelElement and also to the standard Systems.Windows.Forms.Label control.   When I ran that version of the program, the truncation within the RadLabelElement stopped.  

    I deleted the new standard Label and commented out the two lines in the SetStatusStripLabel method.  The truncation came back.

    2.) With the program back to where it was without the standard toolbox label, I then tried adding a RadLabelElement.UpdateLayout() method in between setting the RadLabelElement's Text and calling the RadStatusStrip.Update().  The truncation went away.

    So that's a workaround for me at least.   Any idea why it's necessary or why both/either adding a standard label or adding the RadLabelElement.UpdateLayout()  works? 

    I AM updating the RadLabelElement's Text fairly fast and furiously - probably a few hundred times over 8 or 9 seconds since the text tracks which folders in the Outlook Data file are being examined and each EMail's apparently COM interfaced object is being obtained from which to get the EMail's Subject, Author, etc. into a BindingList to later pass to the RadGridView.  But the update rate doesn't seem to bother the standard Systems.Windows.Forms.Label control if I use that one and not the RadLabelElement.
  11. Naunton
    Naunton avatar
    70 posts
    Member since:
    Jun 2010

    Posted 10 Feb 2011 Link to this post

    Hi Bob,

    Thank you so much.
    RadLabelElement.UpdateLayout()  did work for me too.
  12. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 10 Feb 2011 Link to this post

    Hi Nanut, I am glad to hear that you have found a suitable solution for your scenario. Do not hesitate to contact us, if you have other questions.

    @Bob, thank you for the provided answer.

    Greetings,
    Peter
    the Telerik team
    Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
  13. BRiddle
    BRiddle avatar
    24 posts
    Member since:
    Sep 2010

    Posted 10 Feb 2011 Link to this post

    You're most welcome.

    Any idea though, what is going on with the separate, explicit RadLabelElement.UpdateLayout() call being required in some circumstances?  

    I would have expected that the "getter" for the RadLabelElement.Text property would have flagged that the controls' layout needed to be refreshed without a separate, explicit call when the status strip's label element's Text property was set to a new value. 

    It seems that the UpdateLayout() is normally happening implicitly - or at least something with the same effect - if the user simply makes one change to the property and doesn't starve the GUI's thread with further processing instead of doing something like my making hundreds of COM / Interop accesses causing rapid GUI changes and consequently having to use RadStatusStrip.Update() after each in order to force the window to be painted so the GUI can remain current.

    Is there something I'm doing wrong in my code here?   Is there any information I could get you (a mini-dump, a breakpoint stop-and-display, an Intellitrace log, etc.) that would shed some light on why this truncation sometimes occurs without the explicit UpdateLayout() call between Text property change and RadStatusStrip.Update()?

    Please let me know if so.   I'd be happy to help.
  14. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 11 Feb 2011 Link to this post

    Hi Bob,

    Thank you for writing back and for the cooperation.

    The Text property is defined in the RadItem base class and invalidates layout. Refer to the Text property declaration:

    public static RadProperty TextProperty = RadProperty.Register(
        "Text", typeof(string), typeof(RadItem), new RadElementPropertyMetadata(
            string.Empty,
            ElementPropertyOptions.AffectsMeasure |
            ElementPropertyOptions.AffectsParentMeasure |
            ElementPropertyOptions.AffectsDisplay |
            ElementPropertyOptions.Cancelable));

    This AffectMeasure flag will invalidate Measure and Arrange and this invalidate will schedule a LayoutUpdate only. This LayoutUpdate does not happen implicitly - it will happen for example in the Application.DoEvents event.

    We will consider including the AffectsLayout option for the text property or call implicitly UpdateLayout.

    I hope this helps.

    Kind regards,
    Peter
    the Telerik team
    Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
Back to Top
UI for WinForms is Visual Studio 2017 Ready