gpt4 book ai didi

asp.net - 在asp.net gridview中将控件添加到寻呼机的上一个/下一个的右侧

转载 作者:行者123 更新时间:2023-12-04 18:20:19 26 4
gpt4 key购买 nike

我正在尝试在 asp.net gridview 的上一个/下一个寻呼机的右侧添加一个按钮控件。
我曾尝试使用此站点上的示例,但我需要保留上一个/下一个并将按钮放在寻呼机底部行的右侧。

起初我在下一个单元格中显示了一个小(5px)它,然后经过多次其他尝试,现在甚至没有出现。

如何在保持 gridview 生成的下一个/上一个按钮的同时将按钮向右对齐。

谢谢

    Private Sub grdClientServiceType_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdClientServiceType.RowCreated
Select Case e.Row.RowType
Case DataControlRowType.Pager

'Dim space As New LiteralControl(" ")
'Dim span1 As New Label
'span1.Text = " "
'span1.Style("margin-left") = "50px"


'Dim butt As New Button
'butt.ID = "buttShowAvail"
'butt.BackColor = Drawing.Color.Purple
'butt.ForeColor = Drawing.Color.White
'butt.Font.Bold = True
'butt.ToolTip = "Click for a selection of times available."


'Dim table As Table = TryCast(e.Row.Cells(0).Controls(0), Table)
'Dim parentCell As TableCell = table.Rows(0).Cells(table.Rows(0).Cells.Count - 1)
'Dim w As Integer = parentCell.Width.Value

'parentCell.Controls.Add(space)
'parentCell.Controls.Add(butt)





Dim butt As New Button
butt.ID = "buttShowAvail"
butt.BackColor = Drawing.Color.Purple
butt.ForeColor = Drawing.Color.White
butt.Font.Bold = True
butt.ToolTip = "Click for a selection of times available."

AddHandler butt.Click, AddressOf buttShowAvail_Click
e.Row.Cells(0).ColumnSpan -= 1
Dim td As New TableCell
Dim span1 As New Label
span1.Text = "Show"
span1.Style("margin-left") = "10px"
td.Controls.Add(span1)
td.Controls.Add(butt)
Dim span2 As New Label
span2.Text = "rows per page"
td.Controls.Add(span2)
e.Row.Cells.Add(td)

End Select

End Sub

最佳答案

我终于弄明白了,感谢这个网站。我只需要改变一些事情来让它工作。
解决方案如下...

    Private Sub grdClientServiceType_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles grdClientServiceType.RowCreated
Select Case e.Row.RowType
Case DataControlRowType.Pager

Dim butt As New Button
butt.ID = "buttShowAvail"
butt.BackColor = Drawing.Color.Purple
butt.ForeColor = Drawing.Color.White
butt.Font.Bold = True
butt.ToolTip = "Click for a selection of times available."
butt.Width = "220"
butt.Height = "40"
butt.Text = "Show Availability"
butt.Font.Size = "11"

AddHandler butt.Click, AddressOf buttShowAvail_Click
e.Row.Cells(0).ColumnSpan -= 1
Dim td As New TableCell
td.Controls.Add(butt)
e.Row.Cells.Add(td)

End Select

End Sub

关于asp.net - 在asp.net gridview中将控件添加到寻呼机的上一个/下一个的右侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10826235/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com