添加控制previous /权在asp.net gridview的下一个寻呼机 [英] Add control to right of previous/next of pager in asp.net gridview

查看:163
本文介绍了添加控制previous /权在asp.net gridview的下一个寻呼机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想一个按钮控件添加到previous / asp.net中gridview的下一个寻呼机的权利。
我试着在这个网站的例子来工作,但我需要保持previous /旁边,并把按钮底部页导航行权。

起初,我有一个小的(5像素),它在一个单元格显示,然后经过无数次的尝试等,在现在甚至没有出现。

我如何对齐按钮向右,同时保持生成gridview的下一个/ previous按钮。

感谢

 私人小组grdClientServiceType_RowCreated(BYVAL发件人为对象,BYVAL E上System.Web.UI.WebControls.GridViewRowEventArgs)处理grdClientServiceType.RowCreated
    选择案例e.Row.RowType
        案例DataControlRowType.Pager            昏暗的空间作为新LiteralControl()
            昏暗span1作为新标签
            'span1.Text =
            span1.Style(利润率左)=50像素
            昏暗的对接作为新按钮
            'butt.ID =buttShowAvail
            butt.BackColor = Drawing.Color.Purple
            butt.ForeColor = Drawing.Color.White
            butt.Font.Bold = TRUE
            'butt.ToolTip =点击选择有效的时间。
            '点心表如表= TryCast(e.Row.Cells(0).Controls(0),数据表)
            昏暗parentCell作为的TableCell = table.Rows(0).Cells(table.Rows(0).Cells.Count - 1)
            昏暗W¯¯作为整数= parentCell.Width.Value            'parentCell.Controls.Add(空间)
            parentCell.Controls.Add(对接)            昏暗的对接作为新按钮
            butt.ID =buttShowAvail
            butt.BackColor = Drawing.Color.Purple
            butt.ForeColor = Drawing.Color.White
            butt.Font.Bold = TRUE
            butt.ToolTip =点击选择有效的时间。            AddHandler的butt.Click,AddressOf buttShowAvail_Click
            e.Row.Cells(0).ColumnSpan - = 1
            昏暗的TD作为新的TableCell
            昏暗span1作为新标签
            span1.Text =秀
            span1.Style(利润率左)=10px的
            td.Controls.Add(span1)
            td.Controls.Add(对接)
            昏暗SPAN2作为新标签
            span2.Text =每页行
            td.Controls.Add(SPAN2)
            e.Row.Cells.Add(TD)    结束选择结束小组


解决方案

我终于想通了,多亏了这个网站。我只需要改变一些东西来得到这个工作。结果
解决的办法是低于...

 私人小组grdClientServiceType_RowCreated(BYVAL发件人为对象,BYVAL E上System.Web.UI.WebControls.GridViewRowEventArgs)处理grdClientServiceType.RowCreated
    选择案例e.Row.RowType
        案例DataControlRowType.Pager            昏暗的对接作为新按钮
            butt.ID =buttShowAvail
            butt.BackColor = Drawing.Color.Purple
            butt.ForeColor = Drawing.Color.White
            butt.Font.Bold = TRUE
            butt.ToolTip =点击选择有效的时间。
            butt.Width =220
            butt.Height =40
            butt.Text =显示可用性
            butt.Font.Size =11            AddHandler的butt.Click,AddressOf buttShowAvail_Click
            e.Row.Cells(0).ColumnSpan - = 1
            昏暗的TD作为新的TableCell
            td.Controls.Add(对接)
            e.Row.Cells.Add(TD)    结束选择结束小组

I am trying to add a button control to right of the previous/next of pager in asp.net gridview. I've tried to work with examples on this site, but I need to keep the previous/next and put the button to the right of the bottom pager row.

At first I got a small (5px) it to show in the next cell, then after numerous other attempts, in now doesn't even appear.

How do I align a button to the right while keeping gridview generated next/previous buttons.

Thanks

    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

解决方案

I finally figured it out, thanks to this site. I just need to change a few things to get this to work.
The solution is below...

    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

这篇关于添加控制previous /权在asp.net gridview的下一个寻呼机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