如何在RowCommand事件中找到footer的gridview值?

时间:2013-11-25 06:54:50

标签: vb.net gridview

我想在RowCommand中找到vb.net事件的页脚值?

我在RowCreated上分配页脚的值运行时间。

e.Row.Cells(2).Text = FOOTERVALUE
e.Row.Cells(1).Text = "Total Subjects"

此页脚适用于Parent Grid。我正在使用嵌套的gridview。

2 个答案:

答案 0 :(得分:0)

 Protected Sub Gridview1RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles Gridview1.RowCommand   
     Dim Lblcolval = CType(dgrd_WWWH.FooterRow.FindControl("yourcolumn") ,Label)
 End Sub

Protected Sub Gridview1_How_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles Gridview1.RowDataBound
  If e.Row.RowType And DataControlRowType.Footer Or (e.Row.RowState And DataControlRowState.Edit) > 0 Then
  Dim ddlresp As DropDownList = CType(e.Row.FindControl("ddlResp"), DropDownList)
  SrchWhoBind(ddlresp)
  ddlresp.SelectedValue = Convert.ToInt32(Session("Uname"))
  End If
End Sub

答案 1 :(得分:0)

我得到了解决方案,只需要在rowDataBound而不是rowCreated中编写代码。

相关问题