public class MaximeyesDataBoundGrid : GridControl
{
public MaximeyesDataBoundGrid()
{ }
protected override void OnPaint(PaintEventArgs pe)
{
if (this.Updating)
return;
base.OnPaint(pe);
}
} |
Hi Kedar,
Thanks for using Syncfusion product.
The reported issue occur when trying to render the grid in update mode. So, we suspect you may use the BeginUpdate method and try to paint the grid without using the EndUpdate method. Also, your shared code part, you have implement the MaximeyesDataBoundGrid and override the OnPaint method. So, you may handle this exception by using Updating property. Please find the following code example.
C#
public class MaximeyesDataBoundGrid : GridControl{public MaximeyesDataBoundGrid(){ }protected override void OnPaint(PaintEventArgs pe){if (this.Updating)return;base.OnPaint(pe);}}If you still face the problem please provide the code you are using or an issue reproducible sample to reproduce your reported scenario. It will be helpful us to address the issue at the earliest.
Regards,Arulraj A
Public Class MDBoundGrid Try 'Some code Catch ex As Exception 'make entry in logs End Try MyBase.onpaint(Pe) End Sub '''Some Other methos |
Imports ClientControls.MDBoundGrid Public Class Appointments Friend WithEvents MDBoundGrid_Appointments As ClientControls.MDBoundGrid Private Sub RefreshAppointmentsGrid(ByVal asType As String) Try 'for the following code exception is occurring, most of the time when DataSource is getting filled. MDBoundGrid_Appointments.DataSource = moAppointmentDV 'moAppointmentDV is already filled System.Data.DataView MDBoundGrid_Appointments.Refresh() Catch e As Exception 'make the entry in logs End Try End Sub |
As well as I would like to let you know the exception I have mentioned before was seen in recent days when I have added some Logs in code, before that we had got following exception logs, and output was same UI distortion.
: In Filling appointment Grid with datasetSystem.ArgumentException: Value does not fall within the expected range.
at Syncfusion.Windows.Forms.Grid.GridRangeInfo..ctor(Int32 top, Int32 left, Int32 bottom, Int32 right)
at Syncfusion.Windows.Forms.Grid.GridRangeInfo.InternalCells(Int32 top, Int32 left, Int32 bottom, Int32 right)
at Syncfusion.Windows.Forms.Grid.GridViewLayout.Initialize()
at Syncfusion.Windows.Forms.Grid.GridViewLayout.DemandInitialize()
at Syncfusion.Windows.Forms.Grid.GridViewLayout.ColIndexToVisibleClient(Int32 col, Boolean& hidden)
at Syncfusion.Windows.Forms.Grid.GridViewLayout.VisitVisibleCells(GridRangeInfo range, GridRowColRangeInfoHandler[] handler)
at Syncfusion.Windows.Forms.Grid.GridControlBase.RangeInfoToRectangle(GridRangeInfo range, GridRangeOptions options)
at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.PerformLayout(Int32 rowIndex, Int32 colIndex)
at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.Initialize(Int32 rowIndex, Int32 colIndex)
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.Refresh()
at Syncfusion.Windows.Forms.Grid.GridControlBase.Refresh(Boolean fromModel)
at Syncfusion.Windows.Forms.Grid.GridControlBase.Refresh()
at Syncfusion.Windows.Forms.Grid.GridDataBoundGrid.BinderDataSourceChanged(Object sender, EventArgs e)
at Syncfusion.Windows.Forms.Grid.GridModelDataBinder.OnDataSourceChanged(EventArgs e)
at Syncfusion.Windows.Forms.Grid.GridModelDataBinder.Set_ListManager(Object newDataSource, String newDataMember, Boolean force, Boolean forceColumnCreation)
at Syncfusion.Windows.Forms.Grid.GridModelDataBinder.set_DataSource(Object value)
at Syncfusion.Windows.Forms.Grid.GridDataBoundGrid.set_DataSource(Object value)
at ClientUIMainForm.Appointments.RefreshAppointmentsGrid(String asType)
Hi Kedar,
Thanks for your update.
From your code part, you are trying to bind the datasource for GridDataBoundGrid. This code part is not helpful to reproduce your reported scenario. We have tested your reported scenario with below attached sample using our Syncfusion product version 16.4.0.42 and 16.4.0.52. But the sample is working fine as we expected. So, if it is possible please provide the simple application with issue reproduceable state which will be helpful for us to provide the solution at the earliest.
Please let us know if you need any further details on this.
Arulraj A