Telerik Forums
UI for WinForms Forum
2 answers
650 views

If you're like me you are not a fan of any "date/time picker" control out there.  The UI around them is often clunky or confusing or both.  The Telerik radDateTimePicker is about as good as it gets though and for anyone who would like them, here are a few useful tips to make using them just a bit easier.

Keyboard Entry: (My applications use a "/" delimiter for your dates - but any delimiter will work) 

Would you like your users to be able to TYPE, "1/1/13"and get "01/01/13" ?  How about "020223" to get "02/02/2023" ?

Telerik UI Winforms has an outstanding Mask called "FreeFormDateTime" and this gets us 95% of the way there but it has its quirks (you can type in "2///34234/" if you want.  It's not a date and the control is great enough to tell you that but the user can still enter it adding to an ugly UI experience.

Here's how I incorporate FreeFormDateTime mask and still get all of the functionality my users require:

DATE_DELIM illustrates the delimiter my application uses - change it to "-" or "." or whatever your application required.  The sample code below references dtpFrom.  This is a radDateTimePicker from the UI Winforms library.

Private ConstDATE_DELIM As String= "/"

 

Private SubFrmDevTest_Load(sender As Object, e AsEventArgs) Handles Me.Load

' I need to capture the keypress, set my masktype and format and clear out the old date value

AddHandlerdtpFrom.DateTimePickerElement.TextBoxElement.KeyPress, AddressOfHandleDateKeyPress

dtpFrom.DateTimePickerElement.TextBoxElement.MaskType = MaskType.FreeFormDateTime

dtpFrom.Format = DateTimePickerFormat.Custom

dtpFrom.CustomFormat = "MM/dd/yyyy"

dtpFrom.Text = ""

 

End Sub

 

Private SubHandleDateKeyPress(sender As Object, e AsKeyPressEventArgs)

Dimctrl AsRadMaskedEditBoxElement = CType(sender, RadMaskedEditBoxElement)

DimmyChar As Integer= Asc(e.KeyChar)

' If they hit the delimiter key then...what do i do now?

' I know at the end i'll have two delimiters like this:

' mm/dd/yyyy - My application uses a slash but if you want to use something else just change the DATE_DELIM constant.

Select CasemyChar

Case13

' If they hit Enter - selection start and length may still be active. Go shut those off

ctrl.TextBoxItem.SelectionStart = ctrl.TextBoxItem.Text.Length

ctrl.TextBoxItem.SelectionLength = 0

CaseAsc(DATE_DELIM)

' First i need to know where the cursor is - this'll be zero-based

DimCursPos As Integer= ctrl.TextBoxItem.SelectionStart

' I also want to know everythign that's in the textbox

DimCurDateString As String= ctrl.TextBoxItem.Text

 

' Time to make the donuts.

 

' Start by looking at the remainder of the CurDateString

' I do this because for now i dont care if i already have the max number of delimiters

DimDateRemaining As String= Mid(CurDateString, CursPos + 1)

' Now look in that remaining string to see if there's already another delimiter present

DimSearchForThis As String= DATE_DELIM

DimFirstCharacter As Integer= DateRemaining.IndexOf(SearchForThis)

DimNextCharacter As Integer= DateRemaining.IndexOf(SearchForThis, FirstCharacter + 1)

IfFirstCharacter = -1 Then

' I didnt find one...so lets count how many delimiters are already present.

' This will determine whether or not to actually add the delimiter

' Just count the parts

DimParts() As String= CurDateString.Split(DATE_DELIM)

DimNumDelims As Integer= Parts.Count

' if i have 3 parts, then i have a mm/dd and yy - dont let them enter any more.

IfNumDelims = 3 Then

e.Handled = True' Ignore the keypress

End If

Else

' We found one...ignore the keypress and move the cursor

e.Handled = True

' Where do i move the cursor to?

DimMoveCursorPos As Integer= (CursPos + FirstCharacter) + 1

' Move it.

ctrl.TextBoxItem.SelectionStart = MoveCursorPos

' How much do i select?

DimSelectLength As Integer

IfNextCharacter = -1 Then

' Select all of the remaining text

SelectLength = (ctrl.TextBoxItem.Text.Length - MoveCursorPos)

Else

' Only select up to the next delimiter

SelectLength = NextCharacter - (FirstCharacter + 1)

End If

' Select it.

ctrl.TextBoxItem.SelectionLength = SelectLength

End If

End Select

End Sub

That's it.  Your users will experience a very genuine "Free Form" date entry box with a modicum of enforced rules.

 

MouseWheel:

It's SUPER nice to be able to cursor over the DateTimePicker, select the "Month" and start spinning your mouse wheel to scroll up/down the month value.  This also works for Day and Year segments in the date....So if this is so great why mention it?  Well, it's great and its brutal at the same time.   I'll explain:

My applications have forms that do not fit on screen all of the time.  This became extremely apparent when COVID rolled over us and we all found ourselves working from home.  Most of my users don't have screen resolutions as large as they were enjoying at work.  This resulted in me having to ensure my forms would scroll easily for my users without any training.  The mouse-wheel was the answer.  Everyone already used it for this purpose and its support is practically built into Visual Studio. 

The problem is this:  When you are scrolling your WinForm using the mouse wheel...and your cursor happens to flow over the top of a radDateTimePicker control - the form STOPS SCROLLING and the radDateTimePicker snatches focus and IT starts to spin its day/month/year value.   For a Data-Entry page having dates change on you without knowing it = bad.  Having dates change on you to where you have to reload an entire data-structure to fix = bad.  Here's how you fix this:

in your form_Load include this:

dtpFrom.DateTimePickerElement.TextBoxElement.EnableMouseWheel = False

There's really no way to have both worlds here - mouse scrolling dates while also allowing mouse-scrolling forms where its possible your users will scroll over the datetimepickers.  The dates changing inadvertently was the deciding factor.

 

I hope this helps folks :) 

