Telerik Forums
UI for WinForms Forum
1 answer
19 views

Will Radmap be supporting Azure maps since Bing maps are no longer supported?

 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 08 Apr 2025
2 answers
59 views
Comment Removed.
Dimitar
Telerik team
 answered on 07 Apr 2025
1 answer
19 views

I have a Winform that includes a Grid that my Users can edit by adding/removing columns.

I have an Object ("gridProps" class) that holds all of the "grid" properties,

gridProps.Columns property replaces the default (text) editor with my own popup radForm that works very much like your own "Columns" property for radGrid.  When the user clicks into that Property on the PropertyGrid, you get a string representation and a "..." button.  Clicking on that button bring up my "Columns Editor" radForm and takes over until "OK" or "Cancel"

Everything works...except: The user can click into "Columns" on the PropertyGrid and it automatically opens the "Textbox" editor inside the PropertyGrid and the user can type away.  Nothing happens with this input - my TypeConverter sees to that but they are still allowed to type whatever they want until they click away or hit enter/tab etc.

Is there a way to PREVENT the user from typing anything but STILL ALLOW them to click the "..." button?

I'm trying to mimic exactly how Telerik RadGrid's Columns property works.

Any advice would be helpful and appreciated!

-C

 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 04 Apr 2025
1 answer
23 views

We have been using the TreeView in our software for some time now. However, recently, we noticed that it's not behaving as we have coded it. We had code that changed the Forcolor and Font when a node was selected. However, this doesn't seem to be working anymore. Attached is a sample code. Any help would be greatly appreciated.

 

FYI, we are using Telerik for Winforms: 2024.3.924.462

TIA



using System;
using System.Collections.Generic;
using System.Drawing;
using Telerik.WinControls;
using Telerik.WinControls.UI;

namespace TestNodeColorChange
{
   public partial class RadForm1 : Telerik.WinControls.UI.RadForm
   {
      #region Private Fields

      private string selectedNodeKey = string.Empty;

      #endregion Private Fields

      #region Public Constructors

      public RadForm1()
      {
         InitializeComponent();
         Load += FormLoading;
      }

      #endregion Public Constructors

      #region Private Methods

      private void FormLoading(object sender, EventArgs e)
      {
         List<TreeViewData> list = new List<TreeViewData>()
         {
            new TreeViewData { key = 1, DisplayValue = "Level 1" },
            new TreeViewData { key = 2, parentKey = 1, DisplayValue = "Branch A" },
            new TreeViewData { key = 3, parentKey = 1, DisplayValue = "Branch B" },
            new TreeViewData { key = 4, parentKey = 1, DisplayValue = "Branch C" }
         };

         radTreeView1.ChildMember = "key";
         radTreeView1.DisplayMember = "DisplayValue";
         radTreeView1.ParentMember = "parentKey";
         radTreeView1.DataSource = list;

         radTreeView1.ExpandAll();

         radTreeView1.SelectedNodeChanged += SelectedNodeChanged;
         radTreeView1.NodeFormatting += NodeFormatting;
      }

      private void NodeFormatting(object sender, TreeNodeFormattingEventArgs e)
      {
         if (e.NodeElement is LightVisualElement lve)
         {
            lve.ResetValue(VisualElement.ForeColorProperty, ValueResetFlags.Local);
            lve.ResetValue(VisualElement.FontProperty, ValueResetFlags.Local);

            if (e.Node.Value.ToString() == selectedNodeKey)
            {
               lve.Font = new Font(lve.Font.FontFamily, lve.Font.Size, FontStyle.Bold);
               lve.ForeColor = Color.Purple;
               radTreeView1.NodeFormatting -= NodeFormatting;
               radTreeView1.Refresh();
               radTreeView1.NodeFormatting += NodeFormatting;
               Console.WriteLine("NodeFormatting: " + selectedNodeKey);
               Console.WriteLine("NodeFormatting: " + e.NodeElement.ForeColor.ToString());
               Console.WriteLine("NodeFormatting: " + ((e.NodeElement.Font.Style & FontStyle.Bold) != 0));
            }
         }
      }

