Telerik Forums
UI for WinForms Forum
1 answer
170 views

Hi,

I'm having a problem while exporting a GridView containing some GridViewCommandColumns to a XLS.

I get a FormatException error in Telerik.WinControls.GridView.dll on these columns.

The code I use for export:

GridViewSpreadExport spreadExporter = new GridViewSpreadExport(gridView);
spreadExporter.ExportChildRowsGrouped = true;
spreadExporter.HiddenColumnOption = Telerik.WinControls.UI.Export.HiddenOption.DoNotExport;
spreadExporter.HiddenRowOption = Telerik.WinControls.UI.Export.HiddenOption.DoNotExport;
SpreadExportRenderer exportRenderer = new SpreadExportRenderer();
spreadExporter.RunExport(sDialog.FileName, exportRenderer);

I don't necessarily need these columns in a XLS, so I tried to hide them before exporting, set some export properties and even set values:

gridView.Columns["column1"].IsVisible = false;
gridView.Columns["column1"].ExcelExportType = Telerik.WinControls.UI.Export.DisplayFormatType.None;

foreach (var row in gridView.Rows)
{
    row.Cells["column1"].Value = 1;
}

The only way a grid exports correctly is when GridViewCommandColumns are deleted from the grid.

Any idea what should I try? I use version 2021.2.511.40.

Thanks in advance.

 

Regards,

Tomáš

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 29 May 2023
1 answer
147 views
While loading the form by default collapse all the page(pages and sub pages) and expand only default page. 
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 29 May 2023
1 answer
214 views

I'm trying to make a clear distinction between the parent and child rows.  I tried the following to change the background color of the child rows:

CellFormatting += (sender, args) =>
{
    if (args.Row.HierarchyLevel > 0)
        args.CellElement.BackColor = Color.Aquamarine;
};

It works, but only when my mouse hovers over a child row.

Also, I'm wondering why the rows in the child grid have plus signs to their left (see the attached image) when there is no third level.

I have not found it easy to figure this out from the API documentation.  There are probably properties that could get me what I want, but are they in the row class?  The template?  The child template?  The grid?  The view?  <shrug>

I once came across a document on your site that describes the overall grid structure and the relationships between these components.  Whether or not I can get help on these specific issues I'd appreciate a link to that document.

Thanks.

Dinko | Tech Support Engineer
Telerik team
 answered on 29 May 2023
1 answer
108 views

Never did this before, but I need to make a custom change to a control that will affect all instances of it throughout the application. If the user clicks in a masked edit control at any position and the control is empty, the cursor should jump to position 1. It works fine when I use the event handler of the control directly like this:

 private void mtbHomePhone_Click(object sender, EventArgs e)
        {
            if (mtbHomePhone.Value?.ToString()?.Length == 0)
            {
                mtbHomePhone.SelectionStart = 1;
                mtbHomePhone.SelectionLength = 0;
            }
        }

 

I'm trying to inherit from the control like this (using MyMaskedEdit in the designer.cs in place of RadMaskedEditBox) but the event is not firing. What am I doing wrong?

using Telerik.WinControls.UI;

namespace VisionUI.Common
{
    public class MyMaskedEdit : RadMaskedEditBox
    {
        protected override void OnClick(EventArgs e)
        {
            base.OnClick(e);

            if (this.Value?.ToString()?.Length == 0)
            {
                this.SelectionStart = 1;
                this.SelectionLength = 0;
            }
        }
    }
}

 

Thanks

Carl

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 26 May 2023
1 answer
170 views

Hi Team,

We are using RadDropDownList control version (2023.1.314)

We are getting  'System.StackOverflowException' exception while assigning value in the dropdownlist (its keep on recursion).

Could you please help on this?. Please find sample program below.

We are using visual Studio 2022 and Telerik.WinControls.UI.dll(2023.1.314)

Note: Its working fine in 2013.3.1.1127 version.

 private void comboBox1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
 {
    setOldValue();
 }

 private void setOldValue()
 {
    comboBox1.SelectedValue = 2;
 }

 private void button1_Click(object sender, EventArgs e)
 {
    comboBox1.SelectedValue = 1;
 }

Thanks

Rajkannan

Dinko | Tech Support Engineer
Telerik team
 answered on 26 May 2023
1 answer
97 views

For some reason - probably due to  me doing some re-sizing of columns - my sheets are now opening scrolled a bit to the right, which means my important left-hand columns are not visible without scrolling.