Kindest regards,

Curtis

 

Nadya | Tech Support Engineer
Telerik team
 answered on 19 May 2021
1 answer
4.1K+ views

Hello, 

I have two issues.

The first issue is that I'm binding a Model to RadGridView, and throwing an exception when a value is invalid, and when throwing an exception from a property and catching it with DataError, GridViewDataErrorEventArgs.Exception is not the exception that was thrown from the property, but I get Object of type 'System.DBNull' cannot be converted to type 'System.String'.

This only happens when the property is null or empty string.

FYI, I'm allowing incorrect values to be assigned and do the validation after assigning the value to the property, and this is what I want, because I want to give the user an opportunity to correct base on the original value they entered.

Another issue is that when drawing borders to indicate which cell has a problem, not all borders appear.

As you can see above, I'm missing the top border.

It happens to another theme and sometimes the right side border is missing.

How can I make it so that all the borders appear?

The below is the sample code that you can use to reproduce the errors.

To reproduce the first problem, edit the first cell, clear the value, and the property will throw a "Please enter category name." exception but the exception in RadGridView1_DataError is Object of type 'System.DBNull' cannot be converted to type 'System.String' not the exception thrwon from the property setter.

To reproduce the second problem, edit the first cell, enter any value that is longer than 5 characters and you will see the red border without the top border.


