Telerik Forums
UI for WinForms Forum
5 answers
1.6K+ views
Helo !

In a grid(WinForms), by default, vertical scroll appears to the right side of grid and horizontal scroll appears to the bottom of grid.
but I need to display vertical scroll to the left side of grid and horizontal scroll to the top of grid.

For horizontal scroll, please specify some way to display the scroll at top of grid in following position with respect to grid :
a.  just above column headers
b.  just below column header
c.  just above group descriptor(if group descriptor set to true)
d.  in between group descriptor and column headers.
I need to implement any one of these.

For Vertical Scroll : to the left side of grid
a. After RowHeaderColumn (if ShowRowHeaderColumn set to true)
b. Before RowHeaderColumn (if ShowRowHeaderColumn set to true)
c. Simply at the beginning from left(if ShowRowHeaderColumn set to false)


thanks,

Chan

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 28 May 2020
1 answer
218 views

I found this code on telerik resource site. This function return value of LinearAxis,

    Private Function GetVerticalAxisValueFromMouse(ByVal e As MouseEventArgs) As Object
        Dim axis As LinearAxis = TryCast(RadChartView1.Axes(1), LinearAxis)
        Dim delta As Double = axis.ActualRange.Maximum - axis.ActualRange.Minimum
        Dim totalHeight As Double = axis.Model.LayoutSlot.Height
        Dim ratio As Double = 1 - (e.Location.Y - Me.RadChartView1.Area.View.Viewport.Y - axis.Model.LayoutSlot.Y) / totalHeight
        Dim value As Double = axis.ActualRange.Minimum + delta * ratio
        Return value
    End Function

 

I want to get value of CategoricalAxis value from CandleStick Chart

Nadya | Tech Support Engineer
Telerik team
 answered on 27 May 2020
1 answer
294 views

Hello,

I am trying to bring into view all elements of a diagram, but cannot manage to fit it to screen. Is there any workaround for BringIntoView method?
I tried to use the followings and won't work.

Last piece of code sometimes works, sometimes doesn't.
Is there a formula to calculate the bounds, the view port size and zoom to fit all elements of a diagram into view?

Thank you!

 

1.
var box = selectedHardwareVariant.Shapes.GetEnclosingBounds();
selectedHardwareVariant.DiagramElement.BringIntoView(box, false);
selectedHardwareVariant.DiagramElement.Controller.OnViewportChanged();

2.

var box = selectedHardwareVariant.Shapes.GetEnclosingBounds(); selectedHardwareVariant.PanToPosition(box.Center()); selectedHardwareVariant.DiagramElement.BringIntoView(box, false); selectedHardwareVariant.DiagramElement.Controller.OnViewportChanged();

3.

Telerik.Windows.Diagrams.Core.DiagramConstants.MinimumZoom = 0.001;
                Telerik.Windows.Diagrams.Core.DiagramConstants.MaximumZoom = 50;
                selectedHardwareVariant.AutoScroll = true;
                selectedHardwareVariant.AutoLayout = true;
                selectedHardwareVariant.ZoomIn(1);
                selectedHardwareVariant.Zoom = 1;
                selectedHardwareVariant.DiagramElement.Controller.OnViewportChanged();
                var box = selectedHardwareVariant.Shapes.GetEnclosingBounds();
                selectedHardwareVariant.PanToPosition(box.Center());
                selectedHardwareVariant.DiagramElement.BringIntoView(box, false);
                selectedHardwareVariant.DiagramElement.Controller.OnViewportChanged();
                IEnumerable<IShape> shapesOutside = selectedHardwareVariant.DiagramElement.Shapes.Where(x => !selectedHardwareVariant.DiagramElement.IsInViewport(x));
                for (int i = 0; i < shapesOutside.Count(); i++)
                {
                    double newZoom = Math.Round(selectedHardwareVariant.Zoom/1.1, 3);
                    box = selectedHardwareVariant.Shapes.GetEnclosingBounds();
                    selectedHardwareVariant.DiagramElement.PanToPosition(box.Center());
                    selectedHardwareVariant.DiagramElement.Controller.OnViewportChanged();
                    selectedHardwareVariant.ZoomOut(newZoom, box.Center());
                    selectedHardwareVariant.Zoom = newZoom;
                    if (selectedHardwareVariant.DiagramElement.Shapes.All(x => selectedHardwareVariant.DiagramElement.IsInViewport(x)))
                    {
                        break;
                    }
                }
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 27 May 2020
5 answers
1.5K+ views
Hey all,

I can't seem to find a way to get the panel to only have a bottom border. It's probably pretty obvious but everything I'm trying isn't working.

So far I've gone into the smart tag for the panel control and messed around with the 'width' property of the various borders under the layout and box area's of the properties. I've done this with both the UI.RadPanelElement and BorderPrimitive areas. I'm setting the width on the side I don't want to show to 0 and that's not working. I've also tried -1 as well as changing the BorderThickness to no avail.

Appreciate any help with this!
Nadya | Tech Support Engineer
Telerik team
 answered on 27 May 2020
2 answers
2.5K+ views

Hello,

I'm having some troubles with the alignment of any control in a layout or panel. Perhaps, I'm missing something trivial. Appreciated your help in this regard. 

The attached image shows the basic approach that I'm looking for. Using RadLayoutControl or RadPanel, I'm not able to keep any control center aligned during design time. It this possible in any way? 

Thanks

Lao

 

Hu
Top achievements
Rank 1
Veteran
 answered on 27 May 2020
1 answer
192 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.1K+ 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
719 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
594 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
424 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
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
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
ShapedForm
SyntaxEditor
Wizard
CollapsiblePanel
TextBoxControl
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
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
NavigationView
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
SplashScreen
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?