Telerik Forums
UI for WinForms Forum
9 answers
507 views
We are experiencing a few useability issues with the date picker.  They are so frustrating for our customers that I've spent a few days trying to hack together a custom rad element that works as needed both in standard form editing, and in in-line grid editing.

I am not having much success building a custom date picker element due to issues with the RadMaskedEditBox.  I'm hoping you have work arounds or configurations I'm missing within the standard date time picker.  Here are our issues:

1. User clears the date picker with the Delete key and opens the Calendar.  It defaults to 01/01/1900 (the current NullDate) which is virtually useless.  The masked edit box behaves similarly when the user begins editing a date picker that is cleared.
2. Users are having difficulties getting used to the masked edit box.  How can we modify the control to accept "04172008" and format it "04/17/2008". Note: we still must enforce valid day/month/years, but do not want to require users to type the "/" or arrow key to the next section.

Any guidance is much appreciated.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Apr 2021
3 answers
1.6K+ views

Hello,

 

I'm trying to use RadGridView to export a datatable to Excel.  I've created a method that takes a datatable as a parameter, creates a RadGridView, sets the dataSource to the datatable, and then exports.  Problem is that the RadGridview doesn't seem to be getting populated with the contents of the dataTable.  I feel like I'm missing something like 'gridView.DataBind();' but I can't find anything like that in the documentation.  Code is below:

public static void ExportToExcel(DataTable myDT)

        {             using (Telerik.WinControls.UI.RadGridView grid = new Telerik.WinControls.UI.RadGridView())

            {

                grid.AutoGenerateColumns = true;

                grid.DataSource = myDT;

                //grid.LoadElementTree();

                //grid.Refresh();

                GridViewSpreadExport spreadExporter = new GridViewSpreadExport(grid);                 SpreadExportRenderer exportRenderer = new SpreadExportRenderer();

                spreadExporter.RunExport("c:\\exportedFile.xlsx", exportRenderer);

            }

        }

Nadya | Tech Support Engineer
Telerik team
 answered on 09 Apr 2021
5 answers
867 views

Hello there,
I have some question about working with RadScrollablePanel.

Sometimes the RadScrollablePanel does not correctly display the scrollbars. For example, I use RadLabel bounded by width of RadScrollablePanel (using the dynamically changeable MaximumSize property). 
I noticed that the vertical scrollbar does not always appear if the height of RadLabel and height of RadScrollablePanel.DisplayRectangle differ by about 10 pixels (at 96 DPI and Segoe UI 8.25pt font). This is clearly seen in example 1.
If we change width of RadScrollablePanel by a few pixels, we will see a different picture. A vertical scrollbar will be displayed on the screen and everything will look like it’s supposed to be. Keep in mind that the height of the elements remains unchanged. This is seen in example 2.
But that's not all. If we change the RadForm size a little more again, then we will see that the vertical scrollbar disappeared from the screen again; however, it's marked as Visible = True and if we take the focus on RadScrollablePanel, we can scroll the content using mouse wheel for example. This is seen in example 3.

Example 1: https://c2n.me/3ZabLEg
Example 2: https://c2n.me/3Zaclrf
Example 3: https://c2n.me/3ZacJol

At first sight, this may seem like a minor bug. However, considering that RadForms (or another container) with a fixed size can be used, and the text itself can change dynamically during operation, this bug causes problems with displaying information for users.
What guidelines can you give to work with RadScrollablePanel to prevent this bug?
Below I attach project with example. Please change extension from JPG to ZIP. 

I use Telerik 2018.3.1016.20 with .Net 3.5 on Win7

Best regards. 

Nadya | Tech Support Engineer
Telerik team
 answered on 08 Apr 2021
6 answers
256 views
Hello,

Is it possible to add an image to a Column Header instead of Text?

Many Thanks for your previous support/help.

LM
Nadya | Tech Support Engineer
Telerik team
 answered on 08 Apr 2021
2 answers
118 views

HEllo

I would like to display a lower case greek delta in the header of a grid view

in the view formatting event I use the following

                If e.CellElement.Text = "D" Then
                    e.CellElement.ColumnInfo.HeaderText = "d"
                    e.CellElement.Font = New Font("Symbol", MyPreference.Font.Size, FontStyle.Bold)
                Else
                    e.CellElement.ResetValue(VisualElement.FontProperty, ValueResetFlags.Local)
                End If

