To reproduce: - Add some rows to a grid. - Sort the rows. - Delete a row. - The current row is not the next row. Workaround: Dim t As Test = RadGridView1.CurrentRow.DataBoundItem Dim index As Integer = Me.RadGridView1.ChildRows.IndexOf(Me.RadGridView1.CurrentRow) datasource.Remove(t) Me.RadGridView1.CurrentRow = Me.RadGridView1.ChildRows(index)
Follow the steps:
1.Group by Description.
2. Expand the groups
3. Sort by Id
4. Try expanding the hierarchical level. You will notice that some of the rows disappear.
Please refer to the attached gif file illustrating the steps for replicating the issue.
Hi
Please find attached sample project having 2 different reference folder(Telerik2018,Telerik2020) for Telerik.
Code flow & Issue description: I have Event "radGridView1_EditorRequired" in which i have attached another event on value changed "Editor_ValueChanged" in which we get data gron DropdownListElement using ((RadDropDownListElement)(sender)).SelectedValue.
Issue is when we use version (2018.3.1016.40) we get selected value text, in case of current version (2020.1.218.40) we get null value.
Current version DLL 2020.1.218.40 (Issue in current version)
Previous version DLL 2018.3.1016.40 (Working fine)
Note : I have also attached both version of Telerik DLL in sample project, you can reproduce issue by referencing to 2020.1.218.40 version. After selecting values as shown in attached screenshot you will get null value as shown in another screenshot.
Please find attached screenshot for selecting values to reproduce issue as well where we get null value.
Thanks and Regards
To reproduce: please refer to the attached sample project and gif file. Workaround: use the CellFormatting event and apply the light orange BackColor for the selected cells belonging to the current pinned column: private void radGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e) { if (e.Row.IsSelected && e.Column.IsCurrent) { e.CellElement.BackColor = Color.FromArgb(255, 231, 174); } else { e.CellElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local); } }
Steps to reproduce:
1. Bind the grid to BindingList
2. Call BestFitColumns method in form's constructor
3. Use Fluent/Crystal theme
4. Rebind the grid by setting DataSource=null
5. Exception is thrown
Stack trace:
en Telerik.WinControls.UI.BestFitHelper.SetColumnWidth(GridViewColumn column, Single desiredWidth) en Telerik.WinControls.UI.BestFitHelper.BestFitColumnCore(GridViewColumn column, BestFitColumnMode mode) en Telerik.WinControls.UI.BestFitHelper.ProcessRequests() en Telerik.WinControls.UI.GridTableElement.UpdateAll() en Telerik.WinControls.UI.GridTableElement.UpdateViewCore(Object sender, DataViewChangedEventArgs args) en Telerik.WinControls.UI.GridTableElement.UpdateView(Object sender, DataViewChangedEventArgs args) en Telerik.WinControls.UI.GridTableElement.ProcessTemplateEvent(GridViewEvent eventData) en Telerik.WinControls.UI.GridTableElement.Telerik.WinControls.UI.IGridViewEventListener.ProcessEvent(GridViewEvent eventData) en Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessCollection(GridViewEvent gridEvent, PriorityWeakReferenceList list, GridEventProcessMode processMode) en Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessEvent(GridViewEvent gridEvent) en Telerik.WinControls.UI.GridViewSynchronizationService.NotifyListeners(GridViewEvent gridEvent) en Telerik.WinControls.UI.GridViewSynchronizationService.FlushEvents() en Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(GridViewEvent gridEvent) en Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(GridViewTemplate template, GridViewEvent eventData, Boolean postUI) en Telerik.WinControls.UI.GridViewTemplate.DispatchEvent(GridViewEvent gridEvent, Boolean postUI) en Telerik.WinControls.UI.GridViewTemplate.DispatchDataViewChangedEvent(Object sender, DataViewChangedEventArgs args) en Telerik.WinControls.UI.GridViewTemplate.OnViewChanged(Object sender, DataViewChangedEventArgs e) en Telerik.WinControls.UI.MasterGridViewTemplate.OnViewChanged(Object sender, DataViewChangedEventArgs e) en Telerik.WinControls.UI.GridViewTemplate.CollectionView_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) en Telerik.WinControls.Data.RadCollectionView`1.OnCollectionChanged(NotifyCollectionChangedEventArgs args) en Telerik.WinControls.Data.RadDataView`1.RebuildData(Boolean notify) en Telerik.WinControls.Data.RadDataView`1.RefreshOverride() en Telerik.WinControls.Data.RadDataView`1.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args) en Telerik.WinControls.Data.RadCollectionView`1.source_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) en Telerik.WinControls.Data.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e) en Telerik.WinControls.Data.RadListSource`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) en Telerik.WinControls.Data.RadListSource`1.EndUpdate(Boolean notifyUpdates) en Telerik.WinControls.Data.RadListSource`1.Initialize() en Telerik.WinControls.Data.RadListSource`1.Bind(Object dataSource, String dataMember) en Telerik.WinControls.Data.RadListSource`1.set_DataSource(Object value) en Telerik.WinControls.UI.GridViewTemplate.set_DataSource(Object value) en Telerik.WinControls.UI.RadGridView.set_DataSource(Object value)
To reproduce: add a RadGridView with several columns. Set the Enabled property to false. Try to open the Property Builder and you will notice that the Columns are disabled in it. Workaround: set the Enabled property to false at run time. Thus, it would be possible to manipulate the columns via the Property Builder at design time.
To reproduce: Please run the sample project and follow the steps from the gif file. Workaround: private void radGridView1_SizeChanged(object sender, EventArgs e) { this.radGridView1.MasterTemplate.Refresh(); } public class Grid : RadGridView { public override string ThemeClassName { get { return typeof(RadGridView).FullName; } } protected override void OnResize(EventArgs e) { object value = null; if (this.ActiveEditor != null) { value = this.ActiveEditor.Value; } base.OnResize(e); if (value != null && this.CurrentCell != null) { this.CurrentCell.Value = value; } } }
To reproduce: please refer to the attached sample project. Note that the CellValidating event is fired twice even without showing a RadMessageBox. With an MS Button the problem is not reproducible. Workaround: use the RadGridView.ValueChanging event to perform validation while the user is typing in the active editor: private void radGridView1_ValueChanging(object sender, Telerik.WinControls.UI.ValueChangingEventArgs e) { if (((string)e.NewValue) != "x") { RadMessageBox.Show("Only 'x' allowed!"); e.Cancel = true; } }
I have a radGridView with MutliSelect set to true and SelectionMode set to FullRowSelect. A theme is applied, and this behavior is seen with other themes too. Several columns are pinned to the left.
When I multi-select rows using the shift or control buttons by clicking one of the cells under the frozen columns, the row is selected and colored accordingly, except for the cell that was actually clicked which remains with the unselected color.
If I multi-select by clicking on one of the cells under an unpinned column, the full row is selected as expected.
In the image below, I held down shift and selected the first and third row in sequence under the Officer column.
How can I fix this to show the complete row selected?
To reproduce: ColumnGroupsViewDefinition view = new ColumnGroupsViewDefinition(); view.ColumnGroups.Add(new GridViewColumnGroup("Customer Contact")); view.ColumnGroups[0].Rows.Add(new GridViewColumnGroupRow()); view.ColumnGroups[0].Rows[0].ColumnNames.Add("Address"); view.ColumnGroups[0].Rows[0].ColumnNames.Add("Contact"); radGridView1.Columns.Add("Address"); radGridView1.Columns.Add("Contact"); radGridView1.Columns[0].Width = 300; radGridView1.Columns[1].Width = 300; radGridView1.ViewDefinition = view; for (int i = 0; i < 10; i++) { radGridView1.Rows.Add("test test test test test", "test"); } Workaround: docs.telerik.com/devtools/winforms/telerik-presentation-framework/export-renderers/spreadexportrenderer
Run the attached project on a monitor with 100% DPI scaling and open the Excel-like filter popup:
100%:
After moving the form to the second monitor with 150% DPI scaling, the filter popup is not OK:
150%:
The popup is smaller and smaller with each next opening (see the attached gif file) at 150%. If you decide to move back the form on the monitor with 100% DPI scaling, the filter popup is not scaled properly.
When Excel-like filtering is enabled and the user selects an item from the "Available Filters" drop down menu, a CompositeFilterForm is shown.
C#. net core 6, winforms application, TekerikNuGet3 package source, UI.for.WinForms.AllControls.NetCore package 2022.2.622
I am trying to export selected cells from a RadGridView as a csv file.
When using "var exporter = new ExportToCSV(Dgv)" then "exporter.RunExport(fileName);" writes the csv file correctly. It exports every cell.
It doesn't support exporting selections so I wrote a function to do this . The one below is what I used in my project to test what I was doing. It initially writes the csv to a worksheet and wrote that using formatprovider to file, then I just created a stringbuilder adding quotes and appended that to the file afterwards.
Writing the worksheet, the csv values haven't been quoted, plus number fields have had leading zeros removed which proves to be a problem when telephone numbers are stored in a field.
So I googled and found the Settings property which is there to set csv options. But they are private, not public therefore I can't set up the csv propertly.
private void radButton1_Click(object sender, EventArgs e)
{
var workbook = new Workbook();
var worksheet = workbook.Worksheets.Add();
var rowIndex = 0;
var columnIndex = -1;
var sb = new StringBuilder();
var prevColumnIndex = -1;
// ForEach cell are accessed vertically then horizontally.
foreach (var cell in Dgv.SelectedCells)
{
// Cell is included in selection even if it's invisible
// so check visibility and ignore if it isnt
if (!cell.ColumnInfo.IsVisible) continue;
// At bottom of column, rownum will change. Watch for this
// and reset x and y values
var rowNum = cell.RowInfo.Index;
if (rowNum != prevColumnIndex)
{
prevColumnIndex = rowNum;
rowIndex = 0;
columnIndex++;
sb.AppendLine("");
}
else if (!string.IsNullOrEmpty(sb.ToString()))
sb.Append(",");
var value = cell.Value;
worksheet.Cells[columnIndex, rowIndex++ ].SetValue(value.ToString());
sb.Append($"\"{value.ToString()}\"");
}
var fileName = @"C:\temp\SampleFile.csv";
IWorkbookFormatProvider formatProvider = new CsvFormatProvider();
using var output = new FileStream(fileName, FileMode.Create);
formatProvider.Export(workbook, output);
output.Close();
// Write contents of sb to the file for comparison sake
File.AppendAllText(fileName, sb.ToString());
}