Telerik Forums
UI for WinForms Forum
1 answer
174 views

 

Hi,

 I've gone through this page and have a few questions:

 http://www.telerik.com/help/winforms/gridview-populating-with-data-unbound-mode.html

---------
Reason for using Unbound Mode: I'm building a Multi-threaded application, this application has several slow processes in the background and each of them returns a value. I use these values to fill cells in a gridview one by one without blocking the rest of the user interface. I've got this working quite well and happy with the result. I couldn't have done this with binding (this would have resulted in constantly fully reloading the gridview, now I just modify each cell when needed). This is the reason, why I'm using unbound mode.

---------

Now, for my next modification - I need a hierarchy in the gridview and I'm having trouble getting this to work:

I need something like the following:

 

ROW1: AverageValue1 | AverageValue2 | AverageValue3
    ROW1a: Value1a | Value2a | Value3a
    ROW1b: Value1b | Value2b | Value3b
    ROW1c: Value1c | Value2c | Value3c
ROW2: AverageValue1 | AverageValue2 | AverageValue3
    ROW2a: Value1a | Value2a | Value3a
    ROW2b: Value1b | Value2b | Value3b
ROW3: AverageValue1 | AverageValue2 | AverageValue3
    ROW3a: Value1a | Value2a | Value3a
    ROW3b: Value1b | Value2b | Value3b
    ROW3c: Value1c | Value2c | Value3c
    ROW3d: Value1d | Value2d |  Value3d

 

Now, when following the steps for "hierarchical grid in unbound mode" I'm getting way too many child rows. I believe the reason for this is because I'm using a template like so:

GridViewTemplate template = radGridView1.MasterTemplate.Templates[0];

Then I loop through the amount of childrows that need to be created like so:

 

for (int j = 0; j < rowCount; j++)
{
    template.Rows.AddNew();
}

This results in having way too many childrows. I've just taken two random columnnames as the relationship => I'm assuming this is probably the reason why things aren't working.
The thing is, in my case there is no real relationship between child and parent. The parent is just the average values of all children. Does this mean I need to create an extra column just for the sake of the relationship ?

Also, when using unbound mode (in a non-hierarchical situation) I first create the rows, and then fill them. If in hierarchical mode, I'm getting the impression that I can't create the childrows without filling them (not sure)?

All I really want to do, is create child rows an fill the cells one by one, whenever I can....

Thanks in advance for the help and example !

 

 

 

 

 

Stefan
Telerik team
 answered on 10 Jul 2015
1 answer
606 views

Hello,

We habe to implement a graphical tour planning.

One line for each employee and all tasks on the timeline.

                           10:00-----------11:00--------------12:00---------------13:00

Employee 1.                /------Task1-----/. /-------Task 2-----/

Employee 2.                        /---Task1--/ /---------Task2--------/ /--Task3---/

Employee 3

Is there a way to do this with RadGanttView ?

 Thanks in advance

 

Stefan
Telerik team
 answered on 10 Jul 2015
2 answers
97 views

Hello,

Very good to hear that the RichTextEditorRibbonBar localization provider came out.

Where can I find the RichTextEditorRibbonBar localization file.

Thank you...

Bekir
Top achievements
Rank 1
Iron
 answered on 09 Jul 2015
3 answers
200 views
What is the recommended way to handle validation for each page in the Wizard?

The Validating event for the Wizard itself does not fire for each page change, only when the form is closing.  I could perform validation on SelectedPageChanging, but then I have to branch to multiple routines depending on which page the wizard was on. This method works fine, but ideally, each page itself had its own Validating event.  Or each page had a cancellable "Moving" event with arguments that indicated which way it was going. 

Thoughts?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 08 Jul 2015
1 answer
222 views

I have a grid view with several columns set where AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill.  I do have few columns with a fixed width (i.e. MinWidth = MaxWidth = Width).  This is working fine as you can see in picture Gridview1.  The gridview has the following properties:

