protected void DeluxeGridPost_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { WfPost post = (WfPost)e.Row.DataItem; HtmlAnchor editItem = (HtmlAnchor)e.Row.FindControl("LinkBtnEdit"); editItem.Attributes.Add("onclick", "onCreateOrUpdateClick('" + post.PostID + "')"); LinkButton delItem = (LinkButton)e.Row.FindControl("LinkBtnDel"); delItem.CommandArgument = post.PostID; delItem.OnClientClick = "return window.confirm('确认要删除吗?');"; #region 格式化数据 e.Row.Cells[3].Text = post.CreateTime.ToString("yyyy-MM-dd"); #endregion } }
protected void NewPostRequest() { whereCondition.Value = "1=2"; Data = new WfPost(); Data.PostID = string.Empty; }