Telerik Forums
UI for WinForms Forum
4 answers
308 views
Hi!

How can I remove the dotted vertical line positioned on the left side of a CommandBar?

Thanks!
Franco
Top achievements
Rank 1
 answered on 23 Jan 2012
15 answers
3.0K+ views
Hi Telerik

I face this case: we can you click a button by using right click of the mouse. How to disable it?
Thanks
Nikolay
Telerik team
 answered on 21 Jan 2012
3 answers
524 views
Hi Telerik Support Team:

  1. How to create  a Rad MDI form to the application ?
    Because I see there is no option to add the MDI form from the add windows forms dialog.
  2. I like to have a RadRibbonForm as my MDI parent form -- How to do this?
    and how to add RadForm as MDI child form for the above RadRibbonForm (MDI parent form)

Expecting your valuable reply please.
Regards,
Thiru.
Nikolay
Telerik team
 answered on 21 Jan 2012
2 answers
478 views
I need to have a column in the grid where a user can either select a value from a list or type in a value. For example, if the user is enter a face amount for a life insurance policy the user can either select one of these three options: Minimum, Maximum, Target or enter a number from 100,000 to 10,000,000.

I tried using the GridViewComboBoxColumn and setting the DropDownStyle to DropDown. This allowed me to edit the value in the cell, but when I leave the cell, the cell's display value flips back to what it was previously.

In the example attached, click on the first row where it says 'Minimum' and type in 100000, then hit the tab key to move to a new cell. The cell flips from 100000 back to 'Minimum'.

Is there a way to use the GridViewComboBoxColumn to allow the user to either select a value from the drop down list or type in a value?

Here is the Form1.Designer.cs file:

namespace GridComboBoxColumn
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;
 
        /// <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()
        {
            this._grid = new Telerik.WinControls.UI.RadGridView();
            ((System.ComponentModel.ISupportInitialize)(this._grid)).BeginInit();
            this.SuspendLayout();
            //
            // _grid
            //
            this._grid.Location = new System.Drawing.Point(13, 13);
            this._grid.Name = "_grid";
            this._grid.Size = new System.Drawing.Size(259, 237);
            this._grid.TabIndex = 0;
            this._grid.Text = "radGridView1";
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(284, 262);
            this.Controls.Add(this._grid);
            this.Name = "Form1";
            this.Text = "Form1";
            ((System.ComponentModel.ISupportInitialize)(this._grid)).EndInit();
            this.ResumeLayout(false);
 
        }
 
        #endregion
 
        private Telerik.WinControls.UI.RadGridView _grid;
 
    }
}

Here is the sample Form1.cs file:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
 
using Telerik.WinControls.Primitives;
using Telerik.WinControls.UI;
 
namespace GridComboBoxColumn
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
 
            SetupGrid();
        }
 
        private void SetupGrid()
        {
            // Add Column
            {
                GridViewComboBoxColumn column = new GridViewComboBoxColumn();
                column.Name = "Policy.FaceAmount";
                column.HeaderText = "Total Face Amount";
                column.ValueMember = "Value";
                column.DisplayMember = "Name";
                column.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
                column.ReadOnly = false;
 
                BindingList<QuestionSelectionItem> list = new BindingList<QuestionSelectionItem>();
 
                list.Add(new QuestionSelectionItem("Minimum", "MIN"));
                list.Add(new QuestionSelectionItem("Maxmimum", "MAX"));
                list.Add(new QuestionSelectionItem("Target", "TGT"));
 
                column.DataSource = list;
 
                _grid.Columns.Add(column);
            }
 
            // Add Row
            {
                // First Row
                {
                    GridViewRowInfo row = _grid.Rows.AddNew();
 
                    row.Cells["Policy.FaceAmount"].Value = "MIN";
                }
 
                // Second Row
                {
                    GridViewRowInfo row = _grid.Rows.AddNew();
 
                    row.Cells["Policy.FaceAmount"].Value = "100000";
                }
 
                // Third Row
                {
                    GridViewRowInfo row = _grid.Rows.AddNew();
 
                    row.Cells["Policy.FaceAmount"].Value = "MAX";
                }
            }
        }
 
        protected class QuestionSelectionItem
        {
            private string _name = null;
            private string _value = null;
 
            public QuestionSelectionItem(string aName, string aValue)
            {
                _name = aName;
                _value = aValue;
            }
 
            public string Name
            {
                get { return _name; }
                set { _name = value; }
            }
 
            public string Value
            {
                get { return _value; }
                set { _value = value; }
            }
        }
    }
}
Troy
Top achievements
Rank 1
 answered on 20 Jan 2012
4 answers
329 views
Hi,
I would like to add 
a DateTimePicker to a CommandBar. Is this Possible? How can it be done?
Thanks
Nikita
Top achievements
Rank 2
 answered on 20 Jan 2012
4 answers
167 views
Hey Telerik,

I've discovered a memory leak issue when repeatedly auto-hiding then docking a ToolWindow in a RadDock.

I'm designing an application using the MVVM design pattern with a basic View and View-Model. The View is a form that contains a RadDock with a ToolWindow, and data-binding setup to the ToolWindow's property "DockState." The View-Model contains the bound property "ToolWindow1DockState" that uses INotifyPropertyChanged to update the ToolWindow's property "DockState". Below is my code, attached is my View's designer.