      private void SelectedNodeChanged(object sender, RadTreeViewEventArgs e)
      {
         selectedNodeKey = e.Node.Value.ToString();
         Console.WriteLine("SelectedNodeChanged: " + selectedNodeKey);
         radTreeView1.Nodes.Refresh();
      }

      #endregion Private Methods

      #region Internal Classes

      internal class TreeViewData
      {
         #region Public Properties

         public string DisplayValue { get; set; }
         public int key { get; set; }
         public int? parentKey { get; set; }

         #endregion Public Properties
      }

      #endregion Internal Classes
   }
}

Nadya | Tech Support Engineer
Telerik team
 answered on 03 Apr 2025
3 answers
497 views

Hi,

I've been struggling to work out how to export the current pdf page as shown in the pdfViewer after it has been rotated using controls in the pdfViewerNavigator. I'm trying to save the image in png format but it seems to export the page in the original orientation ignoring the applied rotation.  

 

Also whilst searching the forum for a solution, I came across the code

this.radPdfViewer1.PdfViewerElement.CurrentPage.PageNo

 

but  it appears that PageNo no longer exists in 2020.3.1020.

Currently i'm using

pdfViewer.ExportPage ( 0, _tempImageFileName, 1.0, true, ImageFormat.Png );

 

which exports the first page as a png, which works, I just need to save the currently selected page that may or may not have been rotated.

Is this possible, if so how ?

Toby
Top achievements
Rank 3
Iron
Iron
Iron
 updated answer on 28 Mar 2025
1 answer
18 views

Hello, 

Is there a way to increase the size of the bar indicated by the arrow?

Best regards :)

Nadya | Tech Support Engineer
Telerik team
 answered on 28 Mar 2025
1 answer
21 views

Dear Sir

When I using the demo winform (version. 2025 Q1), all the menu drop-down menus were not displayed in the correct position for the first time. Include the controls of menus and ribbon bar in hidden mode. Could you please checked the display problem. Is there any solution to prevent the error from showing? Thanks.


Dinko | Tech Support Engineer
Telerik team
 answered on 27 Mar 2025
1 answer
18 views

Hi

I have a GridView with a relational hierarchy of two levels connected via two manual relations and two templates.

 


			gridViewRelation1.ChildColumnNames.Add("AktivitaetVorgang");
			gridViewRelation1.ChildTemplate = this.templateFremdeAktivitaetVorgaenge;
			gridViewRelation1.ParentTemplate = this.radGridPsz.MasterTemplate;
			gridViewRelation1.RelationName = "relationAktivitaetVorgang";

			gridViewRelation2.ChildColumnNames.Add("VorgangHandlungsBedarf");
			gridViewRelation2.ChildTemplate = this.templateFremdeVorgangHandlungsbedarfe;
			gridViewRelation2.ParentTemplate = this.templateFremdeAktivitaetVorgaenge;
			gridViewRelation2.RelationName = "relationVorgangHandlungsbedarfe";

			this.radGridPsz.Relations.AddRange(new Telerik.WinControls.UI.GridViewRelation[] {
				gridViewRelation1,
				gridViewRelation2});

The template of the second level is added to the Maintemplate, the template of the third level is added to the template of the second level.

Everything is working fine at first.

But if I save the layout of the grid and reload it after closing and opening the application again (via radGrid.SaveLayout and radGrid.LoadLayout),  there are no rows in the third level, although the datasource is the same, and they were there in the beginning.

The rows of the second level do not have childRows although the templates and relations are still there

 

 

 

 

Nadya | Tech Support Engineer
Telerik team
 answered on 25 Mar 2025
1 answer
20 views

Hi 

I am designing a WinForm App using UI for WinForms (ver. 2025 Q1). Is there any solution to add a search box to the radform title bar? It looks like the search box at th top of Microsoft Outlook 365 application.

Nadya | Tech Support Engineer
Telerik team
 answered on 25 Mar 2025
1 answer
15 views

Hi everyone, i use Telerik.WinControls.UI.Barcode to generate QR and every thing is fine with android reads, but IOS read said No usable data found.  Could you help me? This is my code