public partial class GridViewTestForm : Form
{
    public GridViewTestForm()
    {
        InitializeComponent();

        List<GridViewDataColumn> gridColumns = new List<GridViewDataColumn>();

        gridColumns.Add(new GridViewTextBoxColumn
        {
            DataType = typeof(string),
            TextAlignment = ContentAlignment.MiddleLeft,
            FieldName = nameof(ReportCategoryViewModel.CategoryName),
            HeaderText = "Category Name",
            AutoSizeMode = BestFitColumnMode.DisplayedCells,
        });

        gridColumns.Add(new GridViewTextBoxColumn
        {
            DataType = typeof(string),
            TextAlignment = ContentAlignment.MiddleLeft,
            FieldName = nameof(ReportCategoryViewModel.NumberOfReportsUsingCategory),
            HeaderText = "# Reports",
            ReadOnly = true,
            AutoSizeMode = BestFitColumnMode.DisplayedCells,
        });

        gridColumns.Add(new GridViewTextBoxColumn
        {
            DataType = typeof(string),
            TextAlignment = ContentAlignment.MiddleLeft,
            FieldName = nameof(ReportCategoryViewModel.Description),
            HeaderText = "Description",
        });

        // Add the columns to the grid
        radGridView1.MasterTemplate.Columns.AddRange(gridColumns);
        radGridView1.EnableSorting = true;
        radGridView1.MasterTemplate.AllowMultiColumnSorting = true;

        radGridView1.DataError += RadGridView1_DataError;
        radGridView1.CellValidating += RadGridView1_CellValidating;

        var viewModel = new ReportCategoryManagementViewModel();
        viewModel.LoadReportCategories();
        radGridView1.DataSource = viewModel.ReportCategories;
    }

    private void RadGridView1_CellValidating(object sender, CellValidatingEventArgs e)
    {
        radGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].ErrorText = string.Empty;
        radGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.CustomizeBorder = false;
    }

    private void RadGridView1_DataError(object sender, GridViewDataErrorEventArgs e)
    {
        radGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].ErrorText = e.Exception.Message;
        radGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.CustomizeBorder = true;
        radGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.DrawBorder = true;
        radGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.BorderWidth = 1;
        radGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.BorderGradientStyle = Telerik.WinControls.GradientStyles.Solid;
        radGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Style.BorderColor = Color.Red;
        e.Cancel = true;
    }
}
public class NotifyPropertyBase : INotifyPropertyChanged
{
    public bool IgnoreValidation { get; set; } = false;
    public event PropertyChangedEventHandler PropertyChanged;
    public virtual void OnPropertyChangedRaised([CallerMemberName] string propertyName = "")
    {
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    }
}
public class ReportCategoryManagementViewModel : NotifyPropertyBase
{
    private ObservableCollection<ReportCategoryViewModel> _reportCategories = null;
    public ObservableCollection<ReportCategoryViewModel> ReportCategories => _reportCategories;
    public event EventHandler<List<ReportCategoryViewModel>> ReportCategoriesLoaded;
    public bool _isBusy = false;
    public bool IsBusy { get => _isBusy; set { if (_isBusy != value) { _isBusy = value; OnPropertyChangedRaised(); } } }
    public ReportCategoryManagementViewModel()
    {

    }
    public void LoadReportCategories()
    {
        _reportCategories = new ObservableCollection<ReportCategoryViewModel>()
        {
            new ReportCategoryViewModel()
            {
                IgnoreValidation = true,
                CategoryName = "My category",
                NumberOfReportsUsingCategory = 2,
                Description = "my optional description for my category"
            }
        };
        foreach(var category in _reportCategories)
            category.IgnoreValidation = false;
    }
}
public class ReportCategoryViewModel : NotifyPropertyBase
{
    public EntityState State { get; private set; } = EntityState.Unchanged;
    private string _categoryName = string.Empty;
    public string CategoryName
    {
        get => _categoryName;
        set
        {
            if (_categoryName != value)
            {
                _categoryName = value;
                OnPropertyChangedRaised();
                if (!IgnoreValidation)
                {
                    if (!string.IsNullOrWhiteSpace(_categoryName))
                    {
                        if (_categoryName.Length > 5)
                            throw new Exception("Maximum character is 5.");
                    }
                    else
                    {
                        _categoryName = string.Empty;
                        throw new Exception("Please enter category name.");
                    }
                }
            }
        }
    }
    private int _numberOfReportsUsingCategory;
    public int NumberOfReportsUsingCategory { get => _numberOfReportsUsingCategory; set { if (_numberOfReportsUsingCategory != value) { _numberOfReportsUsingCategory = value; OnPropertyChangedRaised(); } } }
    private string _description;
    public string Description { get => _description; set { if (_description != value) { _description = value; OnPropertyChangedRaised(); } } }
}

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 May 2021
1 answer
122 views

