Telerik Forums
UI for WinForms Forum
1 answer
34 views

I am having issues where data getting exported to an XLSX file where some tabs are not getting the data. FileExportMode is set to FileExportMode.NewSheetInExistingFile and the file is not in use.  The weird part, is I can run the code multiple times and each time, it is different tabs that don't get populated. In the end, I  should end up with 14 tabs and I get those 14 tabs, the only thing that is in the tabs, is the headers.  if I export that data for each tabs individual to their own file, the data is there and exported as expected.  Maybe I am missing something?

Another weird part, is when I watch the file exporting (in window explorer), you can see the file go to 0KB. It is really weird

Here is my export code


         List<Tuple<int, string, bool>> jurisdictionTypes =
            new JurisdictionTypeDA().GetJurisdictionTypeKeyValueList();

         foreach (Tuple<int, string, bool> jurisdictionType in jurisdictionTypes)
         {
            RadPivotGrid tempPivotExportGrid = new RadPivotGrid
            {
               ColumnGrandTotalsPosition = TotalsPos.None,
               ColumnsSubTotalsPosition = TotalsPos.None,
               EmptyValueString = "0",
               RowGrandTotalsPosition = TotalsPos.None,
               RowsSubTotalsPosition = TotalsPos.None
            };

            var exportResults = _apportionmentInfoPivot
               .Where(app => app.JurisdictionTypeKey == jurisdictionType.Item1
               .OrderBy(app => app.PartySort)
               .ThenBy(app => app.LegacyKeyValue)
               .Select(app => new
               {
                  jurisdiction_name = app.JurisdictionName?.Trim() ?? string.Empty,
                  party_name = app.PartyName?.Trim() ?? string.Empty,
                  totalvoters = app.TotalVoters,
                  signaturesneeded = app.SignaturesNeeded
               })
               .ToList();

            tempPivotExportGrid.DataSource = exportResults;
            tempPivotExportGrid.RowGroupDescriptions.Clear();
            tempPivotExportGrid.ColumnGroupDescriptions.Clear();
            tempPivotExportGrid.AggregateDescriptions.Clear();

            // Row Information
            PropertyGroupDescription myRows = new PropertyGroupDescription
            {
               PropertyName = "jurisdiction_name",
               CustomName = "Jurisdiction",
               SortOrder = Telerik.Pivot.Core.SortOrder.None
            };

            tempPivotExportGrid.RowGroupDescriptions.Add(myRows);

            // Column Information
            PropertyGroupDescription myCols = new PropertyGroupDescription
            {
               PropertyName = "party_name",
               CustomName = "Party",
               SortOrder = Telerik.Pivot.Core.SortOrder.None
            };
            tempPivotExportGrid.ColumnGroupDescriptions.Add(myCols);

            // Aggregate Information
            tempPivotExportGrid.AggregateDescriptions.Add(new PropertyAggregateDescription()
            {
               PropertyName = "totalvoters",
               CustomName = "Count",
               AggregateFunction = AggregateFunctions.Sum,
               StringFormat = "#,##0"
            });

            tempPivotExportGrid.AggregateDescriptions.Add(new PropertyAggregateDescription()
            {
               PropertyName = "signaturesneeded",
               CustomName = "Needed",
               AggregateFunction = AggregateFunctions.Sum,
               StringFormat = "#,##0"
            });

            tempPivotExportGrid.AggregatesPosition = PivotAxis.Columns;

            // Combine each result into a new tab
            PivotGridSpreadExport spreadExport = new PivotGridSpreadExport(tempPivotExportGrid)
            {
               SheetName = jurisdictionType.Item2,
               FileExportMode = FileExportMode.NewSheetInExistingFile
            };
            spreadExport.RunExport(myExportFile, new SpreadExportRenderer());

            // Send each result to their own sheet
            PivotGridSpreadExport mySpreadExport2 = new PivotGridSpreadExport(tempPivotExportGrid)
            {
               SheetName = jurisdictionType.Item2,
               FileExportMode = FileExportMode.CreateOrOverrideFile
            };
            string newfile = string.Concat(Path.Combine(Path.GetDirectoryName(myExportFile) ?? string.Empty, Path.GetFileNameWithoutExtension(myExportFile)), "_", jurisdictionType.Item2, Path.GetExtension(myExportFile));
            mySpreadExport2.RunExport(newfile, new SpreadExportRenderer());


         }

Due to the nature of the data, I can't share the results, so I will try to re-create this in a temp project.

 

I have attached a like to a video, you can see at 4 seconds and 9 seconds, the file is emptied (0 KB).

https://app.screencast.com/6SjZNCAoooWUh

TIA for any help here.

 

Dinko | Tech Support Engineer
Telerik team
 answered on 27 Feb 2024
1 answer
21 views
The reading path image displays an error, the program code is as follows:
private void button1_Click(object sender, EventArgs e)
{
    OpenFileDialog _file = new OpenFileDialog();
    _file.InitialDirectory = ".";
    _file.Filter = "JPG(*.JPG;*.JPEG);|";
    _file.ShowDialog();
    if (_file.FileName != string.Empty)
    {
        string ProfilePicturePathName = _file.FileName;

        // Telerik --->>>   "System.Xml.XmlException: 'There are invalid characters in the specified encoding"
        radPictureBox1.SvgImage = RadSvgImage.FromFile(ProfilePicturePathName);

        // windows is ok
        pictureBox1.Image= Image.FromFile(ProfilePicturePathName);
    }
}
Nadya | Tech Support Engineer
Telerik team
 answered on 23 Feb 2024
4 answers
363 views
Hi,

     We are using the RadLabel control in part of chat application. I used the RadLabel and keep the AutoSize property True. When I type more contents in that label, the label keep grow in horizontal and not able to view all the entered contents.
     I would like to know how to automatically increase the height of the radlabel baed on the content.

Thanks,

Jeen
Jarrad
Top achievements
Rank 1
Iron
 answered on 21 Feb 2024
1 answer
46 views
Would it be possible to update the schduler ruler current time marker every 15 minutes. Can I have a timimg loop to refresh the update time.
Nadya | Tech Support Engineer
Telerik team
 answered on 20 Feb 2024
1 answer
43 views

I am trying to figure out if updating different packages in my project is possible and would like to find the documentation for my Telerik version. I have a old version and can't find relevant information anywhere.

Is there some legacy page i can view?

Mihaela
Telerik team
 answered on 19 Feb 2024
2 answers
115 views

Hi Dinko and Team,

As I mentioned in my previous forum, The below code is working in VS 2022 with  2013.3.1.1127 where as throwing stackoverflow exception in VS 2022 with Telerk  2024.1.130.48. Out product code structure is like below and we cannot declare and initialize the datatable globally. If we did that the whole application will get impact . Hence could you please restrict the recursive call of Raddropdownlist.Datasource  and Raddropdownlist.SelectedIndex also like Raddropdownlist.SelectedValue. Which I raised in my previous forum

Telerick version 2023.1.314 RadDropDownList controls throwing StackoverflowException when migrating visual studio 2010 to 2022 in UI for WinForms | Telerik Forums

public void fillIndustryProcess()

        {
            try
            {
  System.Data.DataTable dt1 = new System.Data.DataTable();
                if (dt1.Columns.Count <= 0)
                {
                    dt1.Columns.Add("Industry", typeof(string));
                    dt1.Columns.Add("ID", typeof(int));
                    dt1.Rows.Add("USA-0", 0);
                    dt1.Rows.Add("USA-1", 1);
                    dt1.Rows.Add("USA-2", 2);
                    dt1.Rows.Add("USA-3", 3);
                    dt1.Rows.Add("USA-4", 4);

                    radDropDownList2.DisplayMember = "Industry";
                    radDropDownList2.ValueMember = "ID";
                }
  radDropDownList2.DataSource = dt1; ;//Still stack overflow exception occurring when bind the radDropDownList
                radDropDownList2.SelectedIndex = 0;
            }
            catch (System.ComponentModel.Win32Exception ex)
            {
                throw ex;
            }
        }

 

Thanks,

Maheswari

                           
Dinko | Tech Support Engineer
Telerik team
 answered on 14 Feb 2024
1 answer
44 views

Hello,

I am trying to drag an item from a form Gridview to a Scheduler control but could not see any Scheduler Dragover event got fired. I have set the Scheduler AllowDrop property to true and my code to initiate the transfer is gridview1.DoDragDrop(sTDF, DragDropEffects.Move). Help is apprevciated.

Thanks

Peter

Nadya | Tech Support Engineer
Telerik team
 answered on 07 Feb 2024
1 answer
41 views

Hi Dinko and Team,

As I mentioned in the previous forum, We need fix for Raddropdownlist.SelectedIndex.

When we set SelectedIndex=5 or some value in selectedIndexchangedEvent then the recursive call is happening for SelectedIndex. So we need to restrict the recursive call for both Raddropdownlist.DataSource as well as Raddropdownlist.SelectedIdex.

  private void radDropDownList1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e)
        {
           fillIndustryProcess1(); // radDropDownList1.DataSource = dt; when we set Datasource the recursive call is occurring
            radDropDownList1.SelectedIdex = 5; // radDropDownList1.SelectedIdex = 5; when we set Datasource the recursive call is occurring

}

