Telerik Forums
UI for WinForms Forum
1 answer
109 views

This is really for anyone that is using the chart controls and not just the admins. I have the controls working as expected, but I cannot come up with a suitable layout that I like and still works when the form is maximized. By "work" I mean still looking acceptable. For example, when the form is a fixed size, my layout looks fine but when I go full screen on a 34" monitor, there's a ton of unused space and the form looks like a hot mess.

What do folks do in this scenario? I don't have enough charts to fill up that much real estate and if I did, they surely wouldn't fit on a smaller form. Also, I probably wouldn't want to fill up a large monitor with that many charts. 

Are dev's giving the user the ability to build their own dashboards PowerBI style? 

For now I think I'm going to make my form a fixed width and keep moving forward. I will have to circle back to the layout challenges later.

Just curious to know what folks do when they hit this. 

Thanks,

Michael. 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 27 May 2020
2 answers
1.0K+ views

Hi,

 

I have one RadGridView for WinForm UI.

I bind data dynamically using DataSource property and bind DataTable that is returned from database.

Before binding datasource, I add a GridViewCheckBoxColumn to the RadGridView (for selecting all rows).

 

following is the sample code:

If RadGridView1.MasterTemplate.Columns.GetColumnByFieldName("").Length = 0 Then
            Dim checkBoxColumn As GridViewCheckBoxColumn = New GridViewCheckBoxColumn("")
            checkBoxColumn.EnableHeaderCheckBox = True
            checkBoxColumn.HeaderCheckBoxAlignment = ContentAlignment.MiddleCenter
            checkBoxColumn.AllowFiltering = False
            checkBoxColumn.CheckFilteredRows = False
            checkBoxColumn.HeaderText = String.Empty

            RadGridView1.MasterTemplate.Columns.Add(checkBoxColumn)
            AddHandler RadGridView1.HeaderCellToggleStateChanged, AddressOf RadGridView1_HeaderCellToggleStateChanged
        End If

 

Later I bind the data table:

RadGridView1.DataSource = dataTable

 

Now, I have 2 problems:

1. Checking / Unchecking header check box, checks/unchecks checkboxes of current page only.  I need to perform the operation for the whole grid.

2. I have got filters on.  User can select filters on columns.  Once filters are applied, records are displayed according to those filters (other records are hidden).  Now, when checking the header check box, it only selects records that are part of current page.  For example, if I am on first page and apply filter on one column, grid will hide all rows from the first page that do not match the filter and pull records from 2nd and 3rd pages that match the criteria and show on the first page.  But if I select check box in the header, then only records from first page are selected, records that came from 2nd and 3rd page are not selected.

 

Kindly help.

 

Nadya | Tech Support Engineer
Telerik team
 answered on 26 May 2020
7 answers
457 views
First off, I'd like to mention that I am a complete noob when it comes to C#. It's a steep hill to climb. :)

In any case, I'm creating an addin class for Microsoft Dynamics NAV, that will display a list of data using the Telerik gridview control. In one of those columns I'd like to show a progress bar. I've seen how you can add code to the cell formatting event trigger, but I don't know how to do that when I do not have an interface in my solution. All the examples I've seen reference form controls.

Any help is extremely appreciated. For reference, this is my code below. It works great for what i need with exception of the progress bar column. the grid is being populated from teh contents of a published web service.

namespace AddInSamples
{
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using Microsoft.Dynamics.Framework.UI.Extensibility;
    using Microsoft.Dynamics.Framework.UI.Extensibility.WinForms;
    using Telerik.WinControls;
    using Telerik.WinControls.UI;
    using WorkCenterRef;
 
    [ControlAddInExport("WorkCenterStatusListTelerik")]
    public class StaticNoCaptionAddIn : WinFormsControlAddInBase
    {
        private WorkCenterRef.WorkCenter_Service workCenterList;
        private WorkCenterRef.WorkCenter[] workCenters;
 
        private Telerik.WinControls.UI.RadGridView dataGrid;
 
        protected override Control CreateControl()
        {
            dataGrid = new RadGridView();
 
            GridViewTextBoxColumn column1 = new GridViewTextBoxColumn("No.");
            GridViewTextBoxColumn column2 = new GridViewTextBoxColumn("Name");
            GridViewDecimalColumn column3 = new GridViewDecimalColumn("% Capacity");
            GridViewTextBoxColumn column4 = new GridViewTextBoxColumn("ProgressBar");
 
            column4.DataType = typeof(int);
 
            column1.Width = 100;
            column2.Width = 100;
            column3.Width = 100;
            column4.Width = 100;
 
            this.dataGrid.Columns.Add(column1);
            this.dataGrid.Columns.Add(column2);
            this.dataGrid.Columns.Add(column3);
            this.dataGrid.Columns.Add(column4);
 
            workCenterList = new WorkCenter_Service();
            workCenterList.UseDefaultCredentials = true;
            workCenters = workCenterList.ReadMultiple(null, null, 0);
 
            this.dataGrid.TableElement.BeginUpdate();
 
            this.dataGrid.AllowAddNewRow = false;
            this.dataGrid.AllowDeleteRow = false;
            this.dataGrid.AllowEditRow = false;
            this.dataGrid.AllowDragToGroup = false;
 
            column4.ReadOnly = true;
 
            foreach (WorkCenterRef.WorkCenter workCenter in workCenters)
            {
                this.dataGrid.Rows.Add(workCenter.No, workCenter.Name, workCenter.Percent_Capacity);               
            }
 
            this.dataGrid.TableElement.EndUpdate();
             
            return dataGrid;
        }
 
