'FarpointSpread'에 해당되는 글 4건

  1. 2009.02.20 Paging 할때 제일 마지막 페이지 꽉차 보이는 버그 대책!
FarpointSpread2009. 2. 20. 15:03


만약 페이지 크기를 30개로 잡아놓고
70개짜리 데이터를 바인딩하면
마지막 3페이지에 10개만 나와야 하는데도 불구하고
앞페이지에서 20개를 가지고 와서
30개를 맞춘후 보여준다.
그렇다! 버그다.
이걸 수정하기 위해
fpList_PreRender 이벤트를 등록하고
이 안에
fpList.Sheets[0].TopRow 를 세팅한다.

보너스로 2페이지 이상에서 포스트백후 Row 포커스가 제일 위로 올라가는걸 강제로 막음!!!

다음과 같이 하면 수정된다. 이거 한다고 욕봤다~


// Page 마지막 페이지에서 제대로 나오게 하기 위해!
        protected void fpList_PreRender(object sender, EventArgs e)
        {
            int iRow = fpList.Sheets[0].ActiveRow;

            // 페이징 (2페이지 이상)한 상태에서 클릭후 포커스가 Row Top으로 이동하는거 강제로 막음!
            if (fpList.CurrentPage != 0)
            {
                fpList.Sheets[0].ActiveRow = iRow + (fpList.CurrentPage * fpList.Sheets[0].PageSize);
            }

            if (fpList.Sheets[0].TopRow % fpList.Sheets[0].PageSize != 0)
            {
                fpList.Sheets[0].TopRow = fpList.Sheets[0].PageSize * fpList.CurrentPage;
            }
        }


 
Posted by 댓거리사랑