this.RadGridViewTansBancaire.MasterTemplate.AllowAddNewRow = false;
this.RadGridViewTansBancaire.MasterTemplate.AllowCellContextMenu = false;
this.RadGridViewTansBancaire.MasterTemplate.AllowColumnChooser = false;
this.RadGridViewTansBancaire.MasterTemplate.AllowColumnHeaderContextMenu = false;
this.RadGridViewTansBancaire.MasterTemplate.AllowColumnReorder = false;
this.RadGridViewTansBancaire.MasterTemplate.AllowDeleteRow = false;
this.RadGridViewTansBancaire.MasterTemplate.AllowDragToGroup = false;
this.RadGridViewTansBancaire.MasterTemplate.AllowEditRow = false;
this.RadGridViewTansBancaire.MasterTemplate.AllowRowResize = false;
this.RadGridViewTansBancaire.MasterTemplate.AutoExpandGroups = true;
this.RadGridViewTansBancaire.MasterTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;

 

Now, whenever I group these columns into 2 groups, the fill command is not working anymore as shown in picture Gridview2.

I tried several things, read the posts and the actual commands used are:

RadGridViewTansBancaire.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.None;
ColumnGroupsViewDefinition columnGroupsView = new ColumnGroupsViewDefinition();
columnGroupsView.ColumnGroups.Add(new GridViewColumnGroup(Offix.Culture.Traduire("BANQUE", "BANK")));
columnGroupsView.ColumnGroups[0].Rows.Add(new GridViewColumnGroupRow());
columnGroupsView.ColumnGroups[0].Rows[0].Columns.Add(this.RadGridViewTansBancaire.Columns["BankDescription"]);
columnGroupsView.ColumnGroups[0].Rows[0].Columns.Add(this.RadGridViewTansBancaire.Columns["BankReference"]);
columnGroupsView.ColumnGroups[0].Rows[0].Columns.Add(this.RadGridViewTansBancaire.Columns["BankDate"]);
columnGroupsView.ColumnGroups[0].Rows[0].Columns.Add(this.RadGridViewTansBancaire.Columns["BankMontant"]);

columnGroupsView.ColumnGroups.Add(new GridViewColumnGroup("OFFIX"));
columnGroupsView.ColumnGroups[1].Rows.Add(new GridViewColumnGroupRow());
columnGroupsView.ColumnGroups[1].Rows[0].Columns.Add(this.RadGridViewTansBancaire.Columns["OffixJournal"]);
columnGroupsView.ColumnGroups[1].Rows[0].Columns.Add(this.RadGridViewTansBancaire.Columns["OffixNoJournal"]);
columnGroupsView.ColumnGroups[1].Rows[0].Columns.Add(this.RadGridViewTansBancaire.Columns["OffixDate"]);
columnGroupsView.ColumnGroups[1].Rows[0].Columns.Add(this.RadGridViewTansBancaire.Columns["OffixCode"]);
columnGroupsView.ColumnGroups[1].Rows[0].Columns.Add(this.RadGridViewTansBancaire.Columns["OffixNom"]);
columnGroupsView.ColumnGroups[1].Rows[0].Columns.Add(this.RadGridViewTansBancaire.Columns["OffixType"]);
columnGroupsView.ColumnGroups[1].Rows[0].Columns.Add(this.RadGridViewTansBancaire.Columns["OffixReference"]);
columnGroupsView.ColumnGroups[1].Rows[0].Columns.Add(this.RadGridViewTansBancaire.Columns["OffixNoDocument"]);
columnGroupsView.ColumnGroups[1].Rows[0].Columns.Add(this.RadGridViewTansBancaire.Columns["OffixDebit"]);
columnGroupsView.ColumnGroups[1].Rows[0].Columns.Add(this.RadGridViewTansBancaire.Columns["OffixCredit"]);
columnGroupsView.ColumnGroups[1].Rows[0].Columns.Add(this.RadGridViewTansBancaire.Columns["Verifie"]);

RadGridViewTansBancaire.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
RadGridViewTansBancaire.BestFitColumns();

 

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 08 Jul 2015
1 answer
351 views

hi ,

how can I remove all the boarders of toggleswitch and I want to change its value only by dragging not by clicking. Is it possible?

Todor
Telerik team
 answered on 08 Jul 2015
1 answer
127 views

Hi;

I detected a problem when displaying an alert RadDesktopAlert and select up in the direction of the animation, The control appears outside desktop.

Using other direction out of the alert is resolved, but not what I want, I want you to act as in previous versions with the up direction.

