#region 自定义表格
//初始化测斜分析数据表
BandedGridView view = advBandedGridView1 as BandedGridView; view.BeginUpdate();
view.BeginDataUpdate(); view.Bands.Clear(); //初始化测斜录入数据表
//表格属性修改 //添加列标题 //列标题对其方式 //修改附加选项
gridControl1.Dock = DockStyle.Fill;
view.OptionsBehavior.AllowPixelScrolling = DevExpress.Utils.DefaultBoolean.True;
view.OptionsView.ShowColumnHeaders = false; //因为有Band列了,所以把ColumnHeader隐藏
view.OptionsView.ShowGroupPanel = false; //如果没必要分组,就把它去掉
view.OptionsView.EnableAppearanceEvenRow = false; //是否启用偶数行外观
view.OptionsView.EnableAppearanceOddRow = true; //是否启用奇数行外观
view.OptionsView.ShowIndicator = false;
view.OptionsView.ColumnAutoWidth = true; //是否是列宽度自适应窗体宽度
view.OptionsView.ShowFilterPanelMode = ShowFilterPanelMode.Never; //是否显示过滤面板
view.OptionsCustomization.AllowColumnMoving = false; //是否允许移动列
view.OptionsCustomization.AllowColumnResizing = false; //是否允许调整列宽
view.OptionsCustomization.AllowGroup = false; //是否允许分组
view.OptionsCustomization.AllowFilter = false; //是否允许过滤
view.OptionsCustomization.AllowSort = true; //是否允许排序
view.OptionsSelection.EnableAppearanceFocusedCell = true; //是否焦点显示选中的单元格
view.OptionsBehavior.Editable = false; //是否允许用户编辑单元格 //添加列标题
GridBand Deviation = view.Bands.AddBand("井斜(deg)");
GridBand MaxDeviation = Deviation.Children.AddBand("最大井斜");
GridBand DepthOfMaxDeviation = Deviation.Children.AddBand("所在井深(m)");
GridBand Azimuth = view.Bands.AddBand("方位(deg)");
GridBand MaxAzimuth = Azimuth.Children.AddBand("最大方位");
GridBand DepthOfMaxAzimuth = Azimuth.Children.AddBand("所在井深(m)");
GridBand DoglegAngle = view.Bands.AddBand("狗腿度(deg)");
GridBand MaxDoglegAngle = DoglegAngle.Children.AddBand("最大狗腿度");
GridBand DepthOfMaxDoglegAngle = DoglegAngle.Children.AddBand("所在井深(m)"); //列标题对其方式
Deviation.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
MaxDeviation.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
DepthOfMaxDeviation.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
Azimuth.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
MaxAzimuth.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
DepthOfMaxAzimuth.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
DoglegAngle.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
MaxDoglegAngle.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
DepthOfMaxDoglegAngle.AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; view.EndDataUpdate();
view.EndUpdate();
#endregion