public class Ticket
    {
        public bool Selected { get; set; }
        public string TicketID { get; set; }
        public List<TicketHistory> History {get;set;}
    }

    public class TicketHistory
    {
            public string Status {get;set;}
    }

I have an Infragistics ultragrid with multi bands.

ultragrid.DisplayLayout.ViewStyle = ViewStyle.MultiBand;

ultragrid is bound to a List of Ticket (1st band) 2nd band is History with a List of TicketHistory

The problem is that the column Status from the 2nd band is shown with the same size as Selected column (checkbox column) from 1st band. How can I change the width of the column (Status) from the child band?

1. I tried to change the width in the InitializeLayout handler but it didnt work.

2. I tried PerformAutoresize on ultragridcolumn and didnt work.

有帮助吗?

解决方案

You should set the property AllowColSizing to AllowColSizing.Free

You can set this property using the UltraGrid Designer or in code using this line:

grid.DisplayLayout.Override.AllowColSizing = 
                   Infragistics.Win.UltraWinGrid.AllowColSizing.Free;

This will give to each child band in your grid the ability to resize its columns indipendently from the size of the column in the corresponding position on the parent band.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top