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
1871
UltraGridColumn insert is not working after upgrade to v8.3.20083.2039
posted

After upgrading to v8.3.20083.2039 my ultra grid will no longer insert my column. Before the upgrade this code sample worked great now I get a NullReferenceException "Object reference not set to an instance of an object."  Source="Infragistics2.Win.UltraWinGrid.v8.3" on every col.Header.VisiblePosition.

        private void setUnboundLocationColumns(UltraGridLayout LocGridLayout)
        {
            if (!LocGridLayout.Bands[0].Columns.Exists("MainLocation"))
            {
                UltraGridColumn col = LocGridLayout.Bands[0].Columns.Insert(2, "MainLocation");
                col.Header.Caption = "Main Location for";
                col.Header.VisiblePosition = 0;
            }
            if (!LocGridLayout.Bands[0].Columns.Exists("Company"))
            {
                UltraGridColumn col = LocGridLayout.Bands[0].Columns.Insert(3, "Company");
                col.Header.Caption = "Company";
                col.Header.VisiblePosition = 1;
                col.Hidden = true;
            }
            if (!LocGridLayout.Bands[0].Columns.Exists("AcctNumber"))
            {
                UltraGridColumn col = LocGridLayout.Bands[0].Columns.Insert(4, "AcctNumber");
                col.Header.Caption = "Account #";
                col.Header.VisiblePosition = 2;
                col.Hidden = true;
            }
        }

Any help in explaining why this is no longer a valid way to insert columns would be very appreciated. Thank you.