Telerik Forums
UI for WinForms Forum
1 answer
57 views
Good morning
I have a question about RadGridView. On a .net form I added a RadGridView populated by code and it works perfectly. The only thing I don't understand is that, I select a row, and then by clicking a button I open another form to edit the data and so far everything is fine. I close the other form of the data modification, go back to the RadGridView, click on the row and instead of maintaining the position on the clicked row it moves to one of the initial rows. I can't understand why it doesn't stay on the clicked row after being on another form.
Sorry for the length of the post, I don't know if I can make myself understood, I hope someone can help me.
Best regards
Fabrizio
Nadya | Tech Support Engineer
Telerik team
 answered on 16 Jan 2025
2 answers
103 views

Hello,

I would like to have combo box column in GridView editable by user, so user can select from dropdown list or type it manually. I have two possible scenarios, one with column mapped to other table, so it should be really only some value from dropdown, but I want to have it editable because of more values, and second with just string value, but I want to offer a dropdown for selecting most common values. It doesn't work in any case. Selecting from dropdown list is ok, but when I type an option manually, it reverts back to original value:

I have found very similar question here, but it's older and I don't know, how he solved it, it doesn't work for me, or more precisely, I don't know what's the difference, I don't see any important point I have missed.
https://www.telerik.com/forums/editable-gridviewcomboboxcolumn
https://docs.telerik.com/devtools/winforms/controls/gridview/features/editing/editors/how-to/allow-end-users-to-add-items-to-dropdownlisteditor

I have column defined like this:

dc = new DbDataContext();
var col = rgv.Columns["colProjID"] as GridViewComboBoxColumn;
col.DataSource = dc.Proj2s.OrderBy(o => o.Code);
col.FieldName = "ProjID";
col.DisplayMember = "Code";
col.ValueMember = "ID";
col.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;

If the solution isn't obvious, I can prepare test project, but I have it bound to database now, so it would take some time.

Marian
Top achievements
Rank 2
Bronze
Iron
Iron
 answered on 14 Jan 2025
2 answers
91 views

I have a grid with 60,000 records and I have the filter line at the top of the grid. When a user writes to the filter line, it takes a few minutes for the grid to be filtered.

Telerik version is 2021.2.511.40.

Are there any performance improvements in newer versions? Is there a guarantee that if we update the Telerik version this problem will be resolved?

F3M
Top achievements
Rank 2
Iron
Iron
 answered on 13 Jan 2025
2 answers
51 views

Hello!
1. How to correctly implement adding unique groups to the list and deleting non-existent ones?
The GroupSummaryEvaluate event does not occur when deleting the last entry in a group (deleting this group). That is, it is necessary for the ListBox to display the same groups as in the Grid.

lbGroups.DataSource = lstGroups.ToList
Public Class Form1
Dim lstGroups As New SortedSet(Of String)
Private Sub grdURLs2_GroupSummaryEvaluate(sender As Object, e As GroupSummaryEvaluationEventArgs) Handles grdURLs2.GroupSummaryEvaluate
        If lstGroups.Add(e.Value) Then
' code
        End If
End Sub
End Class

2. How to remove the Close button from the Search Bar?

For Each row In grdURLs2.TableElement.VisualRows
    If TypeOf row Is GridSearchRowElement Then
        Dim searchRow = TryCast(row, GridSearchRowElement)
        searchRow.SearchCellElement.CloseButton.Visibility = False
        Exit For
    End If
Next
Doesn't work.

Thank you!

Hell
Top achievements
Rank 1
Iron
Iron
Iron
 updated answer on 12 Jan 2025
2 answers
87 views
Hello,

I am trying to export a spreadsheet utilizing RadSpreadProcessing but have run up against a wall. Specifically, I want the exported excel file to contain a sortable table but have found no way of achieving this. Is this possible? Any help would be appreciated. Thanks

Update: I have discovered sorting can be achieved using a filter, but I would still like the exported data to be in a table.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 27 Dec 2024
1 answer
42 views

Hello,

RadRibbonBar avec le thème Fluent (RadRibbonBar with Fluent theme)

