Added Error Handler for corrupted table data.
This commit is contained in:
parent
6098140d26
commit
505bfa467d
@ -759,10 +759,17 @@ namespace Volian.Controls.Library
|
||||
Focus();
|
||||
MyFlexGrid.Focus();
|
||||
if (!MyFlexGrid.IsRoTable) // Table ROs are none editable - don't select a table cell
|
||||
{
|
||||
try
|
||||
{
|
||||
MyFlexGrid.Select(0, 0);
|
||||
MyFlexGrid.FirstEntry = true; // to fix a problem with initial mouse click into table
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("The content of this table is corrupted. You will either need to restore a previous version or delete it.", "Table Corrupted", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -58,6 +58,7 @@ namespace Volian.Controls.Library
|
||||
|
||||
public partial class VlnFlexGrid : C1.Win.C1FlexGrid.C1FlexGrid
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private bool _Disposed = false;
|
||||
private static int _CountCreated = 0;
|
||||
private static int _CountDisposed = 0;
|
||||
@ -892,6 +893,8 @@ namespace Volian.Controls.Library
|
||||
// - set Visible back to true.
|
||||
Visible = false;
|
||||
if (Parent is GridItem)
|
||||
{
|
||||
try
|
||||
{
|
||||
System.Drawing.Image img = this.CreateImage();
|
||||
using (Graphics gr = (Parent as GridItem).CreateGraphics())
|
||||
@ -899,6 +902,11 @@ namespace Volian.Controls.Library
|
||||
gr.DrawImage(img, Left, Top);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_MyLog.WarnFormat("Table Content Corrupted");
|
||||
}
|
||||
}
|
||||
Clear();
|
||||
MergedRanges.Clear();
|
||||
_ReadingXml = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user