I am new to Telerik controls.

I have updated the design of a radtoggleswitch. This is how it looks in the VS designer . But when i run the application the look changes to . Cannot figure out why this is happening. Am i missing something here,

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 11 May 2021
2 answers
126 views

Hello

I have a databound grid that has a column containings integer numerical values as per the following example:

  • 5
  • 3
  • -1
  • 2
  • -1
  • 1
  • 4

and I wish to sort this grid following the following rule:
for ascending sort I wish to have:

  • 1
  • 2
  • 3
  • 4
  • 5
  • -1
  • -1

and for descending sort:

  • 5
  • 4
  • 3
  • 2
  • 1
  • -1
  • -1

In other words I wish to have the negativ values always at the end and the positiv values at the top in ascending or descending order.

I have looked at the custom sorting documentation but I do not understand how to set the e.sortresult property to achieve this sort behavior

Thanks in advance
Best Regards
Pierre-Jean

 

 

pierre-jean
Top achievements
Rank 1
Veteran
Iron
 answered on 10 May 2021
2 answers
830 views

In the included screenshot I see the white borders (or background color) on the sides indicated by the red arrows. How can I make these borders disappear? 

In the screenshot it is also visible that on the right side a lighter colored area appears, this color is the same is the color used to highlight the selected radpageviewpage (in the screenshot RadPageViewPage8). How can I prevent this from happening? To clarify I included a second screenshot which shows how I would like to see it.

I'm using Telerik.WinControls, Version=2018.3.1016.40.

