Telerik Forums
UI for WinForms Forum
5 answers
177 views
In GridView/self-referencing WinForms demo sample,how to 'AllowAddNewRow' in all hierarchical level?
Best Regards.
Richard Slade
Top achievements
Rank 2
 answered on 12 Dec 2010
3 answers
218 views
Hi I am trying to run a routine that is to show three levels of hierarchy thus:-

Main Level RadGridView ('rgvInletDetails')       CylinderID, some fields.....        Bound to 'Inlet' Table
Second Level Template   ('CylTemplate')          CylinderID, some fields ........    Bound to 'Cylinders' table
Third Level Template     ('CylGasTemplate')      CylinderID, some fields .......     Bound to 'CylinderGas' table 

My routine to accomplish this is as follows:-
======================================================================

 

Dim CylRelation                 As GridViewRelation
Dim CylGasRelation          As GridViewRelation
Dim CylTemplate               As GridViewTemplate
Dim CylGasTemplate        As GridViewTemplate

 

 

 

'setup the master template
rgvInletDetails.MasterTemplate.Columns.Clear
rgvInletDetails.MasterTemplate.AddNewRowPosition = SystemRowPosition.Top
rgvInletDetails.MasterTemplate.AllowAddNewRow     =
True
PopInletDetails(rgvInletDetails)                                  '  Binding Source for rgvInletDetails.DataSource =  'Inlet' table 

 

 

 

'setup the Cylinder child template (Level 2)
CylTemplate                                          = New GridViewTemplate()
CylTemplate.Caption                           =
"Cylinders"
CylTemplate.AllowAddNewRow      = True
PopCylinderData(CylTemplate)                                                                'setup BindingSource for level 2 with 'Cylinder' table
rgvInletDetails.MasterTemplate.Templates.Add(CylTemplate)         ' add 2nd Level Template to MasterTemplates

 

 

 

'setup the CylinderGas child template (Level 3)
CylGasTemplate                                     = New GridViewTemplate()
CylGasTemplate.Caption                      =
"Cylinder Gas"
CylGasTemplate.AllowAddNewRow = True
PopCylinderGas(CylGasTemplate)                                                         'setup BindingSource for level 3 with 'CylinderGas' table
rgvInletDetails.MasterTemplate.Templates.Add(CylGasTemplate)  ' add 3rd Level Template to MasterTemplates

'create the Cylinder relation
Cylrelation                                            = New GridViewRelation(rgvInletDetails.MasterTemplate)
CylRelation.ParentTemplate              = rgvInletDetails.MasterTemplate
Cylrelation.ChildTemplate                 = CylTemplate
Cylrelation.RelationName                  =
"Cylinders"
Cylrelation.ParentColumnNames.Add("CylinderID")
Cylrelation.ChildColumnNames.Add(
"CylinderID")
rgvInletDetails.Relations.Add(Cylrelation)

 

 

 

'create the CylinderGas relation
CylGasRelation                                   = New GridViewRelation(rgvInletDetails.MasterTemplate)
CylGasRelation.ParentTemplate      = CylTemplate
CylGasRelation.ChildTemplate        = CylGasTemplate
CylGasRelation.RelationName         =
"CylinderGas"
CylGasRelation.ParentColumnNames.Add("CylinderID")
CylGasRelation.ChildColumnNames.Add(
"CylinderID")
rgvInletDetails.Relations.Add(CylGasRelation)

================================================================

Ok - all done. Now when I run this the main grid is displayed correctly with a '+' showing there are records for the 2nd level. However, when I click on
that '+' button then I get this message:-

(see attachment 'errordisplay.jpg' )

Actually an example of a three level hierarchy would be invaluable as it isn't immediately clear on the set up for this arrangement. This requirement above is further complicated by the fact that both Relations have to specify the same field name and I was worried in case the grid thought that it might have to produce two Level 2 grids rather than a Level 2 and a Level 3. As it is I probably have this incorrectly specified. But it would be really nice if an example of both arrangements could be provided.

Many thanks for taking the time to read this and if there are any other details I can provide please ask.
I am using this in a VB.Net 2.0 VS2008 IDE for Windows Forms and the RadgridView is from the 2010.3.10.1109 release.


Does anyone in Telerik know what the message "measure override returned positive infinity" actually means? Can't find any trace of it on the Internet.

 

 

 

 

 

 

 

 

 

 

 

 

Ben Thompson
Top achievements
Rank 1
 answered on 12 Dec 2010
3 answers
329 views
Hello,

I attempted to use RadSpinEditor to edit an integer value. Everything was fine with one exception: when Enter key is hit by the user (at the end, to announce the completion of the editing process), an annoying sound (beep) is heared. There is a way to get rid of this sound?

Mircea
Richard Slade
Top achievements
Rank 2
 answered on 12 Dec 2010
8 answers
372 views
Hi,

is it possible to auto scroll GridView when selecting data with mouse?
When I click on first row and first cell, hold the mouse button and drag with mouse to select more rows, I need that GridView auto scrolls to show me rows, which did not fit in a page.
Because now I cannot select rows which are not visible.

Van Elpho
van
Top achievements
Rank 1
 answered on 11 Dec 2010
5 answers
1.2K+ views
Hello,

In the old ListControl i was using the item.Visibility Collapsed to hide some items while some conditions are not met, in the new version with the DropDownList i've noticed that the visibility property no longer applies to the item, it applies to the visual item, and it no longer works as before, and even more than this the IsVisible property of the item is readOnly, can someone please tell me how should i hide an item and not leave a blank space in the list ?

Thank you very much,

Best Regards,
Emanuel Varga
Peter
Telerik team
 answered on 11 Dec 2010
8 answers
194 views
I don't like having to use a Tab Control or Panels to make a Wizard. It's a Pain 

Richard Slade
Top achievements
Rank 2
 answered on 11 Dec 2010
6 answers
317 views
Hello,

I've got this memory leak, could you guys give an explanation/workaround? I've made the simplest test case (see below), factors for the bug to occur (that I already discovered):

- it's an MDI form situation with parent & child
- the child is maximized (the menu items are added into one menubar)
- the menu item provided by the client is a menu button
- a textbox is on the child form

TestMdiParent.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
 
using Telerik.WinControls.UI;
 
namespace MenuMemoryLeak
{
    public partial class TestMdiParent : Telerik.WinControls.UI.RadForm
    {
        public TestMdiParent()
        {
            InitializeComponent();
 
        }
 
        //NOTE this stuff with the backgroundworker is just to repeatedly close/open the form, I know it's not fully correct but the bug occurs nevertheless
 
        BackgroundWorker myWorker = new BackgroundWorker() { WorkerReportsProgress = true, WorkerSupportsCancellation = false };
        TestMdiChild myMdiChild;
 
        private void TestMdiParent_Shown(object sender, EventArgs e)
        {
            myWorker.DoWork += delegate
            {
                int count = 0;
                while(true)
                {
                    ++count;
                    myWorker.ReportProgress(count);
                    System.Threading.Thread.Sleep(1000);
                }
            };
 
            myWorker.ProgressChanged += delegate
            {
                if(myMdiChild != null)
                {
                    myMdiChild.Close();
                    System.GC.Collect();
                }
                myMdiChild = new TestMdiChild() { MdiParent = this };
                myMdiChild.Show();
            };
 
            myWorker.RunWorkerAsync();
        }
    }
}

TestMdiParent
.Designer.cs
namespace MenuMemoryLeak
{
    partial class TestMdiParent
    {
        /// <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.testMenuItem = new Telerik.WinControls.UI.RadMenuItem();
            this.testParentMenu = new Telerik.WinControls.UI.RadMenu();
            ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.testParentMenu)).BeginInit();
            this.SuspendLayout();
            //
            // testMenuItem
            //
            this.testMenuItem.Name = "testMenuItem";
            this.testMenuItem.Text = "Parent";
            //
            // TestMdiParent
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(902, 523);
            //
            // testParentMenu
            //
            this.testParentMenu.Items.AddRange(new Telerik.WinControls.RadItem[] {
            this.testMenuItem});
            this.testParentMenu.Location = new System.Drawing.Point(0, 0);
            this.testParentMenu.Name = "testParentMenu";
            this.testParentMenu.Size = new System.Drawing.Size(902, 24);
            this.testParentMenu.TabIndex = 1;
            this.testParentMenu.Text = "radMenu1";
            this.Controls.Add(this.testParentMenu);
            this.IsMdiContainer = true;
            this.Name = "TestMdiParent";
            //
            //
            //
            this.RootElement.ApplyShapeToControl = true;
            this.Text = "TestMdiParent";
            this.ThemeName = "ControlDefault";
            this.Shown += new System.EventHandler(this.TestMdiParent_Shown);
            ((System.ComponentModel.ISupportInitialize)(this.testParentMenu)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();
 
        }
 
        #endregion
 
        private Telerik.WinControls.UI.RadMenuItem testMenuItem;
        private Telerik.WinControls.UI.RadMenu testParentMenu;
 
    }
}

TestMdiChild.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Telerik.WinControls;
 
namespace MenuMemoryLeak
{
    public partial class TestMdiChild : Telerik.WinControls.UI.RadForm
    {
        public TestMdiChild()
        {
            InitializeComponent();
 
            //NOTE required for bug to occur
            this.WindowState = FormWindowState.Maximized;
        }
    }
}


TestMdiChild.Designer.cs
namespace MenuMemoryLeak
{
    partial class TestMdiChild
    {
        /// <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.testMenuButtonItem = new Telerik.WinControls.UI.RadMenuButtonItem();
            this.testChildMenu = new Telerik.WinControls.UI.RadMenu();
            this.testTextBox = new Telerik.WinControls.UI.RadTextBox();
            ((System.ComponentModel.ISupportInitialize)(this.testChildMenu)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.testTextBox)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
            this.SuspendLayout();
            //
            // testMenuButtonItem
            //
            this.testMenuButtonItem.Name = "testMenuButtonItem";
            this.testMenuButtonItem.Text = "Child";
            //
            // testChildMenu
            //
            this.testChildMenu.AllowMerge = false;
            this.testChildMenu.IsMainMenu = false;
            this.testChildMenu.Items.AddRange(new Telerik.WinControls.RadItem[] {
            this.testMenuButtonItem});
            this.testChildMenu.Location = new System.Drawing.Point(0, 0);
            this.testChildMenu.Name = "testChildMenu";
            this.testChildMenu.Size = new System.Drawing.Size(467, 24);
            this.testChildMenu.TabIndex = 2;
            this.testChildMenu.Text = "radMenu1";
            //
            // testTextBox
            //
            this.testTextBox.Location = new System.Drawing.Point(22, 23);
            this.testTextBox.Name = "testTextBox";
            this.testTextBox.Size = new System.Drawing.Size(100, 20);
            this.testTextBox.TabIndex = 1;
            this.testTextBox.TabStop = false;
            this.testTextBox.Text = "test";
            //
            // TestMdiChild
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(467, 268);
            this.Controls.Add(this.testChildMenu);
            this.Controls.Add(this.testTextBox);
            this.Name = "TestMdiChild";
            //
            //
            //
            this.RootElement.ApplyShapeToControl = true;
            this.Text = "TestMdiChild";
            this.ThemeName = "ControlDefault";
            ((System.ComponentModel.ISupportInitialize)(this.testChildMenu)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.testTextBox)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();
 
        }
 
        #endregion
 
        private Telerik.WinControls.UI.RadMenuButtonItem testMenuButtonItem;
        private Telerik.WinControls.UI.RadMenu testChildMenu;
        private Telerik.WinControls.UI.RadTextBox testTextBox;
    }
}

If you call the parent MDI form and let it run a bit you should see the GDI objects increase by one each second and never get released.

If you know a solution/workaround, thanks a lot

Frederik
Peter
Telerik team
 answered on 11 Dec 2010
3 answers
187 views
Hi all,
i need a simple feature -  to hide/show a ColumnGroup (including all columns and ColumnGroups within).
something exactly like hide column method (via the column chooser).
thanks,
Gal.
Svett
Telerik team
 answered on 11 Dec 2010
4 answers
199 views
Hi Telerik,

I am searching for an option to localize the schedule navigator, but haven't found any solution.

What is the best practise to localize the schedule navigator?

best regards

Ulrik
Dobry Zranchev
Telerik team
 answered on 11 Dec 2010
11 answers
661 views
My grid has grouping enabled. when i expand the group, and if the grid has a horizontal scrollbar, the grid automatically scrolls to the rightmost column. 
Any clues as to why it could be doing this? Is there a property I can enable/disable to prevent this from happening. 
Or workarounds?

Thanks
Anisha
Jack
Telerik team
 answered on 11 Dec 2010
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)
Form
Chart (obsolete as of Q1 2013)
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
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
SyntaxEditor
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?