The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
How some of the settings in my GDBG are getting reset to defaults after sorting (when the user clicks on one of the col headers). Is there any way I can catch the sort complete event so I can reset the property? I''m trying to apply AutoReSize to cells.
ADAdministrator Syncfusion Team August 30, 2005 10:22 AM UTC
You can subscribe to the dataview.ListChanged event associated with the datasource and the grid. There you can test for the Reset setting. This event is raised after a sort.
CurrencyManager cm = this.gridDataBoundGrid1.BindingContext[this.gridDataBoundGrid1.DataSource, this.gridDataBoundGrid1.DataMember] as CurrencyManager;
((DataView)cm.List).ListChanged += new ListChangedEventHandler(Form1_ListChanged);
private void Form1_ListChanged(object sender, ListChangedEventArgs e)
{
if(e.ListChangedType == ListChangedType.Reset)
{
Console.WriteLine("sorted???");
}
}
APAtith PagdiAugust 30, 2005 11:52 AM UTC
I tried this approach by adding the event handler in the page load (if I did it in the windows generated code section at the class level, I was getting an object referenced to null exception), but the application started hanging whenever I sorted. Also, in the handler, I put the following code:
this.dgTest.Model.RowHeights.ResizeToFit(GridRangeInfo.Cells(0, 1, this.dgTest.Model.RowCount, this.dgTest.Model.ColCount), GridResizeToFitOptions.IncludeHeaders);
this.dgEx.Model.RowHeights.ResizeToFit(GridRangeInfo.Cells(0, 1, this.dgEx.Model.RowCount, this.dgEx.Model.ColCount), GridResizeToFitOptions.IncludeHeaders);
but the cells still remained the same size as before (too much whitespace in some, and no resizing in others). I want the cells to resize automatically according to the data. On certain events I take some rows out of one data set and insert them into another and vice versa. Any other way of doing this?