Telerik Forums
UI for WinForms Forum
4 answers
594 views
Hi. 
I Have a radGridView, i am trying to find the TextChanged Event of a cell, in which i want an event to happen while the user is typing inside a cell while text is being changed.

How to find it?

Thankfully yours.
Stefan
Telerik team
 answered on 03 Jun 2015
6 answers
219 views
Hello,

I upgraded the Telerik WinForms to 2014.2.715 version.
The upgrade results to all my forms containing the radtextboxes and raddropdownlists with Anchor property set to `Right` stops working properly.

1. The affected control (e.g. radtextbox) shall be placed on a UserControl control directly or on a panel.
2. Its anchor property must contain Right (eg Top+Right+Left)
3. The UserControl control must be placed on a Telerik RadForm.

After starting the app the radtextbox ignores the anchor=right and leaves the form's boundaries.

Resizing the UserControl in the designer works fine. Previous release (2013.3.1127) doesn't contain this problem. The problem appears after upgrading to 2014.2.715.

As I understand it is old bag reincornated :) The problem is the same as described here: http://stackoverflow.com/questions/9604605/user-control-keeps-stretching-once-dropped-on-form
Dimitar
Telerik team
 answered on 02 Jun 2015
1 answer
111 views

Hi to all,

I trying to copy from one gridview that has 4 columns and paste another gridview that has 3 columns.

Now, in RadGridViewPasting of destination GridView I wrote this code, those gridviews are into Windows dialog that called from main Windows with ShowDialog mode. But this code generate an error.

 If I compare ContainsData in incoming and ContainsData in outcoming are formally correct.

What's up?

01.private void MappingRadGridViewPasting(object sender, GridViewClipboardEventArgs e)
02.        {
03.            try
04.            {
05.                if (Clipboard.ContainsData(DataFormats.Text))
06.                {
07.                    string data = Clipboard.GetData(DataFormats.Text).ToString();
08.                    if (data != string.Empty)
09.                    {
10.                        var items = data.Split('\n');
11. 
12.                        StringBuilder sb = new StringBuilder();
13. 
14.                        for (int i = 0; i < items.Length; i++)
15.                        {
16.                            var fields = items[i].Split('\t');
17. 
18.                            int type = Convert.ToInt32(fields[0]);
19.                            int id = Convert.ToInt32(fields[1]);
20.                            string name = fields[2];
21. 
22.                            if (i == items.Length - 1)
23.                                sb.AppendFormat("{0}\t{1}\t\t{2}", type, id, name);
24.                            else
25.                                sb.AppendFormat("{0}\t{1}\t\t{2}\r\n", type, id, name);
26.                        }
27. 
28.                        string output = sb.ToString();
29. 
30.                        Clipboard.SetData(DataFormats.Text, output);
31.                    }
32.                }
33. 
34.            }
35.            catch (Exception ex)
36.            {
37.                ExceptionHelper.ShowException("MappingRadGridViewPasting", ex);
38.            }
39.        }

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 02 Jun 2015
6 answers
334 views
Hi,

I have a grid with 3 aggregate footers, when the  user groups on a particular column I’m adding
the aggregate  values to the group
header, which works fine.

But I cannot get the text to align , I have tried to pad the
text with spaced with no success, here an image…


What I’m hoping to do is basically align / give the illusion
of  4 columns in the header,  one for the column title the other 3 for each  aggregate value.

Here's some code:

private void gviTicketSummary_GroupSummaryEvaluate(object sender, GroupSummaryEvaluationEventArgs e)
{
int i = 0;

if (e.SummaryItem == null)
return;

if (e.SummaryItem.Name == "Site")
{
int count = e.Group.ItemCount;
decimal PlannedQty = 0;
decimal ActualQty = 0;

foreach (GridViewRowInfo row in e.Group)
{
PlannedQty += Convert.ToDecimal(row.Cells["PlannedQty"].Value);
ActualQty += Convert.ToDecimal(row.Cells["ActualQty"].Value);
}

string sPlanned = PlannedQty.ToString("#,##0");
string sPlannedNew = PlannedQty.ToString("#,##0");

if (sPlanned.Length < 20)
sPlannedNew = sPlanned.PadRight(20, ' ');

string sActual = ActualQty.ToString("#,##0");
string sActualNew = ActualQty.ToString("#,##0");

if (sActual.Length < 20)
sActualNew = sActual.PadRight(20, ' ');

string site = e.Value.ToString().Trim();

string siteNew;
if (site.Length < 20)
{
siteNew = site.PadRight(20, ' ');
}
else
siteNew = site;


string Header = string.Concat(siteNew, " Planned Tonnes :", sPlannedNew, "Actual Tonnes : ", sActualNew);

// e.FormatString = String.Format("{0}Planned Tonnes : {1} Actual Tonnes : {2}", siteNew, sPlannedNew, sActualNew);

e.FormatString = Header;


}



Hope this makes sense

 

Thanks

 

Shaun

Jeen
Top achievements
Rank 1
 answered on 02 Jun 2015
1 answer
1.1K+ views

I'm looking for some clarification on the Bin and Bin40 directories.

I a previous thread there was mention that Bin was for .net 2.0 and Bin40 was for .net 4.0, but that doesn't really explain how the directories should be used. We build under .net 4.0.  Recently in our projects, we somehow found some references to assemblies in the Bin directory that were causing exceptions.  We never reference anything in that dir... at least not intentionally. 

Can someone explain the difference between what's in the Bin and Bin40 directories, why they exist and what developers need to know about them?   Thanks.  

Steve

 

Stefan
Telerik team
 answered on 02 Jun 2015
1 answer
135 views
how can i use a binding source to bind values to radColorBox  while binding source is list of string of color names
Dimitar
Telerik team
 answered on 01 Jun 2015
1 answer
226 views

Hi All,

in the former control I used the TextChanged Event with others to set a dirty flag providing the user a message to save his changes before leaving the Editor. In the current control the Event is not firing.

As an alternative I used the ContentChanged Event if the user changes any text. But this Event has the drawback that is fired after loading the form before the user had any chance to enter any character.

What can be done to get that scenario working.

 

Best Regards

Herbert

Dimitar
Telerik team
 answered on 01 Jun 2015
0 answers
121 views

how i can hide or set the icon in following snapshot,

 

Ammar
Top achievements
Rank 1
 asked on 01 Jun 2015
5 answers
838 views
Hello, I'm having problems with a gridview. I have a gridview control inside a panel that shrinks and grows with splitters. The gridview is initially configured to adjust it's columns using BestFit alghorithm and size mode is None. When the gridview is bigger than the parent panel, the scrollbars appear and viceversa. The problem appears when the user sets the GridView to autosize (Autosize columns mode to Fill). If the GridView width is smaller than the sum of the column's minimum width, I would expect that the horizontal scrollbar appears since the GridView shouldn't shrink anymore. But the behaviour is that the grid shrinks up to it's minum but the splitter crops the grid and the scrollbars don't appear.
Is there a workaround to this?
Are you fixing this anytime?

Below is the code and attached is an image of the running example.

Code behind:
using System;
using System.ComponentModel;
using System.Windows.Forms;
using Telerik.WinControls.UI;
  
namespace RadGridViewWithAutoSizeAndScolls
{
    public partial class Form1 : Form
    {
        private BindingList<Instrument> _list;
        private readonly int _gridMinimumSize;
  
        public Form1()
        {
            InitializeComponent();
              
            FillGridView();
  
            IntializeGrid(BestFitColumnMode.DisplayedCells);
  
        }
          
        private void IntializeGrid(BestFitColumnMode mode)
        {
            grdRatesMarkets.Dock = DockStyle.Fill;
              
            grdRatesMarkets.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.None;
  
            foreach (var column in grdRatesMarkets.Columns)
            {
                column.AutoSizeMode = mode;
            }
            grdRatesMarkets.MasterTemplate.BestFitColumns();
        }
  
        private void FillGridView()
        {
  
            var row1 = new Instrument((int)Instrument.Pairs.GBP_AUD)
            {
                Ask = "1",
                Bid = Convert.ToDecimal(Math.Sqrt(2)),
                LotAmount = 1,
                Direction = 1,
                High = 2,
                Low = -1,
                BuyMtm = "1",
                Time = DateTime.Now.AddHours(4).ToString()
            };
  
  
            var row2 = new Instrument((int)Instrument.Pairs.GBP_USD)
            {
                Ask = "1",
                Bid = 0,
                LotAmount = 1,
                Direction = 1,
                High = 2,
                Low = -1,
                BuyMtm = "1",
                Time = DateTime.Now.ToShortTimeString()
            };
            var row3 = new Instrument((int)Instrument.Pairs.GBP_HKD)
            {
                Ask = "1",
                Bid = 0,
                LotAmount = 1,
                Direction = 1,
                High = 2,
                Low = -1,
                BuyMtm = "1",
                Time = DateTime.Now.ToShortTimeString()
            };
            _list = new BindingList<Instrument> { (row1), (row2), (row3) };
            grdRatesMarkets.DataSource = _list;
  
        }
  
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            ChangeAutosizeGrid(checkBox1.Checked);
        }
  
        private void ChangeAutosizeGrid(bool autoSize)
        {
            if (autoSize)
            {
                grdRatesMarkets.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
                return;
            }
  
            grdRatesMarkets.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.None;
            IntializeGrid(BestFitColumnMode.DisplayedCells);
        }
    }
}