En ajoutant la commande pour faire disparaitre le menu, l'onglet se positionne au début.

(By adding the command to make the menu disappear, the tab is positioned at the beginning.)

CAST(THIS-OBJECT:RadRibbonBar:GetChildAt(0):GetChildAt(5), Telerik.WinControls.UI.RadApplicationMenuButtonElement):Visibility = Telerik.WinControls.ElementVisibility:Hidden.

Si je change de thème  (Desert) l'onglet se positionne pas au début (comme sur le thème Fluent).

(If I change the theme (Desert), the tab is not positioned at the beginning (as on the Fluent theme).)

Best regards

Nadya | Tech Support Engineer
Telerik team
 answered on 06 Dec 2024
2 answers
94 views

I have this code, and I just want to export all pages or a specific page from the loaded PDF in the RadPdfViewer, without saving the file to the computer.

The function RadPdfViewer.ExportPage returns a Bitmap, but when I assign the result of this function to a new variable of type Bitmap, an error occurs.

 

'1º Option - Work
            For i As Integer = 1 To RadPdfViewer1.Document.Pages.Count
                Dim guid As Guid = Guid.NewGuid

                RadPdfViewer1.ExportPage(i, "C:\temp\" & guid.ToString() & ".pdf", 1, True, ImageFormat.Png)

                Dim bitmap As Bitmap = New Bitmap("C:\temp\" & guid.ToString() & ".pdf")

                Dim reader As BarcodeReader = New BarcodeReader With {
                        .AutoRotate = True,
                        .TryInverted = True
                        }

                Dim result As Result = reader.Decode(bitmap)

                If result Is Nothing Then Continue For

                Dim decoded As String = result.ToString().Trim()

                If decoded Is Nothing Then Continue For

                If decoded <> TextBox1.Text Then TextBox1.Text = TextBox1.Text & vbNewLine & vbNewLine & decoded

                bitmap.Dispose()
                My.Computer.FileSystem.DeleteFile("C:\temp\" & guid.ToString() & ".pdf")
            Next

            '2 Option - Dont Work
            Dim bitmap As Bitmap = RadPdfViewer1.ExportPage(1, 1, False, ImageFormat.Png)

            '3º Option - Dont Work
            For Each bitmap As Bitmap In RadPdfViewer1.ExportPages(1, False, ImageFormat.Bmp)
                Dim reader As BarcodeReader = New BarcodeReader With {
                        .AutoRotate = True,
                        .TryInverted = True
                        }

                Dim result As Result = reader.Decode(bitmap)

                If result Is Nothing Then Continue For

                Dim decoded As String = result.ToString().Trim()

                If decoded Is Nothing Then Continue For

                If decoded <> TextBox1.Text Then TextBox1.Text = TextBox1.Text & vbNewLine & vbNewLine & decoded
            Next

F3M
Top achievements
Rank 2
Iron
Iron
 answered on 04 Dec 2024
1 answer
41 views
           

Hello,

 

How do i make the item appear only once in the popup when the theme is Desert?

 

1 - Without Theme

 

2 - Desert Theme

 

Code:

 

      List<TecnicoServicoInfo> listaTecnicos = new List<TecnicoServicoInfo>();

            TecnicoServicoInfo tec = new TecnicoServicoInfo();
            tec.CdFuncionario = -1;
            tec.DsFuncionario = " ";
            TecnicoServicoInfo tec1 = new TecnicoServicoInfo();
            tec1.CdFuncionario = 80;
            tec1.DsFuncionario = "robsu";
            TecnicoServicoInfo tec2 = new TecnicoServicoInfo();
            tec2.CdFuncionario = 1558;
            tec2.DsFuncionario = "joelssu";
            TecnicoServicoInfo tec4 = new TecnicoServicoInfo();
            tec4.CdFuncionario = 333;
            tec4.DsFuncionario = "TESTE UM NOME MAIOR QUE TODOS OS OUTROS PARA VER O TEMA";
            listaTecnicos.Add(tec);
            listaTecnicos.Add(tec2);
            listaTecnicos.Add(tec1);
            listaTecnicos.Add(tec4);
            listaTecnicos = listaTecnicos.OrderBy(x => x.DsFuncionario).ToList();

            ddlTecnico.DropDownStyle = RadDropDownStyle.DropDown;
            ddlTecnico.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            ddlTecnico.DropDownListElement.AutoCompleteSuggest.SuggestMode = SuggestMode.Contains;
            ddlTecnico.Items.Clear();

            ddlTecnico.DescriptionTextMember = "DsFuncionario";
            ddlTecnico.ValueMember = "CdFuncionario";
            ddlTecnico.DisplayMember = "DsFuncionario";

            ddlTecnico.DataSource = listaTecnicos;


            ddlproxima.DropDownStyle = RadDropDownStyle.DropDown;
            ddlproxima.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            ddlproxima.DropDownListElement.AutoCompleteSuggest.SuggestMode = SuggestMode.Contains;
            ddlproxima.Items.Clear();

            ddlproxima.DescriptionTextMember = "DsFuncionario";
            ddlproxima.ValueMember = "CdFuncionario";
            ddlproxima.DisplayMember = "DsFuncionario";


            ddlproxima.DataSource = listaTecnicos;

            ddlproxima.AutoSizeItems = false;
            ddlproxima.AutoSize = false;

 

Telerik version: 23.2.718

 

Thank You!

Willian
Top achievements
Rank 1
Iron
 answered on 03 Dec 2024
2 answers
59 views
I had a question about the Dropdown element, I saw how to search for it, but I couldn't find it for dynamic
    public SearchWarehouseNP()
    {
        InitializeComponent();
        dropdownSettlement.DropDownStyle = RadDropDownStyle.DropDown;
        dropdownSettlement.AutoCompleteMode = AutoCompleteMode.Suggest;

        dropdownSettlement.DropDownListElement.AutoCompleteSuggest = new CustomAutoCompleteSuggestHelperUpdate(
            dropdownSettlement.DropDownListElement,
            async query =>
            {
                if (string.IsNullOrWhiteSpace(query) || query.Length < 3)
                    return Enumerable.Empty<DescriptionTextListDataItem>();

                var response = await _searchSettlementService.GetCityData(query);
                if (response.success && response.data.Any())
                {
                    return response.data.First().Addresses.Select(a => new DescriptionTextListDataItem
                    {
                        Text = $"{a.MainDescription} ({a.Area})",
                        Value = a.MainDescription,
                        DescriptionText = a.Area
                    });
                }

                return Enumerable.Empty<DescriptionTextListDataItem>();
            }
        );

        dropdownSettlement.SelectedIndexChanged += (s, e) =>
        {
            if (dropdownSettlement.SelectedItem is DescriptionTextListDataItem selectedItem)
            {
                Console.WriteLine($"Выбрано: {selectedItem.Text} ({selectedItem.Value})");
            }
        };
    }
}
The problem is that the data is not stored in Items
Console.WriteLine empty

using Telerik.WinControls.UI;

namespace NovaPostOrderManager.Helpers;

public class CustomAutoCompleteSuggestHelperUpdate : AutoCompleteSuggestHelper
{
    private readonly Func<string, Task<IEnumerable<DescriptionTextListDataItem>>> _fetchDataAsync;
    private CancellationTokenSource _cts = new();

    public CustomAutoCompleteSuggestHelperUpdate(RadDropDownListElement owner, Func<string, Task<IEnumerable<DescriptionTextListDataItem>>> fetchDataAsync)
        : base(owner)
    {
        _fetchDataAsync = fetchDataAsync;
    }

    protected override async void SyncItemsCore()
    {
        // Текущий текст из поля ввода
        string currentInput = Filter;

        // Проверяем, нужно ли загружать данные
        if (string.IsNullOrWhiteSpace(currentInput) || currentInput.Length < 3)
        {
            DropDownList.ListElement.Items.Clear();
            DropDownList.ClosePopup();
            return;
        }

        // Отменяем предыдущий запрос
        _cts.Cancel();
        _cts = new CancellationTokenSource();

        try
        {
            // Задержка перед началом запроса
            await Task.Delay(300, _cts.Token);

            // Загружаем данные
            var items = await _fetchDataAsync(currentInput);

            _cts.Token.ThrowIfCancellationRequested();

            DropDownList.ListElement.BeginUpdate();
            DropDownList.ListElement.Items.Clear();

            // Добавляем элементы в выпадающий список
            foreach (var item in items)
            {
                DropDownList.ListElement.Items.Add(item);
            }

            DropDownList.ListElement.EndUpdate();

            if (DropDownList.ListElement.Items.Count > 0)
            {
                DropDownList.ShowPopup(); // Показываем список, если есть элементы
            }
            else
            {
                DropDownList.ClosePopup();
            }
        }
        catch (TaskCanceledException)
        {
            // Запрос был отменён — игнорируем
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Ошибка загрузки данных: {ex.Message}");
        }
    }

    protected override bool DefaultFilter(RadListDataItem item)
    {
        if (item is not DescriptionTextListDataItem descriptionItem)
            return base.DefaultFilter(item);

        return descriptionItem.Text.Contains(Filter, StringComparison.CurrentCultureIgnoreCase) ||
               descriptionItem.DescriptionText.Contains(Filter, StringComparison.CurrentCultureIgnoreCase);
    }
}

hans
Top achievements
Rank 1
Iron
 answered on 29 Nov 2024
1 answer
50 views
The problem is that the data is not stored in Items


using Telerik.WinControls.UI;

namespace NovaPostOrderManager.Helpers;

public class CustomAutoCompleteSuggestHelperUpdate : AutoCompleteSuggestHelper
{
    private readonly Func<string, Task<IEnumerable<DescriptionTextListDataItem>>> _fetchDataAsync;
    private CancellationTokenSource _cts = new();

    public CustomAutoCompleteSuggestHelperUpdate(RadDropDownListElement owner, Func<string, Task<IEnumerable<DescriptionTextListDataItem>>> fetchDataAsync)
        : base(owner)
    {
        _fetchDataAsync = fetchDataAsync;
    }

    protected override async void SyncItemsCore()
    {
        // Текущий текст из поля ввода
        string currentInput = Filter;

        // Проверяем, нужно ли загружать данные
        if (string.IsNullOrWhiteSpace(currentInput) || currentInput.Length < 3)
        {
            DropDownList.ListElement.Items.Clear();
            DropDownList.ClosePopup();
            return;
        }

        // Отменяем предыдущий запрос
        _cts.Cancel();
        _cts = new CancellationTokenSource();

        try
        {
            // Задержка перед началом запроса
            await Task.Delay(300, _cts.Token);

            // Загружаем данные
            var items = await _fetchDataAsync(currentInput);

            _cts.Token.ThrowIfCancellationRequested();

            DropDownList.ListElement.BeginUpdate();
            DropDownList.ListElement.Items.Clear();

            // Добавляем элементы в выпадающий список
            foreach (var item in items)
            {
                DropDownList.ListElement.Items.Add(item);
            }

            DropDownList.ListElement.EndUpdate();

            if (DropDownList.ListElement.Items.Count > 0)
            {
                DropDownList.ShowPopup(); // Показываем список, если есть элементы
            }
            else
            {
                DropDownList.ClosePopup();
            }
        }
        catch (TaskCanceledException)
        {
            // Запрос был отменён — игнорируем
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Ошибка загрузки данных: {ex.Message}");
        }
    }

    protected override bool DefaultFilter(RadListDataItem item)
    {
        if (item is not DescriptionTextListDataItem descriptionItem)
            return base.DefaultFilter(item);

        return descriptionItem.Text.Contains(Filter, StringComparison.CurrentCultureIgnoreCase) ||
               descriptionItem.DescriptionText.Contains(Filter, StringComparison.CurrentCultureIgnoreCase);
    }
}

hans
Top achievements
Rank 1
Iron
 updated question on 29 Nov 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
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
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Styling
Barcode
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
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
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?