Telerik Forums
UI for WinForms Forum
2 answers
104 views

When exporting a RadDataGridView with the Export-Visuals enabled this handled what I needed (export conditional formatting), however it slowed the export down greatly. My solution was to swap to Async export. This did make the GUI better, but broke the export of conditional formatting. I jury-rigged a solution that works well enough, although not great. Figured I'd pass this along just in case it helps others


[Main Export Method ...]
BtnExportExcel.Enabled = false;
try
{
    GridViewSpreadExport spreadExporter = new GridViewSpreadExport(this.radGridView1);
    spreadExporter.ExportChildRowsGrouped = true;
    spreadExporter.HiddenColumnOption = Telerik.WinControls.UI.Export.HiddenOption.DoNotExport;
    spreadExporter.HiddenRowOption = Telerik.WinControls.UI.Export.HiddenOption.DoNotExport;
    spreadExporter.FileExportMode = FileExportMode.CreateOrOverrideFile;
    SpreadExportRenderer exportRenderer = new SpreadExportRenderer();
    spreadExporter.ExportVisualSettings = true;
    lastFileName = fileName;
    using (var bgw = new BackgroundWorker())
    {
        pgb_Saving.Value = 0;
        pnlSaving.Visible = true;
        var bgwFileName = fileName;
        bgw.DoWork += (o,e)=> spreadExporter.RunExport(bgwFileName, exportRenderer);
        bgw.RunWorkerCompleted += SpreadExporter_AsyncExportCompleted;
        bgw.RunWorkerAsync();
    }
                        
}
catch (Exception ex)
{
    BtnExportExcel.Enabled = true;
}
[...]

private void SpreadExporter_AsyncExportCompleted(object sender, AsyncCompletedEventArgs e)
{
    pgb_Saving.Value = 0;
    pnlSaving.Visible = false;
    tsbDataGridViewExportExcel.Enabled = true;
    if (e.Error is null && System.IO.File.Exists(lastFileName))
    {

        string szTemp = "'" + lastFileName + "' created.\r\n\r\nWould you like to open the spreadsheet?";
        var iRet = MsgBox.ConfirmMsg(szTemp, MessageBoxButtons.YesNo, "Spreadsheet Created");
        if (iRet == DialogResult.Yes) System.Diagnostics.Process.Start(lastFileName);
    }
    SwapForExport(false);
}

private void pnlSaving_VisibleChanged(object sender, EventArgs e)
{
    if (pnlSaving.Visible)
    {
        if (pnlSaving.Tag  as Timer is null) {
            var tmr = new Timer() { Interval = 250 };
            tmr.Tick += Timer_Tick;
            pnlSaving.Tag = tmr;
                }
        ((Timer)pnlSaving.Tag).Start();
    }
    else
    {
        if(pnlSaving.Tag is Timer tmr)
        {
            tmr.Stop();
        }
    }
}

private void Timer_Tick(object sender, EventArgs e)
{
//pgb_Saving is a Progress Bar
    pgb_Saving.Value = (pgb_Saving.Value + 1) % pgb_Saving.Maximum;
}

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 27 Oct 2022
1 answer
281 views

Hello,

I have a small terminal type app that displays some data in a RadTextBoxControl as it arrives. Events are fired and data is displayed on the screen by way of the RadTextBoxControl. That part works great.  

When certain strings arrive, I'd like to replace it with a hyperlink or button of sorts. I found the example for Creating Custom Blocks (https://docs.telerik.com/devtools/winforms/controls/editors/textboxcontrol/creating-custom-blocks) and this looked really promising. But, the issue I had there is that this event fires on on lots of different characters. Meaning, you can't use it to parse out a line of text and then replace it with a custom object. You parse each block as it comes in.

Ideally, I want certain types of text, like "<link cmd=".cm*">Run custom command</link>" to be replaced with some text that looks like "Run custom command" but in a way that it acts like a hyperlink where I can register for its click event and do whatever I need to do. This is proving to be pretty tricky for me but I have a feeling Telerik controls probably have a way :)

Thanks,

Michael

Dinko | Tech Support Engineer
Telerik team
 answered on 26 Oct 2022
1 answer
138 views

Hello Telerik,

 

Sorry, is it possible to create something like (I'm not really sure what it calls) flow or line with nodes or checkpoint ? Maybe like this image

 

Or like, if we played an adventure game, an on that game there was a map that shows where we were and what was the next quest or city, or anything.


Thanks before.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 26 Oct 2022
1 answer
151 views

Hello Team,

In cell biginedit, the text is selected and focused at the end of the value. If I click the cell, the text shows the front text. clicking on the tab key. The cell value again shows the last value. It should show the first value.

Using this code to bind the grid cell - Microsoft.VisualBasic.Val(7)/1000 & Left (CD & Space (20), 20)

Here, the cell value shows "7", but we need to show a "CD" on the front. Please help us resolve this issue. A video link has been added for your convenience.

Video link : https://suganya-gmail.tinytake.com/df/1379872/thumbnail?type=attachments&version_no=0&file_version_no=0&thumbnail_size=preview

Screenshot : https://prnt.sc/_ZlhOr-sovVe

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 26 Oct 2022
1 answer
231 views

Hi,

I am trying to do Drag&Drop as show in the Telerik documentation (see https://docs.telerik.com/devtools/winforms/controls/gridview/rows/drag-and-drop).

I tried to implement it in three different ways:

1) after reading the doc, I downloaded the code and build it with VS2022. This code uses .Net Framework 4.6.1 and works exactly as expected.

2) Then, I tried to add it to my current project using .Net 6 and the current Telerik Library. I did it both in the form where it should be used and in a dedicated form with the exact code provided. In both cases, I have the 'strange' behavior that the drag works but as soon as the grabed row is movingout of its origin,  a "no entry" sign is shown both in some area of the initial grid view and everywhere in the destination one (see picture).

