This is a migrated thread and some comments may be shown as answers.

problem with font of toolwindow

6 Answers 116 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Roya
Top achievements
Rank 1
Roya asked on 29 Aug 2012, 10:51 AM
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

6 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 03 Sep 2012, 08:55 AM
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 >>
0
Hamidreza
Top achievements
Rank 1
answered on 04 Sep 2012, 05:21 AM
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.
0
Roya
Top achievements
Rank 1
answered on 04 Sep 2012, 11:00 AM
excuse me did you open a support ticket for me?
0
Julian Benkov
Telerik team
answered on 06 Sep 2012, 11:12 AM
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 >>
0
Hamidreza
Top achievements
Rank 1
answered on 10 Sep 2012, 08:15 AM
Hi Julian,

Thanks for your reply.
Please see the attachment picture.



0
Julian Benkov
Telerik team
answered on 12 Sep 2012, 11:10 AM
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 >>
Tags
Dock
Asked by
Roya
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Hamidreza
Top achievements
Rank 1
Roya
Top achievements
Rank 1
Share this question
or