Telerik Forums
UI for WinForms Forum
2 answers
29 views

Hi,

I would like to have a grid with no cell selected by default. So every time it is loaded no CurrentCell is selected. Same when there is no selection and the grid is sorted by a column.

Right now, the grid marks the first cell as CurrentCell when it is loaded. I could solve it using the .ClearSelection() method but then I have the same problem when sorting: the first cell is marked as selected.

How can avoid this behavior and only set the CurrentCell when the user marks it?

Nadya | Tech Support Engineer
Telerik team
 answered on 15 Jan 2024
1 answer
27 views

Good evening, community,

After trying on my own and not being able to find a solution, I am in need of help.

Problem:

I have a radGridView control in a form called radGridView1. I have added columns to it, but I want the focus() and cursor to blink in the first cell of the first column when the form loads. This would allow me to start typing directly in the cell. I have tried everything I can think of, but I have not been able to achieve this.

What I have tried:

The closest I have come is with the following code:

I have commented out all of the code to show you what I have been doing, but I have not been able to get it to work. Please help me find a solution to my problem.

Thank you,

Community

Nadya | Tech Support Engineer
Telerik team
 answered on 08 Jan 2024
1 answer
41 views

I have a grid that has 2 image columns - one for an edit icon and one for Delete.  I need separate icons to so they show properly when the row is highlighted and when it is not. I'm adding the icons as shown below. Each row will get these icons. However, if the value in the Relation column is set to Maker then there should be no Delete icon and the Delete event should not fire.

When I set e.Row.Cells["Delete"].Value = null;, nothing happens. The Delete icon remains. What am I missing here?

void gvRelatedPhoneNumbers_CellFormatting(object sender, CellFormattingEventArgs e)
{

    if (e.CellElement is GridDataCellElement)
    {
        if (e.Column.Name == "Propertys") // Edit
            e.CellElement.Image = e.Row.IsSelected ? Properties.Resources.EditPenWhite16 : Properties.Resources.EditPen16;

        if (e.Column.Name == "Delete") // Delete
            e.CellElement.Image = e.Row.IsSelected ? Properties.Resources.TrashcanWhite16 : Properties.Resources.Trashcan16;

        if (e.Column.Name == "Relation")
        {
            if (e.CellElement.Value != "Maker")
                e.Row.Cells["Delete"].Value = null;
        }

    }
}

Thanks

Carl

Nadya | Tech Support Engineer
Telerik team
 answered on 08 Jan 2024
1 answer
27 views

I got my db in sql and i load a datagrid but still i see the scroll, and its loading all data 50k records, any chance to turn on infinite scroll? so when im scrolling its getting data ? i mean is not slow as 50k was loaded in less than a second.

 

thank you

Nadya | Tech Support Engineer
Telerik team
 answered on 02 Jan 2024
1 answer
42 views

Hi,

 I’m trying to handle the drag and drop operation from a winforms control (RadGridView for now, can be RadTreeView or RadListView too) to the RadScheduleView WPF.

 I have overridden the ConvertDraggedData from ScheduleViewDragDropBehavior class.

 The event isn’t firing when I’m dragging a row from my winforms GridView over the schedule.

 Is there a way to convert dragged data from the grid in winforms that make the event fires in WPF?

 Or another way to achieve the expected behavior ?

 

 Thanks.

 Rémi

Dinko | Tech Support Engineer
Telerik team
 answered on 28 Dec 2023
1 answer
43 views

Hi I am working on Radgridview where on a particular column I have hidden few options like below.

Private Sub grd_ContextMenuOpening(sender As Object, e As ContextMenuOpeningEventArgs) Handles grd.ContextMenuOpening
        Dim i As Integer = 0
        Dim IgnoreOperator() As String = {"Ends with", "Equals", "not equal to", "no filter"}
        If DirectCast(e.ContextMenuProvider, Telerik.WinControls.UI.GridCellElement).ColumnInfo.FieldName = "AcctNbr" Then
            While i < e.ContextMenu.Items.Count
                If Not IgnoreOperator.Contains(e.ContextMenu.Items(i).Text, StringComparer.CurrentCultureIgnoreCase) Then
                    e.ContextMenu.Items(i).Visibility = Telerik.WinControls.ElementVisibility.Collapsed
                End If
                i = i + 1
            End While
        End If
    End Sub

My requirement is to search data from a different a column of Dataview which is binded to the grid  however  column header is different.

I wrote below code expecting that  when `AcctNbr` is the header of column it will search the dataview(dv) based on the row filter and bind it the grid on UI but it's not working

