在这个例子中,将使用ASPxGridView.InitNewRow事件来初始化带有默认值的新一行字段值。
C#
protected void grid_InitNewRow(object sender, DevExpress.Web.Data.ASPxDataInitNewRowEventArgs e) { e.NewValues["BirthDate"] = new DateTime(1970, 1, 10); e.NewValues["Title"] = "Sales Representative"; }
VB
Protected Sub ASPxGridView1_InitNewRow(ByVal sender As Object,_ ByVal e As DevExpress.Web.Data.ASPxDataInitNewRowEventArgs) Handles ASPxGridView1.InitNewRow e.NewValues("BirthDate") = New DateTime(1970, 1, 10) e.NewValues("Title") = "Sales Representative" End Sub
结果如下:
本站文章除注明转载外,均为本站原创或翻译
欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果
转载请注明:文章转载自:DevExpress控件中文网 [https://www.devexpresscn.com/]
本文地址:https://www.devexpresscn.com/post/407.html
欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果
转载请注明:文章转载自:DevExpress控件中文网 [https://www.devexpresscn.com/]
本文地址:https://www.devexpresscn.com/post/407.html