Datagrid auto scrolls to the end of column

Not Answered This post has 0 verified answers | 4 Replies | 2 Followers Thread's RSS feed.

Mike
Points 45
Replied On: Tue, Aug 8 2017 3:24 PM Reply

Our application has 6 fixed left columns and an array off secondary data columns (scrollable). When viewing the data on an iPhope our grid is always offset to the end of the column causing the label to initially be hidden. (See screenshot for reference) As soon as we slide to reveal the label it is ok, so there is no issue with frames or anything of that nature. 

I have tried to make the gridview auto scroll to a view at position (0,0). I am curious as to what this could be. I have searched cell properties and grid properties to try and find something dealing with justification or cell alignment. Any help is much appreciated! 


  • Post Points: 20

All Replies

Stephen Zaharuk
Points 40,030
Infragistics Employee
Replied On: Fri, Aug 11 2017 8:59 AM Reply

Hi Mike!

Hmm.. thats strange. You shouldn't have to do anything.. but yea setting the contentOffset property should work as well. 

I tried reproducing the issue, but didn't have any luck. 

I've attached my sample, can you try it out on your end and see if you can reproduce it?

-SteveZ

  • Post Points: 35
Mike
Points 45
Replied On: Fri, Aug 11 2017 12:00 PM Reply

Thanks Stephen. Ill take a look at the solution and compare mine, before I respond with more questions.

  • Post Points: 5
Mike
Points 45
Replied On: Fri, Aug 11 2017 12:52 PM Reply

Alright so below is the override method me are using to set the width of the column:

        public override IGColumnWidth ResolveColumnWidth(IGGridView gridView, nint column)
        {
            var headerName = _currentlyDisplayedCutupModel.MetadataHeaderValues[(int)column + _fixedLeftColumnsCount];
            if (headerName == null) headerName = string.Empty;
            var columnMetaData = _gridColumnsMetaData.Find((obj) => obj.ProperyName.ToLowerInvariant() == headerName.ToLowerInvariant());
            var columnWidth = 0;
            if (columnMetaData != null) columnWidth = columnMetaData.ColumnWidth; 

            return IGColumnWidth.CreateNumericColumnWidth(columnWidth);
        }

Does this look correct to dynamically set the width of our columns to the length we store of the header String?

  • Post Points: 20
Stephen Zaharuk
Points 40,030
Infragistics Employee
Replied On: Sat, Aug 12 2017 4:53 PM Reply

Hey Mike, 

Yes, thats completely valid.

-SteveZ

  • Post Points: 5
Page 1 of 1 (5 items) | RSS