Private Sub grd_FilterChanging(sender As Object, e As GridViewCollectionChangingEventArgs) Handles grd.FilterChanging
        dv.RowFilter =""
        If e.NewValue IsNot Nothing
        If DirectCast((DirectCast(e.NewItems, Object())(0)), Telerik.WinControls.Data.FilterDescriptor).[Operator] = Telerik.WinControls.Data.FilterOperator.IsEqualTo AndAlso DirectCast((DirectCast(e.NewItems, Object())(0)), Telerik.WinControls.Data.FilterDescriptor).PropertyName = "AcctNbr" Then
            Dim CurrentVal As String = CStr(e.NewValue)
            dv.RowFilter = "EnAcctNbr ='" & CurrentVal & "'"
        End If
        If DirectCast((DirectCast(e.NewItems, Object())(0)), Telerik.WinControls.Data.FilterDescriptor).[Operator] = Telerik.WinControls.Data.FilterOperator.IsNotEqualTo AndAlso DirectCast((DirectCast(e.NewItems, Object())(0)), Telerik.WinControls.Data.FilterDescriptor).PropertyName = "AcctNbr" Then
            Dim CurrentVal As String = CStr(e.NewValue)
            dv.RowFilter = "EnAcctNbr <>'" & CurrentVal & "'"
        End If
        End If

how can I achieve this behavior ? I tried to assign the updated dataview as datasource to the grid in `grd_CellEndEdit` event that too did not work. pls. help.

Regards,

Amit Rai

 

 

Nadya | Tech Support Engineer
Telerik team
 answered on 21 Dec 2023
1 answer
75 views

Dear Friends,
I am using telerik SelectionChanged event to select row value from grid, another thing I am opening context menu using ContextMenuOpening event, now the problem I am facing is that when I do right click I loss my current selected row.
I do not want to loss current selected row but same time I want to fire  right click event using ContextMenuOpening , do we have any possible solutions for it so we will not loss our selected row when firing ContextMenuOpening of grid.

 

Thanks

Nadya | Tech Support Engineer
Telerik team
 answered on 21 Dec 2023
1 answer
34 views

I have a radgridview grid with paging.  I have a mouse double click event:


private void RgvSyncUp_MouseDoubleClick(object? sender, MouseEventArgs e)
{
	var rgv = (RadGridView)sender;
	var myRow = rgv.CurrentRow;
	var dlg = new DlgPendingSync(myRow);
	dlg.ShowDialog();
}

 

The problem I am having is this, that if the user double clicks a paging control it fires off the mouse double click event and the dialog mentioned in the code gets shown. 

Is there a way to trap or prevent this or prevent the double click on the paging control from firing off my dialog?

 

Thank you,

Kevin

 

 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 07 Dec 2023
1 answer
41 views

BestFitColumns is a great way to stretch/narrow your columns based on the data they contain.

There are a few issues when using this.  My suggestion deals with one of them.

Suggestion:  When using BestFitColumns, please add a new optional Parameter called "PadWidth" or something similar.  This would be an Integer value and when the BestFitColumns executes, it will add "PadWidth" pixels to the width of the column AFTER calculating the 'Best Fit' width.

Reason:  Several Themes will accurately "squeeze" column width's so they JUST BARELY fit the Column Data. While this may be the desired output, it's rather unpleasant to look at:  The data is smashed right up against both left and right cell borders.  Additionally, some themes have a 2 or more pixel, Cell FOCUSED border (I don't know what to call it.  The 'cursor' perhaps?  The visual indicator of what Cell the user is currently on. 

Anyway, as you move this 'Cursor' if you navigate to a cell where the data was the widest, this thicket "border" takes up too much room in the cell to display the entire string, and so you're back to seeing Ellipses instead of the entire data.

By adding an Optional "PadWidth" value (I'll use 10 for example) AFTER the BestFit width has been calculated but before that is applied to all columns, the cell width will gain an additional 10 pixels.  This will allow for the extra-wide Cell "cursors" as well as allow developers to create less "cramped" grids.

 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 06 Dec 2023
2 answers
672 views
Hi..

I want to ask if there is any approach to determine the position of mouse down or up related to cell, in order to know which part of cell has been clicked.

Thanks in advance.
Jeff
Top achievements
Rank 1
Iron
 answered on 01 Dec 2023
Narrow your results
Selected tags
Tags
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
Buttons, RadioButton, CheckBox, etc
DropDownList
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
Panorama
GanttView
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
VirtualGrid
ContextMenu
Spreadsheet
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
Rotator
TrackBar
MessageBox
CheckedDropDownList
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
DateTimePicker
CollapsiblePanel
Conversational UI, Chat
CAB Enabling Kit
TabbedForm
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
PictureBox
VirtualKeyboard
FilterView
Accessibility
DataLayout
NavigationView
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BreadCrumb
LocalizationProvider
Dictionary
Overlay
Security
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
Flyout
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?