Telerik Forums
UI for WinForms Forum
2 answers
1.5K+ views

We have a simple datagrid where the first column contains a Vendor Number and the second is a read-only column containing the name of that vendor.  Users can freely enter into the first column, and in the CellValidation event, we verify that the format of what they entered is correct and then lookup the number they entered to populate the second column with the name.

The function looks something like this:

Private Sub ValidateCell(sender As System.Object, e As Telerik.WinControls.UI.CellValidatingEventArgs)
    Dim vendNum As String = ""
    If e.ColumnIndex = 0 AndAlso Not String.IsNullOrWhiteSpace(e.Value) Then
        vendNum = e.Value
         
        'Format the Vendor Number
        vendNum = FormatVendorNumber(vendNum)
        Me.dgvVendors.CurrentCell.Value = vendNum 'dgvVendors is our data grid
 
        'Find the name of the vendor
        e.Row.Cells(1).Value = GetVendorName(vendNum)
    End If
End Sub

 

If a cell enters edit mode and the value is changed, then the value displayed in the cell is not updated with the formatted version.  However, if a cell enters edit mode and then leaves edit mode with no changes, the formatted value from our function is applied.  For example, if you were to add a new row and type "1" in the cell, our format function would convert that to "00001.00", and if you put a breakpoint in the above code, you would see that both Me.dgvVendors.CurrentCell.Value and the vendNum variable would reflect this formatted value.  However, once processing completes, the cell will still read "1" in the UI.

Now, after having done that, if you click the same cell to enter edit mode and then click somewhere else, the same function above will run, only this time the cell in the UI will be updated to display "00001.00" properly.  Likewise, if you edit that formatted value and remove a zero, the function will fail to update the value, but if after doing that, you click on the cell and then leave it without making any changes, it will be formatted again and the missing zero will be added back.  The validating event handler can only update the cell value if that value was not actually changed during editing.

 

Note: The last line setting e.Row.Cells(1).Value to the Vendor Name always works.  We've tried this syntax to apply our updated Vendor Number to Cells(0), but get the exact same results as using Me.dgvVendors.CurrentCell.Value.

Any idea what's going on here or how to correct it?

Hristo
Telerik team
 answered on 10 May 2017
2 answers
87 views

I use RadGridView and have custom cell element.

I set row height = 300.

For custom cell element, i use RadHostItem to create childe
Ex: 

protected override void CreateChildElements()
       {
           base.CreateChildElements();
 
           var label = new Label();
           label.Text = "test";
           var layout = new TableLayoutPanel();
           layout.ApplyDefaultStyles("Master layout");
           layout.Dock = DockStyle.Fill;
           layout.ColumnCount = 1;
           layout.RowCount = 1;
           layout.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
           layout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
           layout.Controls.Add(label, 0, 0);
           layout.AutoScroll();
 
           var child = new RadHostItem(layout) { AutoSizeMode = RadAutoSizeMode.Auto};
           Children.Add(child);
       }

 

Result (see the picture in attachments)

Thanks and kind regards

Paul

 

Hristo
Telerik team
 answered on 10 May 2017
2 answers
126 views

Hi,

 

I have inherited a scheduler like this:

 

Public Class Test
    Inherits RadScheduler

End Class

 

All works very fine. But i have trouble with themes.

I added a application-wide theme like this:

   Dim visualStudio2012LightTheme1 = New Themes.VisualStudio2012LightTheme()
   ThemeResolutionService.ApplicationThemeName = visualStudio2012LightTheme1.ThemeName

 

The SchedulerNavigator (also in my Form) changed its style, but my inherited scheduler do not. The scrollbar on the right side has the new theme, and the appointment form and all other "subcontrols".

More details in screenshot.

 

Can you help me?

 

 

Sascha
Top achievements
Rank 1
 answered on 10 May 2017
2 answers
127 views
Currently if you select the control by clicking on it - it makes active editable part of the date exactly where you clicked (for ex. yyyy part of the mm/dd/yyyy date). Users want to have selection  to be always in the start of the date not tied to place where they clicked . How could be selection be moved to the first part of the date (mm part in our case)?
Vladimir
Top achievements
Rank 1
 answered on 10 May 2017
2 answers
327 views

Hello,

I tried to bring our scatter plot chart feature from our website to our winform application.

I tried to use chartview to implement this feature, then I cannot find an option to add title into x-axis and y-axis.

So what should I do to add title into x-axis and y-axis?

Attachment #1 is in website version

Attachment #2 is in winform version

Regard,

Paul

 

Paul
Top achievements
Rank 1
 answered on 10 May 2017
5 answers
223 views

Hello,

I tried to create a scatter plot chart just like attachment 1. Then I tried to show checkbox to show/ hide it's series points.

In this case, the long labels have been overlap and I tried to style for legend items to make the labels is next to the checkbox but I cannot find the solution.

So what should I do to do like that?

Regard,

Paul

Paul
Top achievements
Rank 1
 answered on 10 May 2017
5 answers
210 views

Hello,

I tried to update icons for: options, pin and close buttons just like attachment #1 then the background of 3 buttons always white although I tried many ways to change it (the result is attachment #2).

So what should I do to change these 3 buttons's icon?

3 sample icons have been attached in the attachment section

Regard,

Paul

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 10 May 2017
0 answers
87 views

How to firing enter key only on column 1 or 2 ...

have this code ... 

    Private Sub GridList_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles GridList.KeyDown
        If e.KeyCode = Keys.Enter Then
                 Msgbox "Enter KeyPress" 

       End If

    End Sub

Hengky
Top achievements
Rank 1
Veteran
 asked on 10 May 2017
2 answers
519 views

Working with (trial) version 2017.2.502.40... 

I'm trying to build a simple editor, but request is that users should be allowed to change only very few formatting details in the document: essentially

- just set bold on / off

- format text as list

- and set paragraph alignment

I've tried to customise the provided ribbon, but if I hide tabs, this results in holes between the remaining tabs.

I've been looking for a sample with a custom toolbar them, but cannot find any.

 

Any hints

TIA

Ralitsa
Telerik team
 answered on 09 May 2017
1 answer
252 views

 

cannot create an instance of

telerik.wincontrols.ui.gridviewdatacolumn because it is an abstract class

Dimitar
Telerik team
 answered on 09 May 2017
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
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
CollapsiblePanel
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
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Security
LocalizationProvider
Dictionary
SplashScreen
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?