自動改變列寬

sometimes we need the columns width changed when the text withs chaging

we             

 this.gridView.OptionsMenu.EnableColumnMenu = true;//與下面CalcColumnBestWidth使得列寬可以動態變化

            for (int i = 0; i < ds.Tables[0].Columns.Count; i++)
            {
                this.gridView.Columns[i].Width = this.gridView.CalcColumnBestWidth(this.gridView.Columns[i]) + 5;
               }

發佈了14 篇原創文章 · 獲贊 12 · 訪問量 12萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章