private void PrintDoc_PrintPage(object sender, PrintPageEventArgs e)
{
    printDoc.DefaultPageSettings.PaperSize = new PaperSize("Etiqueta5", 300, 150);
    printDoc.DefaultPageSettings.Landscape = true;

    float leftMargin = e.MarginBounds.Left;
    float topMargin = e.MarginBounds.Top;
    float printableWidth = e.MarginBounds.Width;
    float printableHeight = e.MarginBounds.Height;

    float labelWidth = 300; 
    float labelHeight = 150;



    float qrSize = 150;
    float margin = 3; 

    Font font = new Font("Arial", 9, FontStyle.Bold);
    Font smallerFont = new Font("Arial", 8, FontStyle.Bold);
    Brush brush = Brushes.Black;

    while (_currentRowIndex < dgv_resultado.Rows.Count)
    {
        DataGridViewRow row = dgv_resultado.Rows[_currentRowIndex];

        
        string idBien = row.Cells["IDBien"].Value?.ToString() ?? "N/A";
        string url = "http://www.mypage.com/";
        string articulo = row.Cells["Articulo"].Value?.ToString() ?? "N/A";
        string serie = row.Cells["NumSerie"].Value?.ToString() ?? "N/A";
        string fondos = ObtenerFondos(idBien);
        string contraloria = "";
        if (bandera == 0)
        {
            contraloria = row.Cells["NumContraloria"].Value?.ToString() ?? "N/A";
        }
        else 
        {
            contraloria = row.Cells["NoContraloria"].Value?.ToString() ?? "N/A";
        }

        string qrData = $"IdBien:{idBien}|Liga:{url}|Artículo:{articulo}|Serie:{serie}|Fondos:{fondos}|Contraloría:{contraloria}";


        byte[] utf8Bytes = Encoding.UTF8.GetBytes(qrData);
        string qrDataUtf8 = Encoding.UTF8.GetString(utf8Bytes);

        rbv_code.Value = qrDataUtf8;

        Bitmap qrImage = new Bitmap(rbv_code.Width, rbv_code.Height);
        rbv_code.DrawToBitmap(qrImage, new Rectangle(0, 0, qrImage.Width, qrImage.Height));

        float xStart = (e.PageBounds.Width - labelWidth) / 2;  
        float yStart = 0; 

        float qrXPosition = xStart + (labelWidth - qrSize) / 2;
  
        e.Graphics.DrawImage(qrImage, qrXPosition, yStart + margin, qrSize, qrSize);

        float textYPosition = yStart + qrSize + (2 * margin);
        string unisonText = "My Page";
        SizeF unisonSize = e.Graphics.MeasureString(unisonText, font);
        e.Graphics.DrawString(unisonText, font, brush, xStart + (labelWidth - unisonSize.Width) / 2, textYPosition);

        textYPosition += 15; 

        try
        {
            PostDataToApiNormal(Convert.ToInt32(idBien), Empleado);
        }
        catch { }
        

        string idBienText = $"ID: {idBien}";
        SizeF idBienSize = e.Graphics.MeasureString(idBienText, smallerFont);
        e.Graphics.DrawString(idBienText, smallerFont, brush, xStart + (labelWidth - idBienSize.Width) / 2, textYPosition);

       

        if (pb_logo.Image != null)
        {
            float imageHeight = 35; 
            float imageWidth = 35; 
            float imageXPosition = xStart + (labelWidth - imageWidth) / 2; 
            float imageYPosition = textYPosition + 20; 
            

            for (float offset = -0.5f; offset <= 0.5f; offset += 0.5f)
            {
                e.Graphics.DrawImage(pb_logo.Image, imageXPosition + offset, imageYPosition + offset, imageWidth, imageHeight);
            }
        }

        

        _currentRowIndex++;
        if (_currentRowIndex < dgv_resultado.Rows.Count)
        {
            e.HasMorePages = true;
            return;
        }
    }

    e.HasMorePages = false;
}
Nadya | Tech Support Engineer
Telerik team
 answered on 20 Mar 2025
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
DateTimePicker
CollapsiblePanel
Conversational UI, Chat
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
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?