The code below shows a form with can be used to reproduce the page views shown above (without the images and no toolbar):
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class Form1
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()>
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()>
    Private Sub InitializeComponent()
        Me.RadPageView1 = New Telerik.WinControls.UI.RadPageView()
        Me.RadPageViewPage1 = New Telerik.WinControls.UI.RadPageViewPage()
        Me.RadPageView3 = New Telerik.WinControls.UI.RadPageView()
        Me.RadPageViewPage10 = New Telerik.WinControls.UI.RadPageViewPage()
        Me.RadPageViewPage11 = New Telerik.WinControls.UI.RadPageViewPage()
        Me.RadPageViewPage2 = New Telerik.WinControls.UI.RadPageViewPage()
        Me.RadPageView2 = New Telerik.WinControls.UI.RadPageView()
        Me.RadPageViewPage6 = New Telerik.WinControls.UI.RadPageViewPage()
        Me.RadPageViewPage7 = New Telerik.WinControls.UI.RadPageViewPage()
        CType(Me.RadPageView1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.RadPageView1.SuspendLayout()
        Me.RadPageViewPage1.SuspendLayout()
        CType(Me.RadPageView3, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.RadPageView3.SuspendLayout()
        Me.RadPageViewPage2.SuspendLayout()
        CType(Me.RadPageView2, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.RadPageView2.SuspendLayout()
        Me.SuspendLayout()
        '
        'RadPageView1
        '
        Me.RadPageView1.Controls.Add(Me.RadPageViewPage1)
        Me.RadPageView1.Controls.Add(Me.RadPageViewPage2)
        Me.RadPageView1.Dock = System.Windows.Forms.DockStyle.Left
        Me.RadPageView1.ItemSizeMode = CType((Telerik.WinControls.UI.PageViewItemSizeMode.EqualWidth Or Telerik.WinControls.UI.PageViewItemSizeMode.EqualHeight), Telerik.WinControls.UI.PageViewItemSizeMode)
        Me.RadPageView1.Location = New System.Drawing.Point(0, 0)
        Me.RadPageView1.Name = "RadPageView1"
        Me.RadPageView1.PageBackColor = System.Drawing.Color.Transparent
        Me.RadPageView1.SelectedPage = Me.RadPageViewPage1
        Me.RadPageView1.Size = New System.Drawing.Size(182, 571)
        Me.RadPageView1.TabIndex = 3
        Me.RadPageView1.ViewMode = Telerik.WinControls.UI.PageViewMode.Stack
        CType(Me.RadPageView1.GetChildAt(0), Telerik.WinControls.UI.RadPageViewStackElement).ItemSpacing = 1
        '
        'RadPageViewPage1
        '
        Me.RadPageViewPage1.BackColor = System.Drawing.Color.Maroon
        Me.RadPageViewPage1.Controls.Add(Me.RadPageView3)
        Me.RadPageViewPage1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.RadPageViewPage1.ImageAlignment = System.Drawing.ContentAlignment.TopCenter
        Me.RadPageViewPage1.ItemSize = New System.Drawing.SizeF(182.0!, 32.0!)
        Me.RadPageViewPage1.Location = New System.Drawing.Point(5, 29)
        Me.RadPageViewPage1.Name = "RadPageViewPage1"
        Me.RadPageViewPage1.Size = New System.Drawing.Size(172, 476)
        Me.RadPageViewPage1.Text = "RadPageViewPage1"
        Me.RadPageViewPage1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter
        Me.RadPageViewPage1.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
        '
        'RadPageView3
        '
        Me.RadPageView3.Controls.Add(Me.RadPageViewPage10)
        Me.RadPageView3.Controls.Add(Me.RadPageViewPage11)
        Me.RadPageView3.Dock = System.Windows.Forms.DockStyle.Fill
        Me.RadPageView3.Location = New System.Drawing.Point(0, 0)
        Me.RadPageView3.Name = "RadPageView3"
        Me.RadPageView3.PageBackColor = System.Drawing.Color.Transparent
        Me.RadPageView3.SelectedPage = Me.RadPageViewPage10
        Me.RadPageView3.Size = New System.Drawing.Size(172, 476)
        Me.RadPageView3.TabIndex = 0
        CType(Me.RadPageView3.GetChildAt(0), Telerik.WinControls.UI.RadPageViewStripElement).StripButtons = Telerik.WinControls.UI.StripViewButtons.None
        CType(Me.RadPageView3.GetChildAt(0), Telerik.WinControls.UI.RadPageViewStripElement).StripAlignment = Telerik.WinControls.UI.StripViewAlignment.Left
        CType(Me.RadPageView3.GetChildAt(0), Telerik.WinControls.UI.RadPageViewStripElement).ItemContentOrientation = Telerik.WinControls.UI.PageViewContentOrientation.Horizontal
        '
        'RadPageViewPage10
        '
        Me.RadPageViewPage10.ImageAlignment = System.Drawing.ContentAlignment.TopCenter
        Me.RadPageViewPage10.ItemSize = New System.Drawing.SizeF(121.0!, 28.0!)
        Me.RadPageViewPage10.Location = New System.Drawing.Point(130, 10)
        Me.RadPageViewPage10.Name = "RadPageViewPage10"
        Me.RadPageViewPage10.Size = New System.Drawing.Size(31, 455)
        Me.RadPageViewPage10.Text = "RadPageViewPage10"
        Me.RadPageViewPage10.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter
        Me.RadPageViewPage10.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
        '
        'RadPageViewPage11
        '
        Me.RadPageViewPage11.ItemSize = New System.Drawing.SizeF(121.0!, 28.0!)
        Me.RadPageViewPage11.Location = New System.Drawing.Point(130, 10)
        Me.RadPageViewPage11.Name = "RadPageViewPage11"
        Me.RadPageViewPage11.Size = New System.Drawing.Size(0, 297)
        Me.RadPageViewPage11.Text = "RadPageViewPage11"
        '
        'RadPageViewPage2
        '
        Me.RadPageViewPage2.Controls.Add(Me.RadPageView2)
        Me.RadPageViewPage2.ImageAlignment = System.Drawing.ContentAlignment.TopCenter
        Me.RadPageViewPage2.ItemSize = New System.Drawing.SizeF(182.0!, 32.0!)
        Me.RadPageViewPage2.Location = New System.Drawing.Point(5, 29)
        Me.RadPageViewPage2.Name = "RadPageViewPage2"
        Me.RadPageViewPage2.Size = New System.Drawing.Size(172, 476)
        Me.RadPageViewPage2.Text = "RadPageViewPage2"
        Me.RadPageViewPage2.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter
        Me.RadPageViewPage2.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
        '
        'RadPageView2
        '
        Me.RadPageView2.Controls.Add(Me.RadPageViewPage6)
        Me.RadPageView2.Controls.Add(Me.RadPageViewPage7)
        Me.RadPageView2.Dock = System.Windows.Forms.DockStyle.Fill
        Me.RadPageView2.Location = New System.Drawing.Point(0, 0)
        Me.RadPageView2.Name = "RadPageView2"
        Me.RadPageView2.SelectedPage = Me.RadPageViewPage6
        Me.RadPageView2.Size = New System.Drawing.Size(172, 476)
        Me.RadPageView2.TabIndex = 1
        CType(Me.RadPageView2.GetChildAt(0), Telerik.WinControls.UI.RadPageViewStripElement).StripButtons = Telerik.WinControls.UI.StripViewButtons.None
        CType(Me.RadPageView2.GetChildAt(0), Telerik.WinControls.UI.RadPageViewStripElement).StripAlignment = Telerik.WinControls.UI.StripViewAlignment.Left
        CType(Me.RadPageView2.GetChildAt(0), Telerik.WinControls.UI.RadPageViewStripElement).ItemContentOrientation = Telerik.WinControls.UI.PageViewContentOrientation.Horizontal
        '
        'RadPageViewPage6
        '
        Me.RadPageViewPage6.ImageAlignment = System.Drawing.ContentAlignment.TopCenter
        Me.RadPageViewPage6.Location = New System.Drawing.Point(124, 10)
        Me.RadPageViewPage6.Name = "RadPageViewPage6"
        Me.RadPageViewPage6.Size = New System.Drawing.Size(22, 245)
        Me.RadPageViewPage6.Text = "RadPageViewPage6"
        Me.RadPageViewPage6.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter
        Me.RadPageViewPage6.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
        '
        'RadPageViewPage7
        '
        Me.RadPageViewPage7.ImageAlignment = System.Drawing.ContentAlignment.TopCenter
        Me.RadPageViewPage7.Location = New System.Drawing.Point(124, 10)
        Me.RadPageViewPage7.Name = "RadPageViewPage7"
        Me.RadPageViewPage7.Size = New System.Drawing.Size(26, 297)
        Me.RadPageViewPage7.Text = "RadPageViewPage7"
        Me.RadPageViewPage7.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter
        Me.RadPageViewPage7.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText
        '
        'Form1
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(869, 571)
        Me.Controls.Add(Me.RadPageView1)
        Me.Name = "Form1"
        Me.Text = "Form1"
        CType(Me.RadPageView1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.RadPageView1.ResumeLayout(False)
        Me.RadPageViewPage1.ResumeLayout(False)
        CType(Me.RadPageView3, System.ComponentModel.ISupportInitialize).EndInit()
        Me.RadPageView3.ResumeLayout(False)
        Me.RadPageViewPage2.ResumeLayout(False)
        CType(Me.RadPageView2, System.ComponentModel.ISupportInitialize).EndInit()
        Me.RadPageView2.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub
    Friend WithEvents RadPageView1 As Telerik.WinControls.UI.RadPageView
    Friend WithEvents RadPageViewPage1 As Telerik.WinControls.UI.RadPageViewPage
    Friend WithEvents RadPageViewPage2 As Telerik.WinControls.UI.RadPageViewPage
    Friend WithEvents RadPageView2 As Telerik.WinControls.UI.RadPageView
    Friend WithEvents RadPageViewPage6 As Telerik.WinControls.UI.RadPageViewPage
    Friend WithEvents RadPageViewPage7 As Telerik.WinControls.UI.RadPageViewPage
    Friend WithEvents RadPageView3 As Telerik.WinControls.UI.RadPageView
    Friend WithEvents RadPageViewPage10 As Telerik.WinControls.UI.RadPageViewPage
    Friend WithEvents RadPageViewPage11 As Telerik.WinControls.UI.RadPageViewPage
End Class

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 10 May 2021
2 answers
185 views

Hi
I have RadGridView with editable checkbox column. I created custom summary row item which code i presented below.

public class CheckedRowsSummaryItem : GridViewSummaryItem
    {
        public CheckedRowsSummaryItem(string name, string formatString, GridAggregateFunction aggregate)
            : base(name, formatString, aggregate)
        { }
        public override object Evaluate(IHierarchicalRow row)
        {
            int count = 0;
            foreach (GridViewRowInfo childRow in row.ChildRows)
            {
                try
                {
                    if ((bool)childRow.Cells["chkBoxKol"].Value)
                    {
                        count++;
                    }
                }
                catch { }
            }
            return count;
        }
    }

 

My problem is that when I change the chceckbox state my custom row summary for the column is not refreshed until I change current row or current cell. I tried to set IsCurrent properity on false or rise EndEdit() method for the grid in CellBeginEdit event but these solutions not worked. How could I programmatically make my summary refresh to avoid changing current column by the user?

 

All the best

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 06 May 2021
8 answers
349 views
I have an issue where is can be difficult or impossible to resize the Radform using the mouse.  The conditions;
  1. Most recent Telerik controls at this time, OS is Win7 64 Ultimate
  2. Style is Sizable, Minimum size is 1024,700
  3. Only affects the top left and right corner
  4. Happens on Win8 and VS2012 themes, but not the Office themes
  5. The form height and width can always be adjusted from the top or sides of the form

What happens is when the mouse is moved into the corner and the diagonal resize cursor appears, the form will not resize.  The attached image shows the effect. 

  1. In the first titlebar image, the mouse is moved into the corner from the center of the form. From the noted cursor position, the form cannot be resized.  From this position, once a resize is attempted, repositioning the mouse and retrying the resize may not work at all.
  2. In the second titlebar image, the mouse is moved in from outside the form, and from the noted cursor position resizing works fine.
  3. In the third image with the Office theme there is never any problem.
  4. The last 2 images show the same issue in the Telerik Theme viewer.  The same scenario applies as noted in pt 1 & 2 above.

The issue is a problem since the average user does not know what is going on or why it won't resize.  There is a lot of playing around with the mouse to get it work but it will not in many cases.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 06 May 2021
1 answer
151 views

Hi.  I want to bring a custom control that inherits from RasMaskedEditBox. But onKeyDown and OnKeyPress events do not fired.

public class myMask: Radmaskededitbox

{

protected override void OnKeyDown(KeyEventArgs e)

{

//My codes

}

}

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 05 May 2021
1 answer
487 views

Hello,

I would like to know if it is possible to access/change the same properties for the radVirtualKeyboardForm as it is possible for the radVirtualKeyboard. I'm creating an application for a touch screen and I would like to remove some buttons from the keyboard which are not related to the input the user has to enter.

If it is not possible: Is there a possibility to assign also a radVirtualKeyboard to a control? I mean, that the keyboard only appears, if the cursor focus is on the corresponding input field.

 

Thank you in advance and have a wonderful day!

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 05 May 2021
1 answer
111 views

Hi,

I am curious to know whether there is out of box support for visualising GPX files on Radmap control. Any help / sample code will be appreciated.

Thanks in advance

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 05 May 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
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Chart (obsolete as of Q1 2013)
Form
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
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
TrackBar
MessageBox
Rotator
SpinEditor
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
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
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
NavigationView
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?