Telerik Forums
UI for WinForms Forum
3 answers
1.9K+ views

[WinForm]

***Updated with Excel spreadsheet (Template.zip) and a simple Project (ReadExcelMap.zip) attachment.

Reference: https://docs.telerik.com/devtools/winforms/knowledge-base/import-data-from-excel

Question: How to get the Cell background color while importing from Excel spreadsheet?

E.g. The spreadsheet below with value and background color.

 

Import Spreadsheet:

XlsxFormatProvider formatProvider = new XlsxFormatProvider();
            Workbook workbook = formatProvider.Import(File.ReadAllBytes(@"C:\temp\Template.xlsx"));

            var worksheet = workbook.Sheets[0] as Worksheet;
            var table = new DataTable();


            CellSelection selection = worksheet.Cells[3, 25];
            ICellValue value = selection.GetValue().Value;
            CellValueFormat format = selection.GetFormat().Value;
            CellValueFormatResult formatResult = format.GetFormatResult(value);
            string result = formatResult.InfosText;

 

I could not find the relevant functions. Attempted the following but not working:
            IFill f = selection.GetFill().Value;
            ThemableColor c = selection.GetForeColor().Value;

 

Maria
Telerik team
 answered on 17 Nov 2022
1 answer
209 views

In the ItemCheckedChanged event, I want to also select the item, yet the following assignment returns the error "The property or indexer 'ListViewDataItem.Selected' cannot be used in this context because the set accessor is inaccessible."

e.Item.Selected = true;

How do I do this?

Dinko | Tech Support Engineer
Telerik team
 answered on 17 Nov 2022
1 answer
128 views

Hello!

The ShapedForm seems to suffer from a few problems:

1. The Shape doesn't honor the Bottom/Top Left/Right Rounded properties at all. No matter what those properties are set to, I always get rounded corners. The attached screenshot should have the top left and bottom left corner rounded only, but shows all corners rounded.

2. When using a border, it is cut off on the right top and right bottom corner (see screenshots). Depending on the border width, it is missing completely.

3. Even when the title bar is removed, the dialog can be moved by the mouse. While this is a handy feature, it also means that double-clicking on the top area of the shaped form will maximize the form and that's definitively not wanted.

 

Can we expect to have those bugs fixed in the near future since they severely limit the usability of this shaped form.
It simply doesn't look good that way and I'd rather resort to have a form background image with transparency key.

 

Martin

 

Dinko | Tech Support Engineer
Telerik team
 answered on 17 Nov 2022
1 answer
164 views

Hi folks!

Just recently I started using Telerik UI for WinForms, but while playing around with the controls to get used to them I found that the RadToggleSwitch doesn't behave like the toggle switches from WinUI/Win10/Win11.

First, the RadToggleSwitch can be activated and the slider can be dragged by using the right mouse button as well. That's not supposed to happen.

Second, the switch sometimes doesn't activate when clicking with the left mouse button. I couldn't find a consistent way to reproduce, though. Only the intermittent observation that the switch didn't change value even though I've clearly clicked inside the button area.

Perhaps a 1 pixel mouse movement between Press and Release will start a drag&drop operation for the slider instead of toggling the value?

Did anyone else experience this behavior?

 

Cheers

Martin

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 Nov 2022
1 answer
137 views

Hello!

When i right left click on a cell (of a radgridview) then right click on the same cell, my custom contextmenu (doesn't need to be custom, i can replicate this exact behaviour on the default one) works as intended. However, when i use the right click first, the contextmenu doesn't work as intended... It shows but if i hover my mouse the items don't get "pre-selected", is as it isn't focused. I already exported the properties of the cell on both situations and the one that doesn't work has fewer properties than the one that works (like 30 or so). So, I'm assuming some information is getting lost on the right click. Is there a way to workaround this? Is it a known bug and can i fix it?

I'm using the assemblies '2020.3.1020.40'.

Thank you for the attention!

 

JP

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 Nov 2022
1 answer
210 views

I have a radGridView, bound to a datatable with certain columns marked as readonly. The problem is that for the readonly columns, the user can still attempt to edit the cell text/value and only upon leaving the cell are they presented with a message that appears as so.

My goal when clicking on the cell of a readonly column, BeginEdit would not fire (ie, the cursor would not enter the cell). I've tried creating several different events and checking if column is readonly and then cancelling the event but I seem to have no luck.

        private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            if (e.Column.ReadOnly)
            {
                e.Cancel = true;
            }
        }

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 17 Nov 2022
1 answer
131 views

Hello good day.

I am making an application that shows a graph, I use the chartview control, but when there is too much data on the X axis, the information is not distinguished.


I have read that it can be fixed by using MajorTickInterval on the horizontalAxis, I use this lines:

horizontalAxis.LabelFitMode = AxisLabelFitMode.Rotate;
horizontalAxis.MajorTickInterval = 7;

The clearest information is already displayed, but when displaying the information some data should appear in the graph but they are not shown because they are not in the interval.

Is there a solution?

Another question,

Can you remove or hide from the graph the values that have zero or null on the X axis?

Awaiting your comments.
Thank you very much.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 14 Nov 2022
2 answers
405 views

Count total checked values from checkbox column of RadGridView ?!

seems very east stuff but dont know why telerik does not support like normal gridview !! strange but true !

Regards,

Dipan Chikani

Nandan
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 14 Nov 2022
1 answer
156 views
RADControls are not loaded in ToolBox after upgrading Visual Studio to version 17.4.0 with .Net 4.8.04084 and Telerik WInform 2022.2.613.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 14 Nov 2022
1 answer
78 views

Hello,

I managed to get the RADControls to the Tookit but when I drag it to a RADForm I got the error attached. 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 14 Nov 2022
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?