3 Then I tried to do it in a brand new .Net 6 project to dismiss a potential setup in my project. In this third one evrything compile and run nicely, BUT there is absolutely no drag and drop behavior.

I attached this last project, but it is really exactly the downloaded code.

So can someone explain what is wrong in this code or my way to use it ?

Many thanks

Patrick

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 26 Oct 2022
1 answer
173 views

Hi.

I'm trying to draw a specific graph using RadChartView.

However, I couldn't find a way to remove the border line, which is marked with a red arrow in the attached image.

The background color must be Transparent.

Please tell me how to remove only those lines.

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 26 Oct 2022
2 answers
391 views

I'm following the example from   https://www.telerik.com/forums/object-bound-hierarchy#711007, which describes how to create an object-based hierarchy. An excellent example.

I'm now trying to modify that example to look how I want, and I've done everything apart from the critical bit - adding the row of 'child' data.

For a normal row, I would do:

 Dim gvdi As New GridViewDataRowInfo(myGrid.MasterView)
        With gvdi
            .Cells("name").Value = t.name
            .Cells("status").Value = t.status
            .Tag = t '...plus any other columns I need

        End With

The example uses the simpler constructor for a new child row, like:

                childTemplate.Rows.Add(t.id, tt.name, tt.status) '....where 't' is my object.

This also works fine

But now I'd like to use the first style of constructor for the child row, and I can't work out how to do it.

When I use the first bit of code, the runtime complains that it's not a GridViewHierarchyRowInfo, so I changed it to be:

 Dim gvdi As New GridViewHierarchyRowInfo(myGrid.MasterView)
               'With gvdi
                   .Cells("name").Value = tt.name
                   .Cells("status").Value = tt.status
                   .Tag = tt
               End With

...and that doesn't work either. Is it the GridViewHierarchyRowInfo(myGrid.MasterView) which is wrong?

Any ideas?

Thanks

Maria
Telerik team
 answered on 25 Oct 2022
2 answers
132 views
Hi,

In a RadMenuItem, it seems that the RadDropDownMenu graphical object containing children is automatically created when the MyMenuItem.Items property is accessed.
Often, the Items property is accessed without adding any children, for example to access MyMenuItem.Items.Count property.
RadDropDownMenu object is therefore useless and affects the size of a RadMenuItem in memory.
I'm considering overriding the Items property or the EnsureDropDownCreated method of the RadMenuItemBase class to work around this issue.
Is there a method that you recommend or do not recommend?

We are using 2022.3.921 version.

Thanks for your feedback.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 25 Oct 2022
1 answer
109 views
Am I being stupid? How do you Can you add a RadTextBox to a RadStatusStrip?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 24 Oct 2022
1 answer
99 views

I'm currently working on a project where we are using a RadDiagram to dynamically display and plan a distribution hall. Here we are using different elements/shapes in the diagram to represent storage shelves and spaces/spots in those shelves. We want to draw these shelves and their spots either horizontally from left to right or vertically from bottom to top. We want to do this by first drawing the shelve and its spots horizontally and then rotate the shelve using a custom RotationService, that rotates the shelve group programatically. This however has an unwanted side effect, which can be inspected in the provided demo app and below:

The rotation via the custom RotationService appears to move the shelve in the diagram to a "random" position depending on the RadDiagram zoom and scroll position. So a shelve can be drawn and rotated as expected in the first initialization of the diagram.

Initial Diagram creation:

If the diagrams zoom level and scroll position isn't changed a shelve can be selected and rotated using the switch button. This also works as expected.

Shelve rotation without zoom:

If however the zoom of the diagram is changed or the scroll position is changed, following a rotation of a shelve or the redraw of the whole diagram using the refresh button, the vertically rotated shape is moved to a differen position.
If the rotation of the shelve is repeated multiple times the postion of the rotated shape appears to migrate to a point in the diagram. If the shelve reaches this point it will start to rotate properly again, without further change in position.

Shelve rotation with zoom:

Refresh with zoom and different scroll positions:

As seen above the rotated shelve is drawn in different positions each time the diagrams zoom or scroll is changed. Is this due to a wrong implementation of the RotationService as seen in the Demo_Project or is it due to a bug?

 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 21 Oct 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?