To reproduce: Add a RadGridView and use the following code. When you expand the first row, the vertical scrollbar is not correct. Scrolling down changes its size. However, if you expand the last row, it takes few seconds to open. Second scenario: In addition of the following code, if you change the TableElement.PageViewMode to PageViewMode.ExplorerBar, expanding the first row takes few seconds to load the hierarchical data as well. public partial class Form1 : Form { public Form1() { InitializeComponent(); List<Item> items = new List<Item>(); List<SubItem> subItems = new List<SubItem>(); for (int i = 1; i <= 3; i++) { Item item = new Item(i, "Item" + i); for (int j = 1000; j <= 2010; j++) { subItems.Add(new SubItem(j, "SubItem" + j, i)); } items.Add(item); } this.radGridView1.DataSource = items; this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; GridViewTemplate template = new GridViewTemplate(); template.ReadOnly = true; template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; GridViewRelation relation = new GridViewRelation(this.radGridView1.MasterTemplate, template); relation.ParentColumnNames.Add("Id"); relation.ChildColumnNames.Add("ItemId"); this.radGridView1.MasterTemplate.Templates.Add(template); this.radGridView1.Relations.Add(relation); template.DataSource = subItems; } } public class Item { public int Id { get; set; } public string Title { get; set; } public Item(int id, string title) { this.Id = id; this.Title = title; } } public class SubItem { public int Id { get; set; } public int ItemId { get; set; } public string Name { get; set; } public SubItem(int id, string name, int itemId) { this.Id = id; this.ItemId = itemId; this.Name = name; } }
Hello,
I am having issues with DateTime editor in the grid. We have custom date/time format for our dates - "HH:mm:ss dd-MMM-yyyy" and the datetime editor is set to free form date time with this mask. When user typed a value in the editor it is passed to FreeFormDateTimeProvider.Validate method, which calls DateInput.ParseDate. DateTimeLexer splits this kind of values just fine, but obviously time related tokens comes first and then the date related tokens.
Unfortunately DateTimeParser.Parse method is made the way that it parse date at first and then time from the tokens list. In my case this means time value is parsed and the date value is dropped to default. Why didn't you check that if after ParseDate and ParseTime calls the date portion is null but there are still remaining tokens in the list, so you may call ParseDate one more time?
Do you have any suggestion how could I resolve this issue? Everything related to date time parsing is not extendable at all, starting from DateInput, most of the classes and methods are not public and even some public methods are not virtual. Can I have the Telerik free form date time typing capabilities in the editor but still have time part before date part?
Please run the attached sample project and try to expand a row. The following error occurs:
System.NullReferenceException was unhandled by user code
The function OnNotifyPropertyChanged(string propertyName) in RadGridView.cs does not call the base function of RadControl.
RadGridView.cs
protected override void OnNotifyPropertyChanged(string propertyName)
{
if (propertyName == "AutoSize")
{
if (!this.AutoSize)
{
this.RootElement.StretchHorizontally = true;
this.RootElement.StretchVertically = true;
}
else
{
this.RootElement.StretchHorizontally = false;
this.RootElement.StretchVertically = false;
}
}
}
RadControl.cs
/// <summary>
/// Raises the PropertyChanged event
/// </summary>
/// <param name="propertyName">The name of the property</param>
protected virtual void OnNotifyPropertyChanged(string propertyName)
{
this.OnNotifyPropertyChanged(new PropertyChangedEventArgs(propertyName));
}
protected virtual void OnNotifyPropertyChanged(PropertyChangedEventArgs e)
{
PropertyChangedEventHandler handler1 =
(PropertyChangedEventHandler)this.Events[RadControl.PropertyChangedEventKey];
if (handler1 != null)
{
handler1(this, e);
}
}
Because of this i cannot do the following
RadGridView grid = new RadGridView();
grid.OnNotifyPropertyChanged("mypropertyname");
I currently work around this by doing the following
RadGridView grid = new RadGridView(); grid.OnNotifyPropertyChanged(new PropertyChangedEventArgs("mypropertyname"));
I need this functionality because i have a custom control which is derived from RadGridView and it has a custom property that requires databinding with INotifyPropertyChanged. I cannot implement this interface myself because the grid already does this.
I have checked this in both the 2018.1.220 and 2019.1.219 source.
Kind regards,
Edwin Dirkzwager
CIP Software
To reproduce:
Update the data source directly and check the OldItems array.
To reproduce: change the decimal separator to ",". Please refer to the attached sample project and follow the steps from the attached gif file. Workaround: change the CurrentCulture in your application in order to affect the decimal separator: Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB");
When UseCompatibleTextRendering property is set to false, the data cells overlaps the row header cells when horizontal scrolling is performed.
How can I enter the Value "" (empty string) in the traditional filter system (not Excel like filter).
The grid does not seem to accept an empty string as an argument to "Equals" through the UI.
Ideally I would like to extend the standard filter menu in traditional filtering (and the filter operator drop down in custom filtering dialog) to contain operators "Is Empty" "Is Not Empty" and "Is Null Or Empty", "Is Not Null And Not Empty"
Regards
Erwin
When you start typing in the search text box some long text, not all key strokes will be handled. Please refer to the attached gifs file illustrating the behavior in the previous version and the latest release.
Please refer to the attached sample project. Run the project and try typing "too long to type" in as your search.
To reproduce: use the following code snippet, save the layout and load it afterwards. You will notice that only the master and the first child template are successfully loaded. public Form1() { InitializeComponent(); DataTable dt = new DataTable(); dt.Columns.Add("Id", typeof(int)); dt.Columns.Add("Name", typeof(string)); for (int i = 0; i < 5; i++) { dt.Rows.Add(i, "Parent" + i); } this.radGridView1.MasterTemplate.DataSource = dt; this.radGridView1.MasterTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; //child level 1 GridViewTemplate template = new GridViewTemplate(); template.DataSource = GetData(5, 20, 0, 5); template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; radGridView1.MasterTemplate.Templates.Add(template); GridViewRelation relation = new GridViewRelation(radGridView1.MasterTemplate); relation.ChildTemplate = template; relation.RelationName = "ParentChild"; relation.ParentColumnNames.Add("Id"); relation.ChildColumnNames.Add("ParentId"); radGridView1.Relations.Add(relation); //child level 2 GridViewTemplate template2 = new GridViewTemplate(); template2.DataSource = GetData(20, 40, 5, 20); template2.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; template.Templates.Add(template2); GridViewRelation relation2 = new GridViewRelation(template); relation2.ChildTemplate = template2; relation2.RelationName = "ParentChild"; relation2.ParentColumnNames.Add("Id"); relation2.ChildColumnNames.Add("ParentId"); radGridView1.Relations.Add(relation2); //child level 3 GridViewTemplate template3 = new GridViewTemplate(); template3.DataSource = GetData(40, 100, 20, 40); template3.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; template2.Templates.Add(template3); GridViewRelation relation3 = new GridViewRelation(template2); relation3.ChildTemplate = template3; relation3.RelationName = "ParentChild"; relation3.ParentColumnNames.Add("Id"); relation3.ChildColumnNames.Add("ParentId"); radGridView1.Relations.Add(relation3); //child level 4 GridViewTemplate template4 = new GridViewTemplate(); template4.DataSource = GetData(100, 200, 40, 100); template4.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; template3.Templates.Add(template4); GridViewRelation relation4 = new GridViewRelation(template3); relation4.ChildTemplate = template4; relation4.RelationName = "ParentChild"; relation4.ParentColumnNames.Add("Id"); relation4.ChildColumnNames.Add("ParentId"); radGridView1.Relations.Add(relation4); } private object GetData(int from, int to, int parentFrom, int parentTo) { DataTable dt = new DataTable(); dt.Columns.Add("Id", typeof(int)); dt.Columns.Add("Name", typeof(string)); dt.Columns.Add("ParentId", typeof(int)); Random rand = new Random(); for (int i = from; i < to; i++) { dt.Rows.Add(i, "Child" + i, rand.Next(parentFrom, parentTo)); } return dt; } private void radButton1_Click(object sender, EventArgs e) { string s = "default.xml"; SaveFileDialog dialog = new SaveFileDialog(); dialog.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*"; dialog.Title = "Select a xml file"; if (dialog.ShowDialog() == DialogResult.OK) { s = dialog.FileName; } this.radGridView1.SaveLayout(s); } private void radButton2_Click(object sender, EventArgs e) { string s = "default.xml"; OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "xml files (*.xml)|*.xml|All files (*.*)|*.*"; dialog.Title = "Select a xml file"; if (dialog.ShowDialog() == DialogResult.OK) { s = dialog.FileName; } this.radGridView1.LoadLayout(s); } Workaround: grid templates for the inner levels are recreated after loading the layout. Their DataSource is null and the existing relations points to the old templates. Clear the relations and setup them again with the new child template instances.
To reproduce:
- Add items with the same display member open the drop-down and select the second.
- Select another control on the form and then reopen the popup.
- The first item is selected.
Workaround:
class MyMultiColumnComboBox : RadMultiColumnComboBox
How to reproduce: public partial class Form1 : Form { public Form1() { InitializeComponent(); ThemeResolutionService.AllowAnimations = false; this.radGridView1.DataSource = this.GetData(); } private DataTable GetData() { DataTable dt = new DataTable(); dt.Columns.Add("Id", typeof(int)); dt.Columns.Add("Name", typeof(string)); dt.Rows.Add(1, "\u0002x09"); for (int i = 1; i < 10; i++) { dt.Rows.Add(i, "name"); } return dt; } private void radButton1_Click(object sender, EventArgs e) { GridViewSpreadExport spreadExporter = new GridViewSpreadExport(this.radGridView1); spreadExporter.FileExportMode = FileExportMode.CreateOrOverrideFile; SpreadExportRenderer exportRenderer = new SpreadExportRenderer(); spreadExporter.RunExport(@"..\..\exported-file.xlsx", exportRenderer); } } ArgumentException with clarification similar to "'\u001f', hexadecimal value 0x1F, is an invalid character." is thrown when trying to export document containing characters which are not supported in XML document - such as some control characters like 0x00, 0x1F, 0x1B, etc. Such characters are described in the XML specification here: https://www.w3.org/TR/xml/#charsets. Although the escaped strings are not supported (see https://feedback.telerik.com/Project/184/Feedback/Details/190228 ), the library could prevent the exception and export the document successfully by skipping such characters. Workaround: remove such characters before the export. Check the following StackOverflow answer for some ideas on code for replacing the characters: http://stackoverflow.com/a/14323524/259206
How to reproduce: bind the grid using the code snippet below and enter name in the SearchRow public partial class RadForm1 : Telerik.WinControls.UI.RadForm { public RadForm1() { InitializeComponent(); this.radGridView1.DataSource = this.GetData(); this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; this.radGridView1.AllowSearchRow = true; this.radGridView1.MasterView.TableSearchRow.InitialSearchResultsTreshold = 0; this.radGridView1.MasterView.TableSearchRow.SearchResultsGroupSize = int.MaxValue;; } private DataTable GetData() { DataTable dt = new DataTable(); dt.Columns.Add("Id", typeof(int)); dt.Columns.Add("Name", typeof(string)); dt.Columns.Add("Date", typeof(DateTime)); dt.Columns.Add("Bool", typeof(bool)); dt.Columns.Add("Description", typeof(string)); for (int i = 0; i < 2000; i++) { for (int j = 0; j < 5; j++) { dt.Rows.Add(i, "Name " + j, DateTime.Now.AddDays(i), i % 2 == 0 , "Description " + i); } } return dt; } } Workaround: in the search row, set the InitialSearchResultsTreshold property to 0 and the SearchResultsGroupSize property to int.MaxValue public RadForm1() { InitializeComponent(); this.radGridView1.DataSource = this.GetData(); this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; this.radGridView1.AllowSearchRow = true; this.radGridView1.MasterView.TableSearchRow.SearchProgressChanged += TableSearchRow_SearchProgressChanged; this.radGridView1.MasterView.TableSearchRow.InitialSearchResultsTreshold = 0; this.radGridView1.MasterView.TableSearchRow.SearchResultsGroupSize = int.MaxValue; }
To reproduce: please refer to the attached sample project and follow the steps from the attached gif file. 1. Run the project and type "hana" in the second filter cell. You will notice that after a few seconds the input is handled and the grid is filtered. Workaround: use RadVirtualGrid instead. https://docs.telerik.com/devtools/winforms/virtualgrid/overview https://docs.telerik.com/devtools/winforms/virtualgrid/filtering/filtering Second workaround: https://docs.telerik.com/devtools/winforms/gridview/filtering/how-to/filter-on-enter
Changing the DataSource or scrolling are slow. Create a grid with more than 20 columns and add 5K rows for example. Maximize the form and try to scroll with mouse wheel. You will notice that the scrolling performance is worse compared to the normal state of the form with less visible visual elements. Workaround: this.radGridView1.EnableFastScrolling = true; and use the scrollbar's thumb Second workaround: use paging: https://docs.telerik.com/devtools/winforms/gridview/paging/overview Thus, you will display as many rows as possible to display on the screen per page. Instead of scrolling, you will navigate through pages.
To reproduce: - Filter a self-referencing grouped grid. Workaround: private void _rgvFreeCodeValues_FilterChanged(object sender, GridViewCollectionChangedEventArgs e) { foreach (var row in RgvFreeCodeValues.Rows) row.IsExpanded = false; } private void _rgvFreeCodeValues_FilterChanging(object sender, GridViewCollectionChangingEventArgs e) { foreach (var row in RgvFreeCodeValues.Rows) row.IsExpanded = true; }
This was working this way in 2017 then we changer it so all rows are affected. Bot modes should be supported.
Dears
Looks like after last Telerik update to 2019.1.117.40 lilter do digits/numbers is not working any more. When I'd like filter out on decimal columns (or even text column but with linked decimal/int values) I get no results, no rows.
With text columns all is ok.
BR