The designer class:
namespace RadGridViewWithAutoSizeAndScolls
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components;
  
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
  
        #region Windows Form Designer generated code
  
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            Telerik.WinControls.UI.GridViewImageColumn gridViewImageColumn1 = new Telerik.WinControls.UI.GridViewImageColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn1 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewCommandColumn gridViewCommandColumn1 = new Telerik.WinControls.UI.GridViewCommandColumn();
            Telerik.WinControls.UI.GridViewCommandColumn gridViewCommandColumn2 = new Telerik.WinControls.UI.GridViewCommandColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn1 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewCommandColumn gridViewCommandColumn3 = new Telerik.WinControls.UI.GridViewCommandColumn();
            Telerik.WinControls.UI.GridViewCommandColumn gridViewCommandColumn4 = new Telerik.WinControls.UI.GridViewCommandColumn();
            Telerik.WinControls.UI.GridViewDateTimeColumn gridViewDateTimeColumn1 = new Telerik.WinControls.UI.GridViewDateTimeColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn2 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn3 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn4 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn5 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn2 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn3 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn4 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn5 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn6 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn7 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn8 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
            this.splitContainer2 = new System.Windows.Forms.SplitContainer();
            this.grdRatesMarkets = new Telerik.WinControls.UI.RadGridView();
            this.checkBox1 = new System.Windows.Forms.CheckBox();
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
            this.splitContainer1.Panel1.SuspendLayout();
            this.splitContainer1.Panel2.SuspendLayout();
            this.splitContainer1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
            this.splitContainer2.Panel1.SuspendLayout();
            this.splitContainer2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.grdRatesMarkets)).BeginInit();
            this.SuspendLayout();
            // 
            // splitContainer1
            // 
            this.splitContainer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.splitContainer1.Location = new System.Drawing.Point(0, 0);
            this.splitContainer1.Name = "splitContainer1";
            this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
            // 
            // splitContainer1.Panel1
            // 
            this.splitContainer1.Panel1.Controls.Add(this.splitContainer2);
            // 
            // splitContainer1.Panel2
            // 
            this.splitContainer1.Panel2.Controls.Add(this.checkBox1);
            this.splitContainer1.Size = new System.Drawing.Size(540, 505);
            this.splitContainer1.SplitterDistance = 273;
            this.splitContainer1.TabIndex = 0;
            // 
            // splitContainer2
            // 
            this.splitContainer2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
            this.splitContainer2.Location = new System.Drawing.Point(0, 0);
            this.splitContainer2.Name = "splitContainer2";
            // 
            // splitContainer2.Panel1
            // 
            this.splitContainer2.Panel1.Controls.Add(this.grdRatesMarkets);
            this.splitContainer2.Size = new System.Drawing.Size(540, 273);
            this.splitContainer2.SplitterDistance = 312;
            this.splitContainer2.TabIndex = 0;
            // 
            // grdRatesMarkets
            // 
            this.grdRatesMarkets.AutoScroll = true;
            this.grdRatesMarkets.AutoSizeRows = true;
            this.grdRatesMarkets.Dock = System.Windows.Forms.DockStyle.Fill;
            this.grdRatesMarkets.Font = new System.Drawing.Font("Segoe UI", 8.25F);
            this.grdRatesMarkets.ImageScalingSize = new System.Drawing.Size(12, 12);
            this.grdRatesMarkets.Location = new System.Drawing.Point(0, 0);
            // 
            // grdRatesMarkets
            // 
            this.grdRatesMarkets.MasterTemplate.AllowAddNewRow = false;
            this.grdRatesMarkets.MasterTemplate.AllowCellContextMenu = false;
            this.grdRatesMarkets.MasterTemplate.AllowColumnChooser = false;
            this.grdRatesMarkets.MasterTemplate.AllowColumnHeaderContextMenu = false;
            this.grdRatesMarkets.MasterTemplate.AllowDeleteRow = false;
            this.grdRatesMarkets.MasterTemplate.AllowDragToGroup = false;
            gridViewImageColumn1.AllowFiltering = false;
            gridViewImageColumn1.AllowSort = false;
            gridViewImageColumn1.FieldName = "DirectionArrow";
            gridViewImageColumn1.HeaderText = "  ";
            gridViewImageColumn1.MaxWidth = 24;
            gridViewImageColumn1.MinWidth = 24;
            gridViewImageColumn1.Name = "DirectionArrow";
            gridViewImageColumn1.RowSpan = 24;
            gridViewImageColumn1.Width = 24;
            gridViewTextBoxColumn1.AllowFiltering = false;
            gridViewTextBoxColumn1.AllowGroup = false;
            gridViewTextBoxColumn1.AllowSort = false;
            gridViewTextBoxColumn1.FieldName = "Instrument";
            gridViewTextBoxColumn1.HeaderText = "Instrument";
            gridViewTextBoxColumn1.MinWidth = 20;
            gridViewTextBoxColumn1.Name = "InstrumentColumn";
            gridViewTextBoxColumn1.ReadOnly = true;
            gridViewCommandColumn1.AllowSort = false;
            gridViewCommandColumn1.DefaultText = "Sell";
            gridViewCommandColumn1.HeaderText = "  ";
            gridViewCommandColumn1.MinWidth = 40;
            gridViewCommandColumn1.Name = "SellColumn";
            gridViewCommandColumn1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
            gridViewCommandColumn1.UseDefaultText = true;
            gridViewCommandColumn2.AllowSort = false;
            gridViewCommandColumn2.DefaultText = "0";
            gridViewCommandColumn2.FieldName = "Bid";
            gridViewCommandColumn2.HeaderText = "Bid";
            gridViewCommandColumn2.MinWidth = 50;
            gridViewCommandColumn2.Name = "BidColumn";
            gridViewDecimalColumn1.AllowFiltering = false;
            gridViewDecimalColumn1.AllowGroup = false;
            gridViewDecimalColumn1.AllowSort = false;
            gridViewDecimalColumn1.DecimalPlaces = 0;
            gridViewDecimalColumn1.FieldName = "LotAmount";
            gridViewDecimalColumn1.HeaderText = "Lot Amount";
            gridViewDecimalColumn1.Maximum = new decimal(new int[] {
            100,
            0,
            0,
            0});
            gridViewDecimalColumn1.Minimum = new decimal(new int[] {
            1,
            0,
            0,
            0});
            gridViewDecimalColumn1.MinWidth = 30;
            gridViewDecimalColumn1.Name = "LotAmount";
            gridViewDecimalColumn1.TextAlignment = System.Drawing.ContentAlignment.MiddleRight;
            gridViewDecimalColumn1.VisibleInColumnChooser = false;
            gridViewCommandColumn3.AllowSort = false;
            gridViewCommandColumn3.DefaultText = "0";
            gridViewCommandColumn3.FieldName = "Ask";
            gridViewCommandColumn3.HeaderText = "Ask";
            gridViewCommandColumn3.MinWidth = 50;
            gridViewCommandColumn3.Name = "AskColumn";
            gridViewCommandColumn4.AllowSort = false;
            gridViewCommandColumn4.DefaultText = "Buy";
            gridViewCommandColumn4.HeaderText = "  ";
            gridViewCommandColumn4.MinWidth = 40;
            gridViewCommandColumn4.Name = "BuyColumn";
            gridViewCommandColumn4.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
            gridViewCommandColumn4.UseDefaultText = true;
            gridViewDateTimeColumn1.AllowFiltering = false;
            gridViewDateTimeColumn1.AllowGroup = false;
            gridViewDateTimeColumn1.AllowSort = false;
            gridViewDateTimeColumn1.FieldName = "Time";
            gridViewDateTimeColumn1.HeaderText = "Time";
            gridViewDateTimeColumn1.MinWidth = 20;
            gridViewDateTimeColumn1.Name = "TimeColumn";
            gridViewDateTimeColumn1.ReadOnly = true;
            gridViewDecimalColumn2.AllowFiltering = false;
            gridViewDecimalColumn2.AllowGroup = false;
            gridViewDecimalColumn2.AllowSort = false;
            gridViewDecimalColumn2.FieldName = "High";
            gridViewDecimalColumn2.HeaderText = "High";
            gridViewDecimalColumn2.MinWidth = 20;
            gridViewDecimalColumn2.Name = "HighColumn";
            gridViewDecimalColumn2.ReadOnly = true;
            gridViewDecimalColumn2.TextAlignment = System.Drawing.ContentAlignment.MiddleRight;
            gridViewDecimalColumn3.AllowFiltering = false;
            gridViewDecimalColumn3.AllowGroup = false;
            gridViewDecimalColumn3.AllowSort = false;
            gridViewDecimalColumn3.FieldName = "Low";
            gridViewDecimalColumn3.HeaderText = "Low";
            gridViewDecimalColumn3.MinWidth = 20;
            gridViewDecimalColumn3.Name = "LowColumn";
            gridViewDecimalColumn3.ReadOnly = true;
            gridViewDecimalColumn3.TextAlignment = System.Drawing.ContentAlignment.MiddleRight;
            gridViewDecimalColumn4.AllowFiltering = false;
            gridViewDecimalColumn4.AllowGroup = false;
            gridViewDecimalColumn4.AllowSort = false;
            gridViewDecimalColumn4.FieldName = "PrmSell";
            gridViewDecimalColumn4.HeaderText = "PrmSell%";
            gridViewDecimalColumn4.MinWidth = 20;
            gridViewDecimalColumn4.Name = "PrmSellColumn";
            gridViewDecimalColumn4.ReadOnly = true;
            gridViewDecimalColumn4.TextAlignment = System.Drawing.ContentAlignment.MiddleRight;
            gridViewDecimalColumn5.AllowFiltering = false;
            gridViewDecimalColumn5.AllowGroup = false;
            gridViewDecimalColumn5.AllowSort = false;
            gridViewDecimalColumn5.FieldName = "PrmBuy";
            gridViewDecimalColumn5.HeaderText = "PrmBuy%";
            gridViewDecimalColumn5.MinWidth = 20;
            gridViewDecimalColumn5.Name = "PrmBuyColumn";
            gridViewDecimalColumn5.ReadOnly = true;
            gridViewDecimalColumn5.TextAlignment = System.Drawing.ContentAlignment.MiddleRight;
            gridViewTextBoxColumn2.AllowFiltering = false;
            gridViewTextBoxColumn2.AllowGroup = false;
            gridViewTextBoxColumn2.AllowSort = false;
            gridViewTextBoxColumn2.FieldName = "Alarm";
            gridViewTextBoxColumn2.HeaderText = "Alarm";
            gridViewTextBoxColumn2.MinWidth = 20;
            gridViewTextBoxColumn2.Name = "AlarmColumn";
            gridViewTextBoxColumn2.ReadOnly = true;
            gridViewTextBoxColumn2.Width = 54;
            gridViewTextBoxColumn3.AllowFiltering = false;
            gridViewTextBoxColumn3.AllowGroup = false;
            gridViewTextBoxColumn3.AllowSort = false;
            gridViewTextBoxColumn3.FieldName = "SellAmount";
            gridViewTextBoxColumn3.HeaderText = "Sell-Amount";
            gridViewTextBoxColumn3.IsVisible = false;
            gridViewTextBoxColumn3.Name = "SellAmountColumn";
            gridViewTextBoxColumn3.ReadOnly = true;
            gridViewTextBoxColumn4.AllowFiltering = false;
            gridViewTextBoxColumn4.AllowGroup = false;
            gridViewTextBoxColumn4.AllowSort = false;
            gridViewTextBoxColumn4.FieldName = "SellMtm";
            gridViewTextBoxColumn4.HeaderText = "Sell-MTM P/L";
            gridViewTextBoxColumn4.IsVisible = false;
            gridViewTextBoxColumn4.Name = "SellMtmPLColumn";
            gridViewTextBoxColumn4.ReadOnly = true;
            gridViewTextBoxColumn5.AllowFiltering = false;
            gridViewTextBoxColumn5.AllowGroup = false;
            gridViewTextBoxColumn5.AllowSort = false;
            gridViewTextBoxColumn5.FieldName = "BuyAmount";
            gridViewTextBoxColumn5.HeaderText = "Buy-Amount";
            gridViewTextBoxColumn5.IsVisible = false;
            gridViewTextBoxColumn5.Name = "BuyAmountColumn";
            gridViewTextBoxColumn5.ReadOnly = true;
            gridViewTextBoxColumn6.AllowFiltering = false;
            gridViewTextBoxColumn6.AllowGroup = false;
            gridViewTextBoxColumn6.AllowSort = false;
            gridViewTextBoxColumn6.HeaderText = "Buy-MTM P/L";
            gridViewTextBoxColumn6.IsVisible = false;
            gridViewTextBoxColumn6.Name = "BuyMtmPLColumn";
            gridViewTextBoxColumn6.ReadOnly = true;
            gridViewTextBoxColumn7.AllowFiltering = false;
            gridViewTextBoxColumn7.AllowGroup = false;
            gridViewTextBoxColumn7.AllowSort = false;
            gridViewTextBoxColumn7.HeaderText = "Net Amount";
            gridViewTextBoxColumn7.IsVisible = false;
            gridViewTextBoxColumn7.Name = "NetAmountColumn";
            gridViewTextBoxColumn7.ReadOnly = true;
            gridViewTextBoxColumn8.AllowFiltering = false;
            gridViewTextBoxColumn8.AllowGroup = false;
            gridViewTextBoxColumn8.AllowSort = false;
            gridViewTextBoxColumn8.HeaderText = "Net MTM P/L";
            gridViewTextBoxColumn8.IsVisible = false;
            gridViewTextBoxColumn8.Name = "NetMtmPLColumn";
            gridViewTextBoxColumn8.ReadOnly = true;
            this.grdRatesMarkets.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] {
            gridViewImageColumn1,
            gridViewTextBoxColumn1,
            gridViewCommandColumn1,
            gridViewCommandColumn2,
            gridViewDecimalColumn1,
            gridViewCommandColumn3,
            gridViewCommandColumn4,
            gridViewDateTimeColumn1,
            gridViewDecimalColumn2,
            gridViewDecimalColumn3,
            gridViewDecimalColumn4,
            gridViewDecimalColumn5,
            gridViewTextBoxColumn2,
            gridViewTextBoxColumn3,
            gridViewTextBoxColumn4,
            gridViewTextBoxColumn5,
            gridViewTextBoxColumn6,
            gridViewTextBoxColumn7,
            gridViewTextBoxColumn8});
            this.grdRatesMarkets.MasterTemplate.EnableSorting = false;
            this.grdRatesMarkets.MasterTemplate.ShowFilteringRow = false;
            this.grdRatesMarkets.MasterTemplate.ShowRowHeaderColumn = false;
            this.grdRatesMarkets.Name = "grdRatesMarkets";
            // 
            // 
            // 
            this.grdRatesMarkets.RootElement.AccessibleDescription = null;
            this.grdRatesMarkets.RootElement.AccessibleName = null;
            this.grdRatesMarkets.RootElement.Alignment = System.Drawing.ContentAlignment.TopLeft;
            this.grdRatesMarkets.RootElement.AngleTransform = 0F;
            this.grdRatesMarkets.RootElement.FlipText = false;
            this.grdRatesMarkets.RootElement.Margin = new System.Windows.Forms.Padding(0);
            this.grdRatesMarkets.RootElement.MinSize = new System.Drawing.Size(0, 0);
            this.grdRatesMarkets.RootElement.Padding = new System.Windows.Forms.Padding(0);
            this.grdRatesMarkets.RootElement.Text = null;
            this.grdRatesMarkets.RootElement.TextOrientation = System.Windows.Forms.Orientation.Horizontal;
            this.grdRatesMarkets.ShowCellErrors = false;
            this.grdRatesMarkets.ShowGroupPanel = false;
            this.grdRatesMarkets.ShowNoDataText = false;
            this.grdRatesMarkets.ShowRowErrors = false;
            this.grdRatesMarkets.Size = new System.Drawing.Size(310, 271);
            this.grdRatesMarkets.TabIndex = 1;
            // 
            // checkBox1
            // 
            this.checkBox1.AutoSize = true;
            this.checkBox1.Location = new System.Drawing.Point(210, 101);
            this.checkBox1.Name = "checkBox1";
            this.checkBox1.Size = new System.Drawing.Size(66, 17);
            this.checkBox1.TabIndex = 0;
            this.checkBox1.Text = "Autosize";
            this.checkBox1.UseVisualStyleBackColor = true;
            this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(540, 505);
            this.Controls.Add(this.splitContainer1);
            this.Name = "Form1";
            this.Text = "Form1";
            this.splitContainer1.Panel1.ResumeLayout(false);
            this.splitContainer1.Panel2.ResumeLayout(false);
            this.splitContainer1.Panel2.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
            this.splitContainer1.ResumeLayout(false);
            this.splitContainer2.Panel1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
            this.splitContainer2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.grdRatesMarkets)).EndInit();
            this.ResumeLayout(false);
  
        }
  
        #endregion
  
        private System.Windows.Forms.SplitContainer splitContainer1;
        private System.Windows.Forms.SplitContainer splitContainer2;
        private Telerik.WinControls.UI.RadGridView grdRatesMarkets;
        private System.Windows.Forms.CheckBox checkBox1;
    }
}
Stefan
Telerik team
 answered on 01 Jun 2015
4 answers
379 views

I have RadTreeView with  MultiSelect = true;  When I’m programmatically select any node in tree like

radTreeView.Nodes[0].Nodes[0] = true;

radTreeView.Nodes[0].Nodes[1] = true;

 

I expect then event SelectedNodeChanged will be fired, but it isn’t. It is a big problem, because I can’t handle when my nodes being selected.

We are using Telerik RadControls_WinForms_2012_3_1211

p.s. when I select node by this way: radTreeView.SelectedNode = radTreeView.Nodes[0].Nodes[1], event fires successfully, but using this method I can’t select multiple nodes from code.


How do you suggest to resolve this?
Stephen McDaniel
Top achievements
Rank 1
 answered on 29 May 2015
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Styling
Barcode
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?