Telerik Forums
UI for WinForms Forum
1 answer
152 views
Can the resource height be changed?
Ivan Todorov
Telerik team
 answered on 19 Oct 2011
1 answer
251 views
Hello,

In the ASP.NET version of your components the RadTextBox also contains a password strength bar (depending on the password strength the bar colors green/yellow/red. 

Is there a possibility to have the same functionality in the Winforms version of the components?

Thank you
Ivan Petrov
Telerik team
 answered on 19 Oct 2011
2 answers
256 views
Hello,

I need some help here. Here is my situation:

I have a binding list which contains another binding list which I use as data source. below is an example:

Objects:

public class test
{
        public string name { get; set; }
        public BindingList<childs> childlist { get; set; }
}
public class childs
{
        public string childname { get; set; }
}

I populate my radgrid by code. below is a preview:
private void form_Load(object sender, EventArgs e)
 {
            BindingList<test> testlist = new BindingList<test>();
 
            /** I populate my list with data. I wont show this here. After the list is populated: **//
 
            this.raggrid.MasterTemplate.Columns.Clear();
            this.raggrid.MasterTemplate.AutoGenerateColumns = true;
            this.raggrid.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
            this.raggrid.MasterTemplate.Columns.Add(new GridViewTextBoxColumn("name", "name"));
 
            GridViewTemplate template = new GridViewTemplate();
            this.raggrid.Templates.Add(template);
            template.Columns.Add(new GridViewTextBoxColumn("name", "childname"));
            template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
            GridViewRelation relation = new GridViewRelation(this.raggrid.MasterTemplate, template);
            relation.ChildColumnNames.Add("childlist");
            this.raggrid.Relations.Add(relation);
            this.raggrid.DataSource = testlist;
}

The populating step works fine. But now, when the user edits the detail grid(named template from the code), I must update the binding list accordingly (named testlist from the code). I cannot seem to trigger an event when I edit the child grid. How do I achieve this?

PS: When I update the master template the binding list gets updated automatically as expected, but when I update the template I use as detail, it does not update the biding list.
Thanks,

Yash
Yash
Top achievements
Rank 1
 answered on 18 Oct 2011
7 answers
200 views
Hi all,


Retaining Gridview filtering:
I have radgrid in my form.
My requirement is i am giving filter conditions to some columns.
Now I want to edit a row,so after I go to the edit page and return to the grid I want to see my grid in the same page.
 grid will be lost upon Rebind(). After Update also i want to maintain same filtering conditions.

How can i achieve this??
Stefan
Telerik team
 answered on 18 Oct 2011
1 answer
193 views
Hi
How to set one column of RadGridView and doesn't allow moving position. 
Example:
I have Columns: A B C
A: fixed
B and C: switch together
Ivan Petrov
Telerik team
 answered on 18 Oct 2011
2 answers
147 views
Hi Telerik,

This isn't a question (unless you see ways to improve the class). Just giving a little back for all the help you guys have passed my way in the last year.

The class below allows a button to be placed in the Group Header cells of a grouped GridView and be able to subscribe to the button's clickevent. The event args pass back the GridViewGroupRowInfo. I'm using it to be able to identify and manipulate only the data rows associated with the particular group in question.

Hope some finds it useful
Regards
Ian

 
{
    public delegate void GroupHeaderCellButtonClickEventHandler(object sender, GroupHeaderButtonClickEventArgs e);
  
    public partial class CustomGridView : RadGridView
    {
        public event GroupHeaderCellButtonClickEventHandler GroupHeaderCellButtonClick;
  
        public CustomGridView()
        {
            InitializeComponent();
            base.CreateCell += new GridViewCreateCellEventHandler(CustomGridView_CreateCell);
        }
  
        void CustomGridView_CreateCell(object sender, GridViewCreateCellEventArgs e)
        {
  
            if (e.CellType == typeof(GridGroupContentCellElement) && e.Row.GetType() == typeof(GridGroupHeaderRowElement))
            {
                e.CellElement = new RadCustomGroupContentCell(e.Column, e.Row);
                RadCustomGroupContentCell cellElement = (RadCustomGroupContentCell)e.CellElement;
                cellElement.InternalGroupHeaderCellButtonClick+=new GroupHeaderCellButtonClickEventHandler(cellElement_InternalGroupHeaderCellButtonClick);
            }
        }
  
  
        void  cellElement_InternalGroupHeaderCellButtonClick(object sender, GroupHeaderButtonClickEventArgs e)
        {
            if (GroupHeaderCellButtonClick != null)
            {
                GroupHeaderCellButtonClick(sender, e);
            }
        }
  
        public override string ThemeClassName
        {
            get
            {
                return typeof(RadGridView).FullName;
            }
            set
            { }
        }
  
        protected internal class RadCustomGroupContentCell : GridGroupContentCellElement
        {
            public event GroupHeaderCellButtonClickEventHandler InternalGroupHeaderCellButtonClick;
            RadButtonElement theButton;
  
            public RadCustomGroupContentCell(GridViewColumn column, GridRowElement row)
                : base(column, row)
            {
  
            }
  
            protected override void DisposeManagedResources()
            {
                theButton.Click -= new EventHandler(theButton_Click);
                base.DisposeManagedResources();
            }
  
            void theButton_Click(object sender, EventArgs e)
            {
                InternalGroupHeaderCellButtonClick(sender, new GroupHeaderButtonClickEventArgs((GridViewGroupRowInfo)this.RowInfo));
            }
  
            protected override void CreateChildElements()
            {
                base.CreateChildElements();
  
                theButton = new RadButtonElement();
                theButton.Click += new EventHandler(theButton_Click);
                theButton.Text = "Insert";
                theButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
                theButton.Image = Resources.InsertRow16;
                this.Children.Add(theButton);
            }
  
            protected override SizeF ArrangeOverride(SizeF finalSize)
            {
                SizeF size = base.ArrangeOverride(finalSize);
  
                float buttonX =2;
                float buttonY = 4;
  
                RectangleF buttonRectangle = new RectangleF(buttonX, buttonY, theButton.DesiredSize.Width + 4, theButton.DesiredSize.Height + 2);
                theButton.Arrange(buttonRectangle);
  
                float buttonAndTextX = theButton.DesiredSize.Width + 4;
                RectangleF clientRect = new RectangleF(buttonAndTextX + buttonX, 0, finalSize.Width - buttonAndTextX - buttonX, finalSize.Height + 4);
                this.layoutManagerPart.Arrange(clientRect);
  
                return size;
            }
  
            protected override Type ThemeEffectiveType
            {
                get
                {
                    return typeof(GridGroupContentCellElement);
                }
                set
                { }
            }
        }
    }
}


The Event args look like this although more could be added as needed I imagine

public class GroupHeaderButtonClickEventArgs:EventArgs
{
    public GridViewGroupRowInfo GroupRowInfo
    { get; set; }
    public GroupHeaderButtonClickEventArgs(GridViewGroupRowInfo groupRowInfo)
    {
        this.GroupRowInfo = groupRowInfo;
    }
}
Svett
Telerik team
 answered on 18 Oct 2011
3 answers
201 views
The MultiColumnComboBox currently selects the correct value in the popup when using the ENTER key. I want to achieve the same behavior with the TAB key but I haven't succeeded.

Also, if the user's text is not associated to any of the items, I want to empty the textbox so that he sees that's not a valid option.

Thanks!

Sample code :

using System.Collections.Generic;
using System.Windows.Forms;
using Telerik.WinControls;
using Telerik.WinControls.Data;
using Telerik.WinControls.UI;
 
namespace MultiColumnComboAutoSelectWithTab
{
    public class RandomObject
    {
        public int Id { get; set; }
        public string FirstStuff { get; set; }
        public string SecondStuff { get; set; }
 
        public RandomObject(int id, string first, string second)
        {
            this.Id = id;
            this.FirstStuff = first;
            this.SecondStuff = second;
        }
 
    }
    public class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
 
            InitializeCustomComponent();
 
            var lst = new List<RandomObject>();
            lst.Add(new RandomObject(1, "Albert", "Stuff"));
            lst.Add(new RandomObject(2, "Alphonse", "Stuff"));
 
            this.radMultiColumnComboBox1.DataSource = lst;
        }
 
        private void InitializeCustomComponent()
        {
            this.radMultiColumnComboBox1.DisplayMember = "FirstStuff";
            this.radMultiColumnComboBox1.ValueMember = "Id";
 
            this.radMultiColumnComboBox1.EditorControl.Columns.Add(new GridViewTextBoxColumn("Id", "Id"));
            this.radMultiColumnComboBox1.EditorControl.Columns["Id"].IsVisible = false;
            this.radMultiColumnComboBox1.EditorControl.Columns.Add(new GridViewTextBoxColumn("FirstStuff", "FirstStuff"));
            this.radMultiColumnComboBox1.EditorControl.Columns["FirstStuff"].HeaderText = "First stuff";
            this.radMultiColumnComboBox1.EditorControl.Columns.Add(new GridViewTextBoxColumn("SecondStuff", "SecondStuff"));
            this.radMultiColumnComboBox1.EditorControl.Columns["SecondStuff"].HeaderText = "SecondStuff";
 
            this.radMultiColumnComboBox1.AutoFilter = true;
            this.radMultiColumnComboBox1.DropDownStyle = RadDropDownStyle.DropDown;
            this.radMultiColumnComboBox1.AutoSize = true;
            this.radMultiColumnComboBox1.AutoSizeDropDownToBestFit = true;
 
            var filter = new FilterDescriptor(this.radMultiColumnComboBox1.DisplayMember, FilterOperator.StartsWith, string.Empty);
            this.radMultiColumnComboBox1.EditorControl.MasterTemplate.FilterDescriptors.Add(filter);
        }
 
        /// <summary>
        /// Variable nécessaire au concepteur.
        /// </summary>
        private System.ComponentModel.IContainer components = null;
 
        /// <summary>
        /// Nettoyage des ressources utilisées.
        /// </summary>
        /// <param name="disposing">true si les ressources managées doivent être supprimées ; sinon, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
 
        #region AutoGeneratedStuff
 
        private void InitializeComponent()
        {
            this.radMultiColumnComboBox1 = new Telerik.WinControls.UI.RadMultiColumnComboBox();
            this.radTextBox1 = new Telerik.WinControls.UI.RadTextBox();
            ((System.ComponentModel.ISupportInitialize)(this.radMultiColumnComboBox1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.radTextBox1)).BeginInit();
            this.SuspendLayout();
            //
            // radMultiColumnComboBox1
            //
            //
            // radMultiColumnComboBox1.NestedRadGridView
            //
            this.radMultiColumnComboBox1.EditorControl.BackColor = System.Drawing.SystemColors.Window;
            this.radMultiColumnComboBox1.EditorControl.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.radMultiColumnComboBox1.EditorControl.ForeColor = System.Drawing.SystemColors.ControlText;
            this.radMultiColumnComboBox1.EditorControl.Location = new System.Drawing.Point(0, 0);
            //
            //
            //
            this.radMultiColumnComboBox1.EditorControl.MasterTemplate.AllowAddNewRow = false;
            this.radMultiColumnComboBox1.EditorControl.MasterTemplate.AllowCellContextMenu = false;
            this.radMultiColumnComboBox1.EditorControl.MasterTemplate.AllowColumnChooser = false;
            this.radMultiColumnComboBox1.EditorControl.MasterTemplate.EnableGrouping = false;
            this.radMultiColumnComboBox1.EditorControl.MasterTemplate.ShowFilteringRow = false;
            this.radMultiColumnComboBox1.EditorControl.Name = "NestedRadGridView";
            this.radMultiColumnComboBox1.EditorControl.ReadOnly = true;
            this.radMultiColumnComboBox1.EditorControl.ShowGroupPanel = false;
            this.radMultiColumnComboBox1.EditorControl.Size = new System.Drawing.Size(240, 150);
            this.radMultiColumnComboBox1.EditorControl.TabIndex = 0;
            this.radMultiColumnComboBox1.Location = new System.Drawing.Point(81, 78);
            this.radMultiColumnComboBox1.Name = "radMultiColumnComboBox1";
            //
            //
            //
            this.radMultiColumnComboBox1.RootElement.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren;
            this.radMultiColumnComboBox1.Size = new System.Drawing.Size(369, 20);
            this.radMultiColumnComboBox1.TabIndex = 0;
            this.radMultiColumnComboBox1.TabStop = false;
            this.radMultiColumnComboBox1.Text = "radMultiColumnComboBox1";
            //
            // radTextBox1
            //
            this.radTextBox1.Location = new System.Drawing.Point(81, 131);
            this.radTextBox1.Name = "radTextBox1";
            this.radTextBox1.Size = new System.Drawing.Size(330, 20);
            this.radTextBox1.TabIndex = 1;
            this.radTextBox1.TabStop = false;
            this.radTextBox1.Text = "radTextBox1";
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(498, 266);
            this.Controls.Add(this.radTextBox1);
            this.Controls.Add(this.radMultiColumnComboBox1);
            this.Name = "Form1";
            this.Text = "Form1";
            ((System.ComponentModel.ISupportInitialize)(this.radMultiColumnComboBox1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.radTextBox1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();
 
        }
 
        #endregion
 
        private Telerik.WinControls.UI.RadMultiColumnComboBox radMultiColumnComboBox1;
        private Telerik.WinControls.UI.RadTextBox radTextBox1;
    }
}
Francois
Top achievements
Rank 1
 answered on 18 Oct 2011
11 answers
784 views
hi,

I have Implemented Export to Excel for A RadGridView Content. It is working.
But the problem here is, I have child templetes also in my application.

Can you please tell me how to export The RadGridView content including Child templates
Or is there any property to be assigned.

Thank you.

regards,
Mahitha Madala.
Martin Vasilev
Telerik team
 answered on 17 Oct 2011
7 answers
225 views
Hi there,

I'd really like to make use of the GridViewMultiComboBoxColumn but I'm finding a few problems.

I have the DataSource property of the column bound to a collection of business objects.  That object has all sorts of properties and I really only want to show 2 of them.

I don't see any examples of the GridViewMultiComboBoxColumn in the shipping source code (Q3 2009 SP1) however I did find a couple of posts (here and here) of others trying to do something similar and it appears I need to customize the displayed Grid in the CellBeginEdit event.

A funny implementation detail of this is that since that event gets called everytime the user clicks on a row, I now need to add some class variable to determine if I've customized the grid otherwise the columns I add programmatically get added over and over...  overlooking that for the moment here's my questions.

Question 1:  My first issue is that when I click on the cell with the GridViewMultiComboBoxColumn, it suddenly shows me a Type name 'Telerik.WinControls.UI.GridViewDataRowInfo' instead of the DisplayMember.  Here's a screenshot.

Question 1.1: As a side note, why must a click twice in the cell to get the drop down to display?

Question 2:  My second issue is that when it displays the Grid, even though I've told it to only display 2 columns, it still makes space for all the properties.  Why is this?  It doesn't seem to matter if I call BestFitColumns().  Here's a screenshot.

I've uploaded my source code here for you to see.
Francois
Top achievements
Rank 1
 answered on 17 Oct 2011
2 answers
131 views
Hi Telerik

I'm trying to create a standout highlight in a treeview to indicate which document in a raddock has been selected. I have created a Custom document with a DocumentNode property which points to the node in the tree which relates to the document. I'm using the Active document changed event and a TreeViewElement.Update to attempt this. THe code works for the addition of a single document but gets stuck on the next added document and won't reformat the appropriate node when I change from one document to the other by clicking on the document window tab.

The key code snippets are below:
In Active Document changed

tvMPWorkspace.TreeViewElement.Update(RadTreeViewElement.UpdateActions.StateChanged);


In Node Formatting event

if (rDockModelPackage.DocumentManager.ActiveDocument != null && ((RadCustomDocumentWindow)rDockModelPackage.DocumentManager.ActiveDocument).DocumentNode == e.Node)
{
    e.NodeElement.BackColor = Color.PaleGoldenrod;
}
else
{
    e.NodeElement.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local);
}

As usual, all help gratefully received
Regards
Ian
Ian
Top achievements
Rank 1
 answered on 17 Oct 2011
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?