【问题标题】:Hide linkbutton in Datagrid templatecolumn for the first row only仅在第一行隐藏 Datagrid 模板列中的链接按钮
【发布时间】:2013-05-02 19:59:57
【问题描述】:

我试图仅在第一行隐藏数据网格中的“删除”链接按钮,但想在其余行中显示“删除”链接按钮按钮。我怎样才能做到这一点,非常感谢任何帮助。

【问题讨论】:

    标签: datagrid hide linkbutton datagridtemplatecolumn itemdatabound


    【解决方案1】:

    找到了解决办法。

    Private Sub dgRolloverInformation_ItemDataBound(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgRolloverInformation.ItemDataBound
                'Hide "Delete" button for the first row in the RolloverInformation Datagrid
                If (e.Item.ItemIndex = 0) Then
                    Dim btnDelete As LinkButton = CType(e.Item.Cells(4).FindControl("lnkbtnDelete"), LinkButton)
                    btnDelete.Visible = False
                End If
            End Sub
    

    【讨论】:

      猜你喜欢
      • 2015-01-19
      • 1970-01-01
      • 2011-12-03
      • 1970-01-01
      • 2014-01-23
      • 1970-01-01
      • 2012-12-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多