GridControl Find/Clear 添加图标

 1   public static void ControlFind(GridControl grid)
 2         {
 3             FindControl fControl = null;
 4             foreach (Control item in grid.Controls)
 5             {
 6                 fControl = item as FindControl;
 7                 if (fControl != null) break;
 8             }
 9             if(fControl != null)
10             {
11                 fControl.FindButton.Image =
12                     global ::YHBJ.Student.LearingAndTest.UI.Properties.Resources.Search;
13                 fControl.ClearButton.Image =
14                     global::YHBJ.Student.LearingAndTest.UI.Properties.Resources.Close_16x16;
15                 fControl.CalcButtonsBestFit();
16             }
17         }

注意调用的时候 要放在Load中. 初始数据加载完成之后.

1  private void ResultInput2_Load(object sender, EventArgs e)
2 {
3             GetGridViewList();
4             this.gridControl1.ForceInitialize();
5             Common.DXControl.ControlFind(this.gridControl1);
6 }

 

posted @ 2014-08-21 15:41  刘彬  阅读(758)  评论(0编辑  收藏  举报