! 제품 버전을 정확하게 입력해 주세요.
제품 버전이 정확하게 기재되어 있지 않은 경우,
최신 버전을 기준으로 안내 드리므로
더욱 빠르고 명확한 안내를 위해
제품 버전을 정확하게 입력해 주세요!

c1FlexGrid에서 grid 셀의 선 표시 설정 문의 드립니다. > Q&A | 토론

본문 바로가기

WinForms윈폼 c1FlexGrid에서 grid 셀의 선 표시 설정 문의 드립니다.

페이지 정보

작성자 khoon 작성일 2024-01-11 16:46 조회 41회 댓글 1건
제품 버전 : 4.5.20232.611
컨트롤 이름 : c1FlexGrid

본문



안녕하세요?

FlexGrid사용 중입니다. 저 Grid안에 제가 파란선으로 그은 부분은 어떤 옵션으로 색을 보이게 할수 있을까요? 대부분 테마들도 저부분은 다 선이 흐릿하네요.

옵션이 너무 많아서 어떤것을 만져야 할지 모르겠습니다.

순서 칸 처럼 진한 선(특정색 선)으로 표시하고 싶습니다. 감사합니다.

  • 페이스북으로 공유
  • 트위터로  공유
  • 링크 복사
  • 카카오톡으로 보내기

댓글목록

khoon님의 댓글

khoon 작성일

자문자답입니다.
속성->Styles->Normal->Border->Color 값을 바꾸면 되네요. 

1 답변

WinForms윈폼 Re: c1FlexGrid에서 grid 셀의 선 표시 설정 문의 드립니다.

추천0 이 글을 추천하셨습니다 비추천0

페이지 정보

작성자 MESCIUS폴 작성일 2024-01-16 11:41 댓글 0건

본문

첨부파일

안녕하세요 메시어스 입니다.


일반 셀에만 아래쪽 보더만 변경하려면 OwnerDrawCell 이벤트를 사용해서 셀 아래쪽에 보더를 커스터마이즈 할 수 있습니다. 

간단한 코드와 샘플 프로젝트를 전달 드립니다.


        readonly int _borderWeight = 1;

        readonly Color _borderColor = Color.Black;


        public Form1()

        {

            InitializeComponent();


            #region c1flexgrid1 - equal borders in both fixed and normal cells


            c1FlexGrid1.Styles.Normal.Border.Color = c1FlexGrid1.Styles.Fixed.Border.Color;


            #endregion


            #region c1flexgrid2 - extra bold bottom-border in normal cells


            //handle the OwnerDrawCell event for drawing bold borders

            c1FlexGrid2.DrawMode = DrawModeEnum.OwnerDraw;

            c1FlexGrid2.OwnerDrawCell += C1FlexGrid2_OwnerDrawCell;

        }


        private void C1FlexGrid2_OwnerDrawCell(object sender, OwnerDrawCellEventArgs e)

        {

            //if event is fired only for measuring, return

            if (e.Measuring) return;


            //draw the cell background, border and content

            e.DrawCell(DrawCellFlags.All);

            e.Handled = true;


            //manually draw bold bottom-border

            if(e.Col == 1 && e.Row >= c1FlexGrid2.Rows.Fixed)

            {

                var rect = new Rectangle(e.Bounds.X, e.Bounds.Bottom - _borderWeight, e.Bounds.Width, _borderWeight);

                e.Graphics.FillRectangle(new SolidBrush(_borderColor), rect);

            }

        }


감사합니다.

메시어스 드림

댓글목록

등록된 댓글이 없습니다.

메시어스 홈페이지를 통해 제품에 대해서 더 자세히 알아 보세요!
홈페이지 바로가기
메시어스 홈페이지를 통해 제품에 대해서 더 자세히 알아 보세요!
홈페이지 바로가기
이메일 : sales-kor@mescius.com | 전화 : 1670-0583 | 경기도 과천시 과천대로 7길 33, 디테크타워 B동 1107호 메시어스(주) 대표자 : 허경명 | 사업자등록번호 : 123-84-00981 | 통신판매업신고번호 : 2013-경기안양-00331 ⓒ 2024 MESCIUS inc. All rights reserved.