I assume this will be annoying to users - It certainly took me an hour to figure out what had happened to my left-hand columns. :-(

I tried to make the sheet scroll left in the control.load event:

 mySpreadsheetControl.HorizontalScroll.Value = 0

...but that didn't seem to work.

Does anyone know the right way to scroll left in a sheet?

Thanks

Dinko | Tech Support Engineer
Telerik team
 answered on 26 May 2023
1 answer
78 views

Hello,

i am using custom status and i would like to know if it is possible to set the width of the displayed status field.
I haven't found the right element at the AppointmentFormatting event to access the status field.

Regards,

Paul

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 25 May 2023
1 answer
129 views
Hi,
   I try to get even for dragdrop once node move to another location, i used following code to get event, but not success, here i attach code. i make true for   RadTreeView1.AllowDragDrop = True and  RadTreeView1.AllowDrop = True


Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
   RadTreeView1.AllowDragDrop = True      
   RadTreeView1.AllowDrop = True
 ' Add event handlers for drag and drop events
   AddHandler RadTreeView1.DragEnter, AddressOf RadTreeView1_DragEnter
   AddHandler RadTreeView1.DragDrop, AddressOf RadTreeView1_DragDrop
End Sub

Private Sub RadTreeView1_DragEnter(sender As Object, e As DragEventArgs) Handles RadTreeView1.DragEnter
    ' Check if the data being dragged is a RadTreeNode
    If e.Data.GetDataPresent(GetType(RadTreeNode)) Then
        e.Effect = DragDropEffects.Move
    Else
        e.Effect = DragDropEffects.None
    End If
End Sub

Private Sub RadTreeView1_DragDrop(sender As Object, e As DragEventArgs) Handles RadTreeView1.DragDrop
    ' Check if the data being dragged is a RadTreeNode
    If e.Data.GetDataPresent(GetType(RadTreeNode)) Then
        ' Get the dragged node
        Dim draggedNode As RadTreeNode = CType(e.Data.GetData(GetType(RadTreeNode)), RadTreeNode)

        ' Get the target node
        Dim targetNode As RadTreeNode = RadTreeView1.GetNodeAt(RadTreeView1.PointToClient(New Point(e.X, e.Y)))

        ' Get the full path of the dragged node
        Dim draggedNodePath As String = draggedNode.FullPath

        ' Get the full path of the target node
        Dim targetNodePath As String = targetNode.FullPath

        ' Do something with the full paths
        MessageBox.Show("Dragged Node Path: " & draggedNodePath & vbCrLf & "Target Node Path: " & targetNodePath)
    End If
End Sub

 

Please advice me what i make mistake ? i try to get source and destination node after drag and drop nodes

Please asap.

Regards
Aravind

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 23 May 2023
2 answers
210 views

Background:

  • I have a gridview column subscribing to EditorRequired event.
  • In the EditorRequired function, it will either prompt DropDownList or RadDateTimeEditor.

(Please refer attached for sample project)


 private void radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)
        {
            if (this.radGridView1.CurrentColumn.Name == "Value" && this.radGridView1.CurrentRow.Cells[2].Value.ToString() == "DropDown")
            {
                RadDropDownListEditor editor = new RadDropDownListEditor();
                RadDropDownListEditorElement element = editor.EditorElement as RadDropDownListEditorElement;
                element.DropDownStyle = RadDropDownStyle.DropDownList;
                element.AutoSizeItems = true;
                var selection = this.radGridView1.CurrentRow.Cells[3].Value.ToString().Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
                element.DataSource = selection;

                e.Editor = editor;
            }
            else if (this.radGridView1.CurrentColumn.Name == "Value" && this.radGridView1.CurrentRow.Cells[2].Value.ToString() == "Date")
            {
                RadDateTimeEditor editor = new RadDateTimeEditor();
                editor.CustomFormat = "dd-MMM-yyyy";
                e.Editor = editor;
            }
        }

 

Question:

  • How to define the Date format?

I have tried to set the CustomFormat but the format remains as shown in the screenshot above.


 RadDateTimeEditor editor = new RadDateTimeEditor();
                editor.CustomFormat = "dd-MMM-yyyy";
                e.Editor = editor;

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 23 May 2023
1 answer
143 views

I'm trying to drag and drop RadCallout to an existing Form Designer, and while I don't get any errors and it appears that it drags and drops, the control doesn't remain on the form and does not appear in the Components Tray either. I do not have a problem adding other Rad controls, but Callout doesn't seem to work. Will it only work with a Rad Form? Or is there a prerequisite I should know about? Do I need to install something so that the Designer can properly display it?

 

I'm using Visual Studio Professional 2022 version 17.5.5 with Telerik UI for WinForms Extension 2023.1.313.33.

Thanks in advance!

Dinko | Tech Support Engineer
Telerik team
 answered on 23 May 2023
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?