自动居中标题和内容;aspxgridview允许定义两个关键字为主键的格式
Posted 挣脱生命的束缚...
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了自动居中标题和内容;aspxgridview允许定义两个关键字为主键的格式相关的知识,希望对你有一定的参考价值。
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允许定义两个关键字为主键的格式的主要内容,如果未能解决你的问题,请参考以下文章