I attached a project where you can see the error perfectly

https://dl.dropboxusercontent.com/u/21787064/RadDesktopAlert.zip

Regards

Hristo
Telerik team
 answered on 08 Jul 2015
1 answer
129 views

Hi there,

I was wondering if it was possible to modify the start menu of the RichTextEditorRibbonBar. Ideally I would like to clear all the items and add my own. However, from my experiments, this is not possible.

 

Is there a way to achieve this without manually creating a RibbonBar and re-create all the text formating operations?

 

Thank you

Stefan
Telerik team
 answered on 08 Jul 2015
4 answers
164 views

Hi

 

Please advise how i can clone a tree view

 

I have a radDropDownList and a RadTreeView.

upon selection in the drop down, my data chages, though the table structure remain the same. Suppose i have options 1 and 2 in the drop down. user selects option 1 and tree is populated. User makes some selections in tree check boxes, then select option 2 from drop down list, new data populateed in tree view, and user does further selections in tree view. Now user goes back to option 1, i should get the tree view with data and tick selections

 below are my codes, but this does not seem to be good. tvNode is in designer

local variables

        RadTreeView tvAsset = new RadTreeView();
        RadTreeView tvDriver = new RadTreeView();

        private void cbStruc_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
        {
            if (cbStruc.SelectedItem == null)
                return;

            int i = 0;
            Image imagetemp;
            switch (cbStruc.SelectedItem.ToString())
            {
                case "Assets":
                    if (tvAsset.Nodes.Count == 0)
                    {
                        TreeView tv = new TreeView();
                        new GroupMatrix().PopulateTreeCategories(tv, Globals.uLogin.lMatrix, cbStruc.SelectedItem.ToString());
                        tvNode.ClearSelection();
                        tvNode.DataSource = Globals.dtGMTreeCategory;

                        tvAsset = CloneTreeNodes(tvNode);
                    }
                    else
                    {
                        tvNode.ClearSelection();
                        tvNode = CloneTreeNodes(tvAsset);
                    }
                    break;

                case "Drivers":
                    if (tvDriver.Nodes.Count == 0)
                    {
                        TreeView tv = new TreeView();
                        new GroupMatrix().PopulateTreeCategories(tv, Globals.uLogin.lMatrix, cbStruc.SelectedItem.ToString());
                        tvNode.ClearSelection();
                        tvNode.DataSource = Globals.dtGMTreeCategory;

                        tvDriver = CloneTreeNodes(tvNode);
                    }
                    else
                        tvNode = CloneTreeNodes(tvDriver);
                    break;

            }
            tvNode.ExpandAll();
        }

    private void cbStruc_SelectedIndexChanging(object sender, Telerik.WinControls.UI.Data.PositionChangingCancelEventArgs e)
        {
            if (cbStruc.SelectedItem != null)
                switch (cbStruc.SelectedItem.ToString())
                {
                    case "Assets":
                        tvAsset = CloneTreeNodes(tvNode);
                        break;

                    case "Drivers":
                        tvDriver = CloneTreeNodes(tvNode);
                        break;

                }
        }

        RadTreeView CloneTreeNodes(RadTreeView tvFrom)
        {
            RadTreeView treeview2 = new RadTreeView();
            if (tvFrom.Nodes.Count == 0)
                return treeview2;

            foreach (RadTreeNode tn in tvFrom.Nodes)
                treeview2.Nodes.Add((RadTreeNode)tn.Clone());
            
            treeview2.DataSource = tvFrom.DataSource;
            return treeview2;
        }


Kindly advise

 

Thank you

Hristo
Telerik team
 answered on 07 Jul 2015
3 answers
180 views

I have created a hierarchical relationship in a RadGridView. But the relationship doesn't work. I can't show the detail information. What do I do wrong?

 

This is the source:

