码迷,mamicode.com
首页 > Web开发 > 详细

自动居中标题和内容;aspxgridview允许定义两个关键字为主键的格式

时间:2019-11-28 11:48:24      阅读:81      评论:0      收藏:0      [点我收藏+]

标签:GridView   ast   his   val   data   sel   通用   asp   headers   

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class dma_jh1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
   
    //通用版居中
    protected void ASPxGridView_Loadcomm(object sender, EventArgs e)
    {
        DevExpress.Web.ASPxGridView agv = (DevExpress.Web.ASPxGridView)sender;

        foreach (DevExpress.Web.GridViewColumn col in agv.Columns)
        {
            col.CellStyle.HorizontalAlign = HorizontalAlign.Center;
            col.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
        }
              
    }

    //专业表
    protected void ASPxGridView_zy_BeforePerformDataSelect(object sender, EventArgs e)
    {
        this.Session["myxy"] = (sender as DevExpress.Web.ASPxGridView).GetMasterRowKeyValue();
    }
    protected void ASPxGridView_zy_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
    {
        e.NewValues["学院"] = this.Session["myxy"].ToString().Trim();
    }
    protected void ASPxGridView_zy_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        
    }

技术图片

 

自动居中标题和内容;aspxgridview允许定义两个关键字为主键的格式

标签:GridView   ast   his   val   data   sel   通用   asp   headers   

原文地址:https://www.cnblogs.com/qqhfeng/p/11948850.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!