and it displays a latin lowercase "d"

However if I set a upper case latin D :

                If e.CellElement.Text = "D" Then
                    e.CellElement.ColumnInfo.HeaderText = "D"
                    e.CellElement.Font = New Font("Symbol", MyPreference.Font.Size, FontStyle.Bold)
                Else
                    e.CellElement.ResetValue(VisualElement.FontProperty, ValueResetFlags.Local)
                End If

I do get a Greek uppercase Delta

Any clue why it does not work for the lowercase ?

Thanks a lot for any suggestion

Best regards

Pierre-Jean

pierre-jean
Top achievements
Rank 1
Veteran
Iron
 answered on 07 Apr 2021
3 answers
90 views

Hello Telerik,

I'm looking to reproduce one of the gauge of Yahoo finance (see objectiv.jpg) but I'm stuck with my prototype (see actual.jpg) and the following questions !

 

- How to change the text of labels ?

- How to customize the rendering of the needleIndicator and its label ? (In my prototype I can't put the label above the NeedleIndicator with TextOffsetIndicator because it go outside the border of the control and is not drawn)

 

Thank you for your support

Marco Guignard

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 07 Apr 2021
2 answers
456 views

Hello, does anybody have experience with printing gridview where one of the columns contains strings formatted with barcode font?

I have three columns in the grid and my goal is to print gridview where one column is formatted with barcode font and the rest of columns are formatted with different font. I am able to set the barcode font to all datacells. It seems that GridPrintStyle does not support such granular columns formatting.

private void btnPrintDispatchedContainers_Click(object sender, EventArgs e)
{
    GridPrintStyle style = new GridPrintStyle();
    style.FitWidthMode = PrintFitWidthMode.NoFit;
    style.PrintGrouping = true;
    style.PrintHeaderOnEachPage = true;
    style.PrintHiddenColumns = false;
    Font barcodeFont = new Font("Code 128", 20f, FontStyle.Regular);
    Font groupRowFont = new Font("Segoe UI", 12f, FontStyle.Bold);
    style.CellFont = barcodeFont;
    style.GroupRowFont = groupRowFont;
    rgvDispatchedContainers.PrintStyle = style;
    rgvDispatchedContainers.Print();
}

 

Any thoughts will be appreciated.

Tomas
Top achievements
Rank 2
Veteran
 answered on 06 Apr 2021
6 answers
270 views

Hi,

When I query a RadGridView column's FilterDescriptor (.ToString()) I am getting basically an SQL representation of the applied filter, for example:

([coupon] >= 0.5) AND (([analytics_model_class] LIKE '%Other%' OR [analytics_model_class] NOT LIKE '%Card%'))

However, when I have to set the FilterDescriptor programmatically, I need to use the code as described here:

https://docs.telerik.com/devtools/winforms/controls/gridview/filtering/setting-filters-programmatically-(composite-descriptors)

This is pretty hard if I load a previously created SQL-like clause and now need to parse it in order to set the FilterDescriptors for all the columns.

Seems to me that there should be a utility available for this kind of purpose already, especially since Telerik already converts FilterDescriptors to SQL-like clauses.

Is there something that can help?

Thank you

Peter

 

 

 

Pioter
Top achievements
Rank 1
 answered on 05 Apr 2021
1 answer
69 views

Hello,

 

I am currently using a Scheduler control in weekview where the range of hours that's visible is about 6 hours.

The appointments are shown in this view but the text is always aligned at the top of the AppointmentElement.

When the top of the AppointmentElement is outside the view, you see only a colored rectangle and it's not clear what appointment is shown

 

Is there a way to

- align the text at the top of the AppointmentElement when the start-time is within the view.

- align the text at the top of the Schedulerview when the start-time is NOT within the view. (the text will be shown somewhere in the middle of the rectange)

 

I have added a picture to clarify my question.

 

Best regards

Patrick Vossen

Nadya | Tech Support Engineer
Telerik team
 answered on 05 Apr 2021
1 answer
225 views

I'm having an issue with updates not occurring in a while scrolling ListView with SimpleListViewVisualItem children down - scrolling up works fine.  Figuring it has to do with virtualization/cell reuse and the VisualItemFormatting method is incomplete and needs to update the row.

Where am I going wrong?

Thanks,

_D

 

using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Telerik.WinControls.Layouts;
using Telerik.WinControls.UI;
 
namespace TelerikWinFormsApp4
{
    public partial class RadForm1 : Telerik.WinControls.UI.RadForm
    {
        public RadForm1()
        {
            InitializeComponent();
 
            this.radListView1.VisualItemCreating += new ListViewVisualItemCreatingEventHandler(this.radListView1_VisualItemCreating);
            this.radListView1.VisualItemFormatting += new ListViewVisualItemEventHandler(radListView1_VisualItemFormatting);
 
            // Populate BullJiveTestListItem with fluff
            BindingList<BullJiveTestListItem> rows = new BindingList<BullJiveTestListItem>();
            for (int alpha = 65; alpha < 85; alpha++) rows.Add(new BullJiveTestListItem(Convert.ToChar(alpha).ToString()));
 
            this.Size = new Size(500, 300);
            radListView1.DataSource = rows;
            radListView1.ItemSize = new Size(0, 100);
            radListView1.FullRowSelect = true;
        }
 
 
        private void radListView1_VisualItemCreating(object sender, ListViewVisualItemCreatingEventArgs e)
        {
            if (radListView1.ViewType == ListViewType.ListView)
            {
                e.VisualItem = new RowVisualItem();
            }
        }
 
 
        private void radListView1_VisualItemFormatting(object sender, ListViewVisualItemEventArgs e)
        {
            if (radListView1.ViewType == ListViewType.ListView)
            {
                //BullJiveTestListItem v = (BullJiveTestListItem)e.VisualItem.Data.Value;
                //????
            }
        }
    }
 
    public class RowVisualItem : SimpleListViewVisualItem
    {
        private LightVisualElement hBox0, hBox1;
        private StackLayoutPanel horizontalLayout;
        private Point newSize = new Point(0, 100);
 
 
        protected override void CreateChildElements()
        {
            base.CreateChildElements();
 
            horizontalLayout = new StackLayoutPanel();
            horizontalLayout.Orientation = Orientation.Horizontal;
 
            hBox0 = new LightVisualElement();
            hBox0.MinSize = new Size(newSize);
            horizontalLayout.Children.Add(hBox0);
 
            hBox1 = new LightVisualElement();
            hBox1.MinSize = new Size(newSize);
            horizontalLayout.Children.Add(hBox1);
 
            Children.Add(horizontalLayout);
        }
 
 
        protected override void SynchronizeProperties()
        {
            base.SynchronizeProperties();
 
            if (this.FindAncestor<RadListViewElement>() == null) return;
 
            this.Text = "<html><span style=\"color:black;font-size:14.5pt;\">Text</span>";
 
            hBox0.Size = new Size(newSize);
            hBox0.Text = "<html><span style=\"color:green;\">(hBox0)Value0: </span><span style=\"color:DarkMagenta;\">" + this.Data["Value0"] + "</span>" +
                         "<br><span style=\"color:red;\">(hBox0)Value1: </span><span style=\"color:blue;\">" + this.Data["Value1"] + "</span>";
 
            hBox1.Size = new Size(newSize);
            hBox1.Text = "<html><span style=\"color:darkblue;\">(hBox1)Value2: </span><span style=\"color:purple;\">" + this.Data["Value2"] + "</span>" +
                         "<br><span style=\"color:orange;\">(hBox1)Value3: </span><span style=\"color:gray;\">" + this.Data["Value3"] + "</span>";
 
            TextAlignment = ContentAlignment.TopLeft;
        }
 
 
        protected override Type ThemeEffectiveType
        {
            get
            {
                return typeof(SimpleListViewVisualItem);
            }
        }
    }
    public class BullJiveTestListItem
    {
        public BullJiveTestListItem(string s)
        {
            Value0 = s + "0";
            Value1 = s + "1";
            Value2 = s + "2";
            Value3 = s + "3";
        }
 
 
        public string Value0 { get; set; }
        public string Value1 { get; set; }
        public string Value2 { get; set; }
        public string Value3 { get; set; }
    }
}
Nadya | Tech Support Engineer
Telerik team
 answered on 05 Apr 2021
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
+? 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?