public void fillIndustryProcess1()
        {
            try
            {
                System.Data.DataTable dt = new System.Data.DataTable();
                if (dt.Columns.Count > 0)
                    {
                        dt.Columns.Add("Industry", typeof(string));
                        dt.Columns.Add("ID", typeof(int));
                        dt.Rows.Add("BGL-0", 0);
                        dt.Rows.Add("BGL-1", 1);
                        dt.Rows.Add("BGL-2", 2);
                        dt.Rows.Add("BGL-3", 3);
                        dt.Rows.Add("BGL-4", 4);
                        radDropDownList1.DisplayMember = "Industry";
                        radDropDownList1.ValueMember = "ID";
                    }
                radDropDownList1.DataSource = dt;// Recursive call occurs
                radDropDownList1.SelectedIndex = 0;/ Recursive call occurs
            }
            catch (System.ComponentModel.Win32Exception ex)
            {
                throw ex;
            }
        }

Old Forums in which , Telerik team fixed the RadDropDownList .SelectedValue.

Telerick version 2023.1.314 RadDropDownList controls throwing StackoverflowException when migrating visual studio 2010 to 2022 in UI for WinForms | Telerik Forums 

Previous forums in which , Telerik team yet to fix for RadDropDownList.Datasource.

Telerick version 2024.1.130.48, RadDropDownList controls throwing StackoverflowException when migrating visual studio 2010 to 2022 in UI for WinForms | Telerik Forums