        /// <summary>
        /// Gets a values indicating whether the control shall show a caption.
        /// Overrides the implementation of StringControlAddInBase for IWinFormsControlAddIn.AllowCaptionControl
        /// </summary>
        public override bool AllowCaptionControl
        {
            get
            {
                return false;
            }
        }
    }
}

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 26 May 2020
26 answers
500 views
Mono support for telerik win controls would be really useful.  I'm about to start a project that needs to run forms on Windows, Linux and Mac and would like to be able to use telerik win controls.

Support for Mono would also be a great thing for telerik from an advertising standpoint. The Mono project is really starting to build up steam in the development community and only a few control providers currently support it.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 26 May 2020
1 answer
267 views

This is more of a curiosity question. Sometimes I add a single item to my listview when I'm "Loading" or displaying other types of informational messages. Out of curiosity, is there a way to add an item and specify its column index all in one line? Right now I create the item, then specify its column index, and then set the text.

Say I have a RadListview created, columns already added are A,B,C,D,E. I want to simply add some entry under the Column "C" that says "Loading" but all in a single line of code.

This is not important, just curious if there is an easier way of doing it vs :

            lv.Items.Insert(0, new ListViewDataItem("Test") { Text = "Test" });
            lv.Items[0]["MyColumn"] = "Test";

Thanks!

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 25 May 2020
2 answers
69 views

     I am getting a Object variable not set error while adding a child template to master template of grid view

