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?
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
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
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
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
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
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
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
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.