WinGrid 的Band Appearance(外观)设置调整(一)

using  System;
using  System.Drawing;
using  System.Collections;
using  System.ComponentModel;
using  System.Windows.Forms;
using  TestInfragistics.DAL;

using   Infragistics.Win;
using  Infragistics.Win.UltraWinGrid;

namespace  TestInfragistics.UIL
{
    
/// <summary>
    
/// BandAppearance 的摘要说明。
    
/// </summary>

    public class BandAppearance : System.Windows.Forms.Form
    
{
        
private Infragistics.Win.UltraWinGrid.UltraGrid ultraGrid1;
        
internal System.Windows.Forms.Button SetColorOfBandHeaders;
        
internal System.Windows.Forms.Button RemoveExpansionIndicators;
        
internal System.Windows.Forms.Button MakeBandHeadersVisible;
        
internal System.Windows.Forms.Button AllowColSizingFree;
        
/// <summary>
        
/// 必需的设计器变量。
        
/// </summary>

        private System.ComponentModel.Container components = null;

        
public BandAppearance()
        
{
            
//
            
// Windows 窗体设计器支持所必需的
            
//
            InitializeComponent();

            
//
            
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            
//
        }


        
/// <summary>
        
/// 清理所有正在使用的资源。
        
/// </summary>

        protected override void Dispose( bool disposing )
        
{
            
if( disposing )
            
{
                
if(components != null)
                
{
                    components.Dispose();
                }

            }

            
base.Dispose( disposing );
        }


        
Windows 窗体设计器生成的代码

        
private void BandAppearance_Load(object sender, System.EventArgs e)
        
{
            CustOrderDataSet cust 
= new CustOrderDataSet();
            ultraGrid1.DataSource 
= cust.MakeCustOrderDataSet();
        }


        
private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
        
{
            
if(e.Row.Band.Index ==0 )
            
{
                e.Row.Expanded 
=true;
            }

        }


        
private void AllowColSizingFree_Click(object sender, System.EventArgs e)
        
{
            ultraGrid1.DisplayLayout.Override.AllowColSizing 
= AllowColSizing.Free;
        }


        
private void MakeBandHeadersVisible_Click(object sender, System.EventArgs e)
        
{
            ultraGrid1.DisplayLayout.Bands[
0].HeaderVisible = true;
            ultraGrid1.DisplayLayout.Bands[
1].HeaderVisible = true;
            ultraGrid1.DisplayLayout.Bands[
1].Header.Caption ="dddddddddddddddddd";
        }


        
private void SetColorOfBandHeaders_Click(object sender, System.EventArgs e)
        
{
            AppearanceBase app 
=    ultraGrid1.DisplayLayout.Bands[0].Header.Appearance;
            app.ThemedElementAlpha 
= Alpha.Transparent;
            app.BackColor 
= SystemColors.ActiveCaption;
            app.ForeColor 
= SystemColors.ActiveCaptionText;

            app 
= ultraGrid1.DisplayLayout.Bands[1].Header.Appearance;
            app.ThemedElementAlpha 
= Alpha.Transparent;
            app.BackColor 
= Color.Blue;
            app.BackColor2 
= Color.Red;
            app.ForeColor 
= Color.White;
            app.BackGradientStyle 
= GradientStyle.Horizontal;
        }


        
private void RemoveExpansionIndicators_Click(object sender, System.EventArgs e)
        
{
            ultraGrid1.DisplayLayout.Bands[
0].Indentation =0;
            ultraGrid1.DisplayLayout.Bands[
1].Indentation =0;
            ultraGrid1.DisplayLayout.RowConnectorStyle 
= RowConnectorStyle.None;


        }

    }

}

 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值