View
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using RadDockMemoryTest.ViewModel;
 
namespace RadDockMemoryTest.View
{
    public partial class Form1 : Form
    {
        private MainViewModel viewModel;
        /// <summary>
        /// View Model object
        /// </summary>
        public MainViewModel ViewModel
        {
            get
            {
                if (viewModel == null)
                {
                    ViewModel = new MainViewModel();
                }
                return viewModel;
            }
            set { viewModel = value; }
        }
         
        /// <summary>
        /// Form default constructor
        /// </summary>
        public Form1()
        {
            InitializeComponent();
        }
 
        /// <summary>
        /// Form load event handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Form1_Load(object sender, EventArgs e)
        {
            setupControlBindings();
        }
 
        /// <summary>
        /// Setup window's control bindings
        /// </summary>
        private void setupControlBindings()
        {
            radDock1.DockWindows["toolWindow1"].DataBindings.Add("DockState", ViewModel, "ToolWindow1DockState", true, DataSourceUpdateMode.Never);
        }
    }
}

ViewModel
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Telerik.WinControls.UI.Docking;
 
namespace RadDockMemoryTest.ViewModel
{
    public class MainViewModel : ViewModelBase
    {
        private DockState toolWindow1DockState;
        /// <summary>
        /// Controls toolWindow1's dock state
        /// </summary>
        public DockState ToolWindow1DockState
        {
            get { return toolWindow1DockState; }
            set
            {
                toolWindow1DockState = value;
                OnPropertyChanged("ToolWindow1DockState");
            }
        }
    }
}

I setup a Window's automation tool to execute the following sequence:
1. Click "Auto-hide" on the docked ToolWindow.
2. Click the ToolWindow tab.
3. Click "Docked" to restore the ToolWindow to its docked state.

After letting the automation run overnight and observing memory processes in Windows Task Manager, I noticed the application's memory usage jumped from 32,000KB to 800,000KB.

How can I avoid the memory leak?

Thanks,
Eljay
Eljay
Top achievements
Rank 1
 answered on 20 Jan 2012
1 answer
88 views
Hi,
I have a aesthetical issue when editing the grid which can be seen in the Q3 SP1 demos under Columns, Grid Views.  If you change the view to TableView and click in the Phone Column, the grid slightly "jumps" to the left.  If you then click in the ID Column, the grid slightly "jumps" to the right.  This is most noticeable if you look at the column headers.

Any ideas?

Thanks,
David A.
Jack
Telerik team
 answered on 20 Jan 2012
4 answers
254 views
Hi is there a way to loop through listview customvisualitems and reach lightvisualelements in order to set visiblity for example
structure of my listview goes like that :
radlistview ---->customvisualitem---->stacklayoutpanel---->lightvisualelement1,lighvisualelement2
so my problem is that i need the right code in order to reach lightvisualelements and apply action on them.
if there any code that helps i appreciate help .
Best Regards, jack
Ivan Todorov
Telerik team
 answered on 20 Jan 2012
8 answers
138 views

Hi
I would like to build an application like the Integration Business cards example Could you tell me how to construct or add a gallery to a form?

Ivan Todorov
Telerik team
 answered on 20 Jan 2012
3 answers
222 views
Hello,

I am trying to divide the column header of some columns in two with the HtmlViewDefinition of the RadGridView. My table is not so complex for the moment but I just can't make it work....

I attached an Excel file screenshot to this message so you can have a look to what I want to do and below is the code I wrote so far:

radGridViewSaleReport.DataSource = myList; //binding list
 
 
HtmlViewDefinition view = new HtmlViewDefinition();
 
view.RowTemplate.Rows.Add(new RowDefinition());
view.RowTemplate.Rows.Add(new RowDefinition());
view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Customer Name"));
view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Unit"));
view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Unit Type"));
view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Unit Area"));
view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Price/Sq.M."));
view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Selling Price"));
view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Initial booking"));
view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Booking"));
view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Signing Contract"));
view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Contract signed"));
view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Transfer"));
view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Sale"));
view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Comment"));
view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Amount"));
view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Date"));
view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Amount"));
view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Date"));
view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Amount"));
view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Date"));
view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Amount"));
view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Date"));
 
view.RowTemplate.Rows[0].Cells[0].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[1].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[2].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[3].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[4].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[5].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[9].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[11].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[12].RowSpan = 2;
view.RowTemplate.Rows[0].Cells[6].ColSpan = 2;
view.RowTemplate.Rows[0].Cells[7].ColSpan = 2;
view.RowTemplate.Rows[0].Cells[8].ColSpan = 2;
view.RowTemplate.Rows[0].Cells[10].ColSpan = 2;
 
radGridViewSaleReport.Update();
this.radGridViewSaleReport.ViewDefinition = view;
this.radGridViewSaleReport.TableElement.CellSpacing = -1;
this.radGridViewSaleReport.TableElement.RowSpacing = -1;

I have a binding list full of data in it which I give to the radgridview and then I define the view and apply the view to the radgridview after updating it.

With this code, the radgridview look like the screenshot radgridview result.

Any idea how to display the data correctly into the radgridview?

Thanks,
LB
Jack
Telerik team
 answered on 20 Jan 2012
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
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
CheckedDropDownList
TrackBar
MessageBox
Rotator
SpinEditor
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
NavigationView
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
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
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?