标签: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