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
30
List of Null ColumnInfos from UltraGridBand.RowLayouts
posted

Having an issue where I get an null reference exception most (but not every) time I try to get a specific key from ColumnInfos. The code will work one out of every ten times while debugging, so I suspect this has something to do with asynchronous processing. While debugging I noticed that layout.ColumnInfos will have the correct count, but every item except "RootID" will be null which results in the exception when index "spacer" is read. Incidentally this code worked in 18.1 and now crashes in 19.1. 

 private static void ConfigureReelInfoBand(UltraGridBand reelInfoBand)
        {
            reelInfoBand.Indentation = 0;

            var spacerColumn = reelInfoBand.Columns.Add("spacer");
            spacerColumn.ProportionalResize = false;

            var layout = reelInfoBand.RowLayouts.Add();
            layout.RowLayoutStyle = RowLayoutStyle.ColumnLayout;
            layout.RowLayoutLabelStyle = RowLayoutLabelStyle.WithCellData;
            
            RowLayoutColumnInfo rootIdColumnInfo = layout.ColumnInfos["RootID"];
            rootIdColumnInfo.Column.Hidden = true;

            RowLayoutColumnInfo spacerColumnInfo = layout.ColumnInfo

Parents Reply Children