Telerik Forums
UI for WinForms Forum
1 answer
136 views

Hello,

I would like to ask about DataError event once more (we discussed it a little in some previous thread). I have tested behavior and program crashes in case of parsing error. First, if I do some validation in underlying data object and throw exception in object property setter, GridView handles it corectly and fires DataError event. But in case of parsing error, for example when I have textbox column, integer property and enter some non-numeric text, program crashes with unhandled exception:

I know, I should use GridViewDecimalColumn, but generally, why GridView doesn't handle parsing error and doesn't fire DataError event also in this case? I have attached also the test project, TelerikTestDataError in solution.

Unhandled exception:
System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.String.System.IConvertible.ToInt32(IFormatProvider provider)
   at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
   at System.ComponentModel.BaseNumberConverter.ConvertTo(ITypeDescriptorContext context, CultureInfo culture, Object value, Type destinationType)
   at Telerik.WinControls.UI.RadDataConverter.ParseCore(Object value, Type targetType, Type sourceType, TypeConverter dataTypeConverter, IDataConversionInfoProvider dataColumn, Boolean checkFormattedNullValue, CultureInfo cultureInfo)
   at Telerik.WinControls.UI.RadDataConverter.Parse(IDataConversionInfoProvider converstionInfoProvider, Object value, CultureInfo cultureInfo)
   at Telerik.WinControls.UI.GridDataCellElement.set_Value(Object value)
   at Telerik.WinControls.UI.GridViewEditManager.EndEditCore(Boolean validate, Boolean cancel)
   at Telerik.WinControls.UI.GridViewEditManager.EndEdit()
   at Telerik.WinControls.UI.GridRowBehavior.ProcessEnterKey(KeyEventArgs keys)
   at Telerik.WinControls.UI.GridRowBehavior.ProcessKey(KeyEventArgs keys)
   at Telerik.WinControls.UI.BaseGridBehavior.ProcessKey(KeyEventArgs keys)
   at Telerik.WinControls.UI.BaseGridBehavior.ProcessKeyDown(KeyEventArgs keys)
   at Telerik.WinControls.UI.BaseGridEditor.OnKeyDown(KeyEventArgs keyEventArgs)
   at Telerik.WinControls.UI.RadTextBoxEditor.OnKeyDown(KeyEventArgs e)
   at Telerik.WinControls.UI.RadTextBoxEditor.TextBoxItem_KeyDown(Object sender, KeyEventArgs e)
   at System.Windows.Forms.KeyEventHandler.Invoke(Object sender, KeyEventArgs e)
   at Telerik.WinControls.RadItem.OnKeyDown(KeyEventArgs e)
   at Telerik.WinControls.UI.RadTextBoxItem.TextBoxControl_KeyDown(Object sender, KeyEventArgs e)
   at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
   at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
   at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
   at System.Windows.Forms.Control.WmKeyChar(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
   at System.Windows.Forms.TextBox.WndProc(Message& m)
   at Telerik.WinControls.UI.HostedTextBoxBase.WndProc(Message& message)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Nadya | Tech Support Engineer
Telerik team
 answered on 09 Jul 2024
1 answer
48 views
Hi,
    I can add context menu when right click on the grid, but based on selected value from context menu, i want to hide / show the rows.
Ex: Grid have 4 column's,  One of the column name is "Status", in that we get "Export" , "Done" and "Pending" for each rows, so i show there 3 values in context menu when right click on the grid using following code


'Declaration Private contextMenu1 As RadContextMenu 'Page Load contextMenu1 = New RadContextMenu() Dim menuItem1 As New RadMenuItem("Export") menuItem1.ForeColor = Color.Red AddHandler menuItem1.Click, AddressOf rmi1_Click Dim menuItem2 As New RadMenuItem("Verification") AddHandler menuItem2.Click, AddressOf rmi2_Click contextMenu1.Items.Add(menuItem1) contextMenu1.Items.Add(menuItem2) 'Code for show context menu Private Sub RadGridView1_ContextMenuOpening(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.ContextMenuOpeningEventArgs) Handles RadGridView1.ContextMenuOpening e.ContextMenu = contextMenu1.DropDown End Sub 'Menu click event Private Sub rmi2_Click(sender As Object, e As EventArgs) sender.Visible = CDec(sender.Row.Cells("Status").Value) = "Export" End Sub Private Sub rmi1_Click(sender As Object, e As EventArgs) sender.Visible = CDec(sender.Row.Cells("Status").Value) = "Done" End Sub

 Private Sub rmi1_Click(sender As Object, e As EventArgs)
        sender.Visible = CDec(sender.Row.Cells("Status").Value) = "Pending"
 End Sub

Thanks and Regards
Aravind
Dinko | Tech Support Engineer
Telerik team
 answered on 08 Jul 2024
2 answers
76 views

I have created a custom PropertyGridItemElement for my RadPropertyGrid to hold a button.  When the user clicks the button, the click handler performs some action, but the action is based on data that is known by the form that contains the propertygrid that contains the custom element.  How do I arrange for that data to be available to the button's Click handler?  The constructor of the custom element isn't even called explicitly -- it's implicit in 

PropertyGrid.CreateItemElement += (sender, args) =>
{
if (args.Item.Name == nameof(LabelWrapper.Button))
{
args.ItemElementType = typeof(CustomPropertyGridItemElement);
}
};

Thanks in advance.

Michael
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 04 Jul 2024
14 answers
564 views
I have a RadPageView (DetailTabControl).  I want to change the strip item's back color to red under some condition.  Then I might need to change it back.  I figured out how to change it to red.  Restoring the prior values does not restore the tab as I expected.  The back color (which I caught before setting to Red, ARGB(255, 191, 219, 255)) is for that of the PageView, not the PageViewPage.  Please see attached images.

public class Globals
{
public static Color DefaultTabColor = Color.FromArgb(255, 191, 219, 255);
}
...
private void CancelTab(int offset)
{
     DetailTabControl.Pages[offset].Item.DrawFill = true;
     DetailTabControl.Pages[offset].Item.NumberOfColors = 1;
     DetailTabControl.Pages[offset].Item.BackColor = Color.Red;   
}
private void UncancelTab(int offset)
{
     DetailTabControl.Pages[offset].Item.BackColor = Globals.DefaultTabColor;
     DetailTabControl.Pages[offset].Item.NumberOfColors = 2;
     DetailTabControl.Pages[offset].Item.DrawFill = false;
}

Álvaro
Top achievements
Rank 1
Iron
Iron
 answered on 02 Jul 2024
1 answer
135 views
Hi,
     I want to enable up and down key for  rad grid to select to row and get values from that. In winform how to achieve this ?

Note:  My grid have simply row it not have sub grid or some other. Please provide sample code in vb .

Pls replace asap.

Regards
Aravind
Nadya | Tech Support Engineer
Telerik team
 answered on 27 Jun 2024
1 answer
61 views
1
Nadya | Tech Support Engineer
Telerik team
 answered on 27 Jun 2024
1 answer
121 views

Using RadCalendar and I thought is would be simple

I want all dates in the past to be disabled and I thought this would do it:

        private void radCalendar1_ElementRender(object sender, RenderElementEventArgs e)

        {
            if (e.Day.Date < DateTime.Now)
                e.Day.Disabled = true;
        }

Th goals is to have it look like this but it seems to have no effect and I can selected dates that the code set as disabled.

What am I missing?

Thanks

Carl

Nadya | Tech Support Engineer
Telerik team
 answered on 18 Jun 2024
1 answer
94 views

Hellow!

How can i change the following properties in the object "RadGanttView" (check image for color usage)

  • Height (RED)
  • Width (BLUE)
Nadya | Tech Support Engineer
Telerik team
 answered on 14 Jun 2024
2 answers
167 views

Hi!

When endUpdate occurs in gridview, the scroll moves to the begin.

In my environment I have to beginUpdate and Endupdate.

But 1 dont' want the scroll to move even if the data is Updated(endupdate timing)!

Please tell me how to prevent the scroll from moving automatically when editing mode is released by double-clicking or when endupdate occurs.

The method of updating the scroll value after endupdate by storing the scroll value before beginupdate failed.

A gif Image and simple project are attached. Please help me!!!

Thank you :)

 

 

Park
Top achievements
Rank 1
Iron
 answered on 13 Jun 2024
1 answer
104 views

Hello Team

How to set horizontal scroll position left most in the RadTreeView ?

Note: telerik version 2024.1.312.48

Attached screenshot for reference:

Thanks

Rajkannan

Dinko | Tech Support Engineer
Telerik team
 answered on 10 Jun 2024
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
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
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
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Styling
Barcode
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
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
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?