problem with font of toolwindow

7 posts, 0 answers
  1. Roya
    Roya avatar
    2 posts
    Member since:
    Aug 2012

    Posted 29 Aug 2012 Link to this post

    Hello
    I put a tree on toolwindow (the tree Nodes are chekbox)  , when I autohide the toolwindow and show it again
     the font of tree nodes change and also the nodes which were checked change to uncheck,please help me to solve this problem.
    thank you
  2. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 03 Sep 2012 Link to this post

    Hi Roya,

    In order to allow me to assist you with this case I will need some more details about your scenario. Could you please share with me some code snippets that demonstrate how you load and use the data in RadTreeView? Is it in bound or unbound mode. Also, if you have NodeFormatting event implementation please share with us your code snippets to review a details. Alternatively, open a new support ticket where you can attach your project. This will allow us to provide you with adequate support. 

    I  am looking forward to your reply.  

    Regards,
    Julian Benkov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Hamidreza
    Hamidreza avatar
    3 posts
    Member since:
    Sep 2012

    Posted 04 Sep 2012 Link to this post

    Hi,

    I have also the same problem.
    When toolwindow contain treeview is in autohide or drag state, the treeview font changed to windows default font.
    treeview haven't any format events.
  5. Roya
    Roya avatar
    2 posts
    Member since:
    Aug 2012

    Posted 04 Sep 2012 Link to this post

    excuse me did you open a support ticket for me?
  6. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 06 Sep 2012 Link to this post

    Hello guys,

    @Roya - Please attach your in the support ticket regarding the same matter, which is available in your account.

    @Hamidreza - could you please post a sample code which I can use to replicate the undesired behavior. Specifically the populating with data and the font settings. Once I am able to replicate this behavior on my end  will be able to help you with it.

    Thank you for your time and cooperation.

    Greetings,
    Julian Benkov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  7. Hamidreza
    Hamidreza avatar
    3 posts
    Member since:
    Sep 2012

    Posted 10 Sep 2012 Link to this post

    Hi Julian,

    Thanks for your reply.
    Please see the attachment picture.



  8. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 12 Sep 2012 Link to this post

    Hello Hamidreza,

    The issue is related to a change of the BindingContext in RadTreeView when its Parent ToolWindow changes its state from Dock to AutoHide. In this situation the Parent of the ToolWindow is changed and also the BindingContext is reset. I logged the issue in our Public Issue Tracking System. Currently, you can use BindingContextChanged event handler to work around the issue in your application: 

    using System;
    using System.Data;
    using System.Windows.Forms;
    using Telerik.WinControls.UI;
      
    namespace ForTest
    {
        public partial class Form1 : Form
        {
            private DataTable dtlevel = new DataTable();
            private System.Drawing.Font NewFontObj = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular);
      
            public Form1()
            {
                InitializeComponent();
      
                this.treelevel.BindingContextChanged += new EventHandler(treelevel_BindingContextChanged);
            }
      
            void treelevel_BindingContextChanged(object sender, EventArgs e)
            {
                LoadTreeView();
            }
      
            private void Form1_Load(object sender, EventArgs e)
            {
                dtlevel.Columns.Add ("LevelId",typeof(int));
                dtlevel.Columns.Add("LevelName", typeof(string));
                for (int i = 0; i < 4; i++)
                {
                    DataRow dr = dtlevel.NewRow();
                    dr["LevelId"] = (i+1).ToString ();
                    dr["LevelName"] = " ??? " + (i + 1).ToString();
                    dtlevel.Rows.Add(dr);
                }
      
                LoadTreeView();
      
                txtDetail.Font = NewFontObj;
                btnOk.Font = NewFontObj;
                txtDetail.Text = "ForTest";
      
            }
      
            private void LoadTreeView()
            {
                if (dtlevel.Columns.Count == 0)
                {
                    return;
                }
      
                treelevel.DataSource = dtlevel;
                treelevel.DisplayMember = dtlevel.Columns["LevelName"].Caption;
                treelevel.ValueMember = dtlevel.Columns["LevelId"].Caption;
                treelevel.CheckBoxes = true;
      
                foreach (RadTreeNode node in treelevel.Nodes)
                {
                    node.Checked = true;
                    node.Font = NewFontObj;
                }
            }
        }
    }

    I hope this helps.

    Regards,
    Julian Benkov
    the Telerik team
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Back to Top
UI for WinForms is Visual Studio 2017 Ready