DataGridView on Row.Render() throws NullReferenceException

0
0

Hi everyone,

I’m using a DataGridView bound with a BindingSource.

We have like 5/6 Clients which updates data, at start we attach every client to an Event to keep everyone updated in real time.

To manage it, we did a function like :

private void Update(){

Grid.BeginUpdate();

//logic to insert on binding

Grid.EndUpdate();

}

When the grid updates (at around 100- 200ms per update) it throws this error:

System.NullReferenceException:
Object reference not set to an instance of an object.
in Wisej.Web.DataGridViewRow.Render(Object rowData)
in CallSite.Target(Closure , CallSite , DataGridViewRow , Object )
in Wisej.Web.DataGridViewRow.Render()
in Wisej.Web.DataGridView.UpdateRowAction.Wisej.Core.IWisejSerializable.Serialize(TextWriter writer, WisejSerializerOptions options)
in Wisej.Core.WisejSerializer.SerializeIWisejSerializable(JsonWriter writer, IWisejSerializable value)
in Wisej.Core.WisejSerializer.SerializeValue(JsonWriter writer, Object value)
in Wisej.Core.WisejSerializer.SerializeArray(JsonWriter writer, IEnumerable list)
in Wisej.Core.WisejSerializer.SerializeValue(JsonWriter writer, Object value)
in Wisej.Core.WisejSerializer.SerializeArray(JsonWriter writer, IEnumerable list)
in Wisej.Core.WisejSerializer.SerializeValue(JsonWriter writer, Object value)
in Wisej.Core.WisejSerializer.SerializeField(JsonWriter writer, String name, Object value, Boolean first, Boolean preserveCase)
in Wisej.Core.WisejSerializer.SerializeObject(JsonWriter writer, Object value)
in Wisej.Core.WisejSerializer.SerializeValue(JsonWriter writer, Object value)
in Wisej.Core.WisejSerializer.SerializeArray(JsonWriter writer, IEnumerable list)
in Wisej.Core.WisejSerializer.SerializeValue(JsonWriter writer, Object value)
in Wisej.Core.WisejSerializer.SerializeInternal(Object value, WisejSerializerOptions options)
in Wisej.Core.ResponseManager.ResponseActions.Wisej.Core.IWisejSerializable.Serialize(TextWriter writer, WisejSerializerOptions options)
in Wisej.Core.WisejSerializer.SerializeIWisejSerializable(JsonWriter writer, IWisejSerializable value)
in Wisej.Core.WisejSerializer.SerializeValue(JsonWriter writer, Object value)
in Wisej.Core.WisejSerializer.SerializeInternal(Object value, WisejSerializerOptions options)
in Wisej.Core.ResponseManager.<SendActions>b__44_0().

Is there a possible way to handle this error?

 

Best of regards,
Alex.

  • You must to post comments
0
0

You can handle any exception attaching to the Application.ThreadException event. If you can put together a small sample that reproduces the error we can see what’s causing it and suggest ways to synchronize the code and/or fix something in Wisej.

At a first glance, it’s probably trying to render a row that has been removed meaning that multiple threads are updating and rendering at the same time.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.