here is my code

            {
                grddisplaygrid.DataSource = (DataTable)TransactionController.FetchObject("Itemdetails");
            }

           
           GridViewMultiComboBoxColumn tempmulticombo = (GridViewMultiComboBoxColumn)grddisplaygrid.Columns["BatchNo"];
            tempmulticombo.HeaderText = TransactionController.g_strbatchCaption == "" ? tempmulticombo.HeaderText : TransactionController.g_strbatchCaption;
            tempmulticombo = (GridViewMultiComboBoxColumn)grddisplaygrid.Columns["StockNo"];
            tempmulticombo.HeaderText = TransactionController.g_strStockNoCaption == "" ? tempmulticombo.HeaderText : TransactionController.g_strStockNoCaption;
            GridViewComboBoxColumn tempcombo = (GridViewComboBoxColumn)grddisplaygrid.Columns["SMGUid"];
            tempcombo.IsVisible = false;
            tempcombo = (GridViewComboBoxColumn)grddisplaygrid.Columns["UOM"];
            DataTable dttemp = GetUOmlist();
            tempcombo.DataSource = dttemp;
            tempcombo.DisplayMember = "UnitSymbol";
            tempcombo.ValueMember = "QBGUID";
            tempcombo.DropDownStyle = RadDropDownStyle.DropDownList;
            tempcombo.AutoCompleteMode = AutoCompleteMode.Suggest;
            #region item level Location
            if (TransactionController.g_intLocationenabled == 3)
            {
                tempmulticombo = (GridViewMultiComboBoxColumn)grddisplaygrid.Columns["LocationCd"];
                tempmulticombo.IsVisible = true;
                tempmulticombo.Width = 100;
                tempmulticombo.ReadOnly = false;
                tempmulticombo.HeaderText = TransactionController.g_strlocationCaption == "" ? tempmulticombo.HeaderText : TransactionController.g_strlocationCaption;
            }
            #endregion item level Location

            OverrideColumnVisibility();
            if (TransactionController.g_intDisplayImageinItemDisplaygrid > 0)
            {
                GridViewImageColumn colimage = (GridViewImageColumn)grddisplaygrid.Columns["ItemImage"];
                colimage.IsVisible = true;
            }
            templatesubdetails = new GridViewTemplate();
            templatesubdetails.AllowAddNewRow = false;
            templatesubdetails.AllowEditRow = false;
            templatesubdetails.AllowDeleteRow = false;
            templatesubdetails.ShowRowHeaderColumn = false;
            if (dtsubitemdetails.Columns.Count > 0) { dtsubitemdetails.Columns.Clear(); }
            dtsubitemdetails.Columns.Add("cStockNo", typeof(string));
            dtsubitemdetails.Columns.Add("cItemDesc", typeof(string));
            dtsubitemdetails.Columns.Add("cBatchNo", typeof(string));
            dtsubitemdetails.Columns.Add("cQty", typeof(decimal));
            dtsubitemdetails.Columns.Add("cUOM", typeof(string));
            dtsubitemdetails.Columns.Add("cItemGUID", typeof(string));
            dtsubitemdetails.Columns.Add("cBatchGuid", typeof(string));
            dtsubitemdetails.Columns.Add("cBOMItemGuid", typeof(string));
            dtsubitemdetails.Columns.Add("cRowsrlno", typeof(int));
            dtsubitemdetails.Columns.Add("cBOMQty", typeof(decimal));
            dtsubitemdetails.Columns.Add("BatchEnabled", typeof(int));
            dtsubitemdetails.Rows.Clear();
            templatesubdetails.DataSource = dtsubitemdetails;

            templatesubdetails.Columns["cItemGUID"].IsVisible = false;
            templatesubdetails.Columns["cRowsrlno"].IsVisible = false;
            templatesubdetails.Columns["cBOMQty"].IsVisible = false;
            templatesubdetails.Columns["cBatchGuid"].IsVisible = false;
            templatesubdetails.Columns["cBOMItemGuid"].IsVisible = false;
            templatesubdetails.Columns["BatchEnabled"].IsVisible = false;
            templatesubdetails.Columns["cStockNo"].HeaderText = "Stock No.";
            templatesubdetails.Columns["cStockNo"].Width = 100;
            templatesubdetails.Columns["cItemDesc"].HeaderText = "Description";
            templatesubdetails.Columns["cItemDesc"].Width = 120;

            templatesubdetails.Columns["cBatchNo"].HeaderText = "Batch Number";
            templatesubdetails.Columns["cBatchNo"].Width = 100;
            templatesubdetails.Columns["cBatchNo"].IsVisible = TransactionController.g_intbatchEnabled > 0 ? true : false;

            GridViewDecimalColumn deccolumn = (GridViewDecimalColumn) templatesubdetails.Columns["cQty"];
            deccolumn.HeaderText = "Qty.";
            deccolumn.Width = 70;
            deccolumn.DecimalPlaces = 3;
            deccolumn.FormatString = "{0:N3}";

            templatesubdetails.Columns["cUOM"].HeaderText = "Per";
            templatesubdetails.Columns["cUOM"].Width = 80;
            grddisplaygrid.MasterTemplate.Templates.Clear();
            grddisplaygrid.Relations.Clear();
           
            
           grddisplaygrid.MasterTemplate.Templates.Add(templatesubdetails);

 

getting the error while executing the above line of code. kindly help me to solve the issue.

           

Nadya | Tech Support Engineer
Telerik team
 answered on 22 May 2020
16 answers
814 views
How can I change SplitPanel collapse direction.
Using RadSplitContainer with 2 panels I need panel 2 collapsable to down, not up, hidding panel 1!
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 22 May 2020
2 answers
72 views

Hello,

I have a small amount of data that's already been grouped and sorted by sql. It looks something like this:

 

value - category name

25 - Cat1
15 - Cat2
5  - Cat3

Each time I run the query, I may receive different categories with different names and different values. These categories, if I understand how the ChartView works correctly, are represented via Series. Since my data is dynamic, how should I go about creating these series on the fly? Most of the examples I've seen use hard coded series. I'm sure I can hack it together, but I'd rather ask first in case there's a better way. Btw, I did search the forums and found a post where someone is using VB and Linq to get a list of categories. That may work, but its from 2012 so I thought I'd ask.

 

Thanks!

Michael
Top achievements
Rank 1
Veteran
 answered on 19 May 2020
2 answers
137 views

Hello. 

 

I need print múltiples radchartview on a document, it's posible this?.

I know that i can use radchartview.print() for one chart but one how print one document with 2 or more pages with 2 o more radchartvew?.

 

Thanks and apologies for my English. 

Miguel
Top achievements
Rank 1
 answered on 18 May 2020
1 answer
297 views
Is it possible to replace the context menu with a date picker control?  I don't want to post my code because if I have been able to show the date picker it has been sharply compressed.  Do I remove the items - or just hide them?  Where do I add the date picker control?  And how do I make it bigger - it automatically appears as 200, 20 and I need it to be 300, 300 at least
Nadya | Tech Support Engineer
Telerik team
 answered on 15 May 2020
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
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
Menu
PropertyGrid
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
Rotator
TrackBar
MessageBox
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ScrollBar
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
ColorBox
Callout
FilterView
PictureBox
VirtualKeyboard
NavigationView
Accessibility
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
Flyout
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
DateOnlyPicker
TimeOnlyPicker
+? more
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?