Schedule Column width formatting

Schedule Column width formatting

d3mk0
Observer Observer
2,455 Views
1 Reply
Message 1 of 2

Schedule Column width formatting

d3mk0
Observer
Observer

I am automating the generation of schedules. Some times the contents of a schedule cell is longer than the actual column width. I would like to automate the resizing of the column width. I cannot find in the API where you can edit the column width. This is not a schedule which has been placed on a sheet. I have attached two images which one illustrates how the schedule is generated. and the second image I have manually widened the column to illustrate what I would like to automate. I cannot find any where in the api which would allow me to do this. Does anyone know if this is possible. 

 

 

 

0 Likes
2,456 Views
1 Reply
Reply (1)
Message 2 of 2

FAIR59
Advisor
Advisor

ViewSchedule myView = doc.ActiveView as ViewSchedule;

for (int i = 0; i < myView.Definition.GetFieldCount(); i++)

{

ScheduleField _field = myView.Definition.GetField(i);

 

// set GridColumnWidth     _field .GridColumnWidth =

// set SheetColumnWidth    _field .SheetColumnWidth =

}