Thanks,

Maheswari

Dinko | Tech Support Engineer
Telerik team
 answered on 07 Feb 2024
7 answers
134 views

Hi Dinko and team ,

Tried to migrate from Visual studio 2010 project along with Telerik.WinControls.UI.dll - Version - 2013.3.1.1127  to Visual studio 2022 with Telerik.WinControls.UI.dll - Version 2023.1.314.

There are random stackoverflow exceptions throughout project. In older version Telerik 2013.3.1.1127  is working with no issues only in Visual studio 2022  Telerick 2023.1.314 creating issue.

Found the RadDropDownList is the root cause So

As Dinko | Tech Support Engineer Telerik suggested in forum tried the below code

cmbValveSize_SelectedIndexChanged -= cmbValveSize_SelectedIndexChanged;

cmbValveSize.SelectedValue = 3;

cmbValveSize.SelectedIndexChanged += cmbValveSize_SelectedIndexChanged;

The stackoverflow is got resolved at this point so we applied the same code wherever SelectedValue getting assigned throughout project but when we call recursive functions the SelectedValue is getting assigned as null since the assigned value is based on value member signature and datasource datatable also having value. 

    private void setComboBoxIndexChanged(RadDropDownList combobox, object selectedValue, Telerik.WinControls.UI.Data.PositionChangedEventHandler eventHandler)
        {
            if (eventHandler != null) { combobox.SelectedIndexChanged -= eventHandler; }
            if (int.TryParse(Convert.ToString(selectedValue), out int result))
            {       
                combobox.SelectedValue = result; //result having the value but assiging as null
                if (combobox.SelectedValue == null && combobox.Name == "cmbValveSize")
                {
                    DataTable dtValues = (DataTable)cmbValveSize.DataSource;
                   if(dtValues.Rows.Count > 0)
                    {

                    }
                   else
                    {

                    }
                }

 

if (eventHandler != null) { combobox.SelectedIndexChanged += eventHandler; }    

}

 So what is causing in version 2023.1.314  RadDropDownList? why we need to do subscribe and unsubscribe for Telerik 2023.1.314 but not for Telerik 2013.3.1.1127 . What is the change between2013.3.1.1127 and  2023.1.314.

When is the change and Which version will overcome the stackoverflow issue in Visual studio 2022 after  2013.3.1.1127.? - Since we need the latest Telerik version for VS 2022 application.

Unsubscribe and subscribe is not a solution it is affecting the other functionalities of project.

Please suggest what we can do apart from Unsubscribe and subscribe.

Thanks,

Maheswari

Maheswari
Top achievements
Rank 1
Iron
Iron
 answered on 05 Feb 2024
1 answer
58 views
We are currently working with Telerik Winforms 2021.1.223.40
and We'd like to seek advice on.

In our Winforms application, we call the Click event of RadRepeatButton.
When occurs the click event of this button, we show Telerik messagebox after certain data checks.

When showing Telerik messagebox, we make layout of RadMessageBox through a method named "SetDesing()".
To this end we call a method name ""RadMessageBox.Show".

The problem occurs after calling "RadMessageBox.Show()". Even though we wrote the code that return after this call, the return does not occur. Instead, It repeatedly triggers the Click event of the RadRepeatButton. (It almost like a recursive function.)

Below are the detailed codes and the call stacks.
Nadya | Tech Support Engineer
Telerik team
 answered on 05 Feb 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
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
Menu
PropertyGrid
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
Rotator
TrackBar
MessageBox
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ScrollBar
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
ColorBox
Callout
FilterView
PictureBox
VirtualKeyboard
NavigationView
Accessibility
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
Flyout
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
+? more
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?