private void OpenConfigurations()
{
  bsConfigurations.DataSource = Db.Configurations.Where(c => c.Active == true && c.CompanyId == CurrentCompany.CompanyId).Select(c => c).OrderBy(c => c.Name);
  bsConfigurationContracts.DataSource = Db.ConfigurationContracts.Where(c => c.Contract.InsurranceId == CurrentCompany.CompanyId).Select(c =>
c).OrderBy(c => c.Contract.Name);

  GridViewRelation gvrConfigurations = new GridViewRelation();

  gvrConfigurations.ChildColumnNames.Add("ConfigurationId");

  gvrConfigurations.ChildTemplate = this.gridViewTemplate1;

  gvrConfigurations.ParentColumnNames.Add("ConfigurationId");

  gvrConfigurations.ParentTemplate = this.gvConfiguration.MasterTemplate;

  gvConfiguration.Relations.Add(gvrConfigurations);
}

In the designer: 
this.gridViewTemplate1.AllowAddNewRow = false;
gridViewTextBoxColumn1.EnableExpressionEditor = false;
gridViewTextBoxColumn1.FieldName = "Contract.Name";
gridViewTextBoxColumn1.HeaderText = "Name";
gridViewTextBoxColumn1.Name = "colName";
gridViewTextBoxColumn1.Width = 250;
gridViewTextBoxColumn2.EnableExpressionEditor = false;
gridViewTextBoxColumn2.FieldName = "ConfigurationId";
gridViewTextBoxColumn2.HeaderText = "ConfigurationId";
gridViewTextBoxColumn2.IsVisible = false;
gridViewTextBoxColumn2.Name = "colConfigurationId";

this.gridViewTemplate1.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] { gridViewTextBoxColumn1, gridViewTextBoxColumn2 });
this.gridViewTemplate1.DataSource = this.bsConfigurationContracts;
//
// gvConfiguration
//
this.gvConfiguration.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(240)))), ((int)(((byte)(249)))));
this.gvConfiguration.Cursor = System.Windows.Forms.Cursors.Default;
this.gvConfiguration.Dock = System.Windows.Forms.DockStyle.Fill;
this.gvConfiguration.Font = new System.Drawing.Font("Segoe UI", 8.25F);
this.gvConfiguration.ForeColor = System.Drawing.Color.Black;
this.gvConfiguration.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.gvConfiguration.Location = new System.Drawing.Point(0, 30);
//
//
//
this.gvConfiguration.MasterTemplate.AllowAddNewRow = false;
this.gvConfiguration.MasterTemplate.AutoGenerateColumns = false;
gridViewTextBoxColumn3.EnableExpressionEditor = false;
gridViewTextBoxColumn3.FieldName = "Name";
gridViewTextBoxColumn3.HeaderText = "Name";
gridViewTextBoxColumn3.Name = "colName";
gridViewTextBoxColumn3.SortOrder = Telerik.WinControls.UI.RadSortOrder.Ascending;
gridViewTextBoxColumn3.Width = 250;
gridViewTextBoxColumn4.EnableExpressionEditor = false;
gridViewTextBoxColumn4.FieldName = "ConfigurationId";
gridViewTextBoxColumn4.HeaderText = "ConfigurationId";
gridViewTextBoxColumn4.IsVisible = false;
gridViewTextBoxColumn4.Name = "colConfigurationId";
this.gvConfiguration.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] { gridViewTextBoxColumn3, gridViewTextBoxColumn4 });
this.gvConfiguration.MasterTemplate.DataSource = this.bsConfigurations;
sortDescriptor1.PropertyName = "colName";
this.gvConfiguration.MasterTemplate.SortDescriptors.AddRange(new Telerik.WinControls.Data.SortDescriptor[] { sortDescriptor1 });
this.gvConfiguration.MasterTemplate.Templates.AddRange(new Telerik.WinControls.UI.GridViewTemplate[] { this.gridViewTemplate1 });
this.gvConfiguration.Name = "gvConfiguration";
this.gvConfiguration.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.gvConfiguration.ShowGroupPanel = false;
this.gvConfiguration.Size = new System.Drawing.Size(1098, 72);
this.gvConfiguration.TabIndex = 4;
this.gvConfiguration.Text = "radGridView1";
this.gvConfiguration.CellDoubleClick += new Telerik.WinControls.UI.GridViewCellEventHandler(this.gvConfiguration_CellDoubleClick);

Erwin
Top achievements
Rank 1
 answered on 07 Jul 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)
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
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
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
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Security
LocalizationProvider
Dictionary
SplashScreen
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?