Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
110
XamDataGrid row disappearance issue
posted

Hi Team,

We are using Infragistics 16.1.20161.1000, Basically our grid is binded with a ItemSource which keep get updated from a  background process(after every second it will get delta records from backend process). we have recently used InitializedRecord event so that newly updated/added grid rows should go to there proper position -

 

void _grid_InitializeRecord(object sender, Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs e)
{
try
{
_refreshRequired = true;
if (e.Record is DataRecord)
{
((DataRecord) e.Record).RefreshSortPosition();
((DataRecord) e.Record).RefreshFilters();
}
}
catch (Exception)
{ }
}

we have move this change to production, but now some of our users are start complaining about grid row disappearance on random basis.

We have checked our logs & found below entry but we are not sure if its causing row disappearance(Note - In some cases row get visible if we resize grid container)

Exception Log -

Message: [1] Problem: , Exception='System.NullReferenceException: Object reference not set to an instance of an object.

   at Infragistics.Windows.DataPresenter.RecordPresenter.InitializeRecord(Object item, Boolean isUsedForHeaderOnly)

   at Infragistics.Windows.DataPresenter.RecordPresenter.PrepareContainerForItem(Object item, Boolean isUsedForHeaderOnly)

   at Infragistics.Windows.DataPresenter.DataRecordPresenter.PrepareContainerForItem(Object item, Boolean isUsedForHeaderOnly)

   at Infragistics.Windows.DataPresenter.RecordPresenter.PrepareContainerForItem(Object item)

   at Infragistics.Windows.DataPresenter.RecordListControl.PrepareContainerForItemOverride(DependencyObject element, Object item)

   at Infragistics.Windows.Virtualization.RecyclingItemContainerGenerator.PrepareItemContainer(DependencyObject container)

   at Infragistics.Windows.DataPresenter.GridViewPanelNested.GenerateRecordPresenters(Size adjustedConstraint, Boolean topFixedRecordsOnly, Boolean bottomFixedRecordsOnly, Int32 rootTopFixedAdjustment, HeaderPlacement headerPlacement, Int32 maxRecordsToGenerate, Record& topRecordDisplayed, Record& lastRecordDisplayed, FieldLayout& lastFieldLayout, Int32& highestItemIndexProcessed, Int32& numberOfRecordsGenerated)

   at Infragistics.Windows.DataPresenter.GridViewPanelNested.MeasureOverride(Size availableSize)

   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

   at System.Windows.UIElement.Measure(Size availableSize)

   at System.Windows.ContextLayoutManager.UpdateLayout()

   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)

   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()

   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)

   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)

   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)

   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)'

  • 16495
    Offline posted

    Hello Lalit,

    I have prepared a simple sample application based on your code and I was not able to reproduce the record disappearance issue that you are having. If you take a look at the RefreshSortPosition topic from our documentation you will see that it is better to call the RefreshSortPosition by using the Dispatcher’s BeginInvoke method.

    I have attached the sample project I used to test this.  Please test this project on your PC, whether or not it works correctly may help indicate the nature of this problem. If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using.  My test was performed using version 16.1.20161.1000 and 16.1.20161.2231 of WPF product.

    If the project does show the product feature working correctly, this indicates a possible problem in the code of your application.  It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing. Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.

    Please let me know if I can provide any further assistance.

    Sincerely,
    Zhivko
    Associate Software Developer

    XDG_Issue.zip