FarPoint Spread 데이터와 헤더라벨을 고려한 컬럼너비 자동조정

Published Nov 12, 2010 | Updated Sep 22, 2022 | 0 comments

/// <summary>
/// 스프레드 컬럼별 너비를 자동조절(헤더 라벨 고려)
/// 2010-11-12 By KKOMZI : Multi Row Header 고려
/// </summary>
/// <param name="fpSheet"></param>
/// <param name="pExtWidth">추가로 확장시킬 너비</param>
public static void SetResizeColALL(SheetView fpSheet, int pExtWidth = 10)
{
	int _headerRowCount = fpSheet.ColumnHeader.RowCount;
	fpSheet.RowCount += _headerRowCount;
	int _tmpIndex = 0;
	for (int rowIdx = 0; rowIdx < _headerRowCount; rowIdx++)
	{
		_tmpIndex = fpSheet.RowCount - rowIdx - 1;
		fpSheet.Rows[_tmpIndex].CellType = new GeneralCellType();
		for (int colIdx = 0; colIdx < fpSheet.ColumnCount; colIdx++)
		{
			//     fpSheet.SetValue(_tmpIndex, colIdx, fpSheet.Columns[colIdx].Label);
			fpSheet.SetValue(_tmpIndex, colIdx, fpSheet.ColumnHeader.Cells.Get(rowIdx, colIdx).Value);
		}
	}
	for (int k = 0; k < fpSheet.Columns.Count; k++)
	{
		fpSheet.Columns[k].Width = 0;
		fpSheet.Columns[k].Width = Math.Max(fpSheet.ColumnHeader.Columns[k].GetPreferredWidth(), fpSheet.Columns[k].GetPreferredWidth()) + pExtWidth;
		//    fpSheet.Columns[k].ColWidth = fpSheet.GetPreferredColumnWidth(k, true, true, true);
	}
	fpSheet.RowCount -= _headerRowCount;
}

TAG INFORMATION

Learn more on this topic

Related Blog Posts

Join in the conversation

Leave a Comment

0 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

무료 온라인 전광판

전광판

텍스트를 입력하고 텍스트 효과 및 배경효과 를 변경해서 전체화면으로 표시할 수 있는 전광판 용도로 사용하실 수 있습니다. 각종 스포츠 및 공연 관람시 응원 용도로 사용이 가능합니다.

Carousel

여러개의 슬라이드를 추가하여 프레젠테이션 및 이미지 슬라이드 용도로 사용하실 수 있습니다. 브라우저가 포함된 IT 기기로 큰 모니터에 연결하여 매장 내 공지사항 및 메뉴소개를 이미지로 표시할 수 있습니다.

Pin It on Pinterest

Shares
Share This

Share This

Share this post with your friends!

Shares