国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
VB.NET版的GridView經(jīng)典使用(編輯,刪除,分頁(yè),鏈接列)
 
 Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load
        
If Not IsPostBack Then
            binddata()
        
End If

    
End Sub

    
Public Sub binddata()
    
'

    End Sub

    
'編輯中

    Protected Sub GridView1_RowEditing(ByVal sender As ObjectByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridView1.RowEditing
        GridView1.EditIndex 
= e.NewEditIndex
        
'當(dāng)前編輯行背景色高亮
        GridView1.EditRowStyle.BackColor = Color.FromName("#F7CE90")
        binddata()

    
End Sub

    
'分頁(yè)
    Protected Sub GridView1_PageIndexChanging(ByVal sender As ObjectByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles GridView1.PageIndexChanging
        GridView1.PageIndex 
= e.NewPageIndex
        binddata() 
'重新綁定GridView數(shù)據(jù)的函數(shù)
    End Sub

    
'更新
    Protected Sub GridView1_RowUpdating(ByVal sender As ObjectByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating
        
Dim clsB As New sqlDLTP.business
        
Dim sqlstr As String
        
Dim ds As New DataSet
        sqlstr 
= "select hbdwno from etsshbd where hbdcnm='" & CType(GridView1.Rows(e.RowIndex).FindControl("TextBox1"), TextBox).Text.ToString().Trim() & "'"
        ds 
= clsB.queryitems(sqlstr)
        
Dim wno As String = ds.Tables(0).Rows(0)(0).ToString().Trim()

        sqlstr 
= "update etsdl set okscore1='" & _
        
CType(GridView1.Rows(e.RowIndex).FindControl("TextBox6"), TextBox).Text.ToString().Trim() & "',okscore2='" & _
        
CType(GridView1.Rows(e.RowIndex).FindControl("TextBox7"), TextBox).Text.ToString().Trim() & "',okscore='" & _
        
CType(GridView1.Rows(e.RowIndex).FindControl("TextBox8"), TextBox).Text.ToString().Trim() & "',okreport='" & _
        
CType(GridView1.Rows(e.RowIndex).FindControl("TextBox9"), TextBox).Text.ToString().Trim() & "',okgrad='" & _
        
CType(GridView1.Rows(e.RowIndex).FindControl("TextBox10"), TextBox).Text.ToString().Trim() & "',memo='" & _
        
CType(GridView1.Rows(e.RowIndex).FindControl("TextBox12"), TextBox).Text.ToString().Trim() & "' where trano='" & _
        GridView1.DataKeys(e.RowIndex).Value.ToString() 
& "' and wno='" & wno & "'"
        clsB.ExeSqlCmd(sqlstr)
        GridView1.EditIndex 
= -1
        binddata()
    
End Sub

    
'取消
    Protected Sub GridView1_RowCancelingEdit(ByVal sender As ObjectByVal e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GridView1.RowCancelingEdit
        GridView1.EditIndex 
= -1
        binddata()
    
End Sub

    
'刪除
    Protected Sub GridView1_RowDeleting(ByVal sender As ObjectByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GridView1.RowDeleting
        
Dim clsB As New sqlDLTP.business
        
Dim sqlstr As String
        
Dim ds As New DataSet
        sqlstr 
= "select hbdwno from etsshbd where hbdcnm='" & CType(GridView1.Rows(e.RowIndex).FindControl("Label1"), Label).Text.ToString().Trim() & "'"
        ds 
= clsB.queryitems(sqlstr)
        
Dim wno As String = ds.Tables(0).Rows(0)(0).ToString().Trim()

        sqlstr 
= "delete etsdl where trano=" & GridView1.DataKeys(e.RowIndex).Value.ToString().Trim() & "and wno='" & wno & "'"
        clsB.ExeSqlCmd(sqlstr)
        binddata()
    
End Sub

    
'綁定行,特效及鏈接列屬性分配等
    Protected Sub GridView1_RowDataBound(ByVal sender As ObjectByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
        
If e.Row.RowType = DataControlRowType.DataRow Then

            
'鼠標(biāo)經(jīng)過(guò)時(shí),行背景色變 
            e.Row.Attributes.Add("onmouseover""this.style.backgroundColor='#E6F5FA'")
            
'鼠標(biāo)移出時(shí),行背景色變 
            e.Row.Attributes.Add("onmouseout""this.style.backgroundColor='#FFFFFF'")
            
' HyperLink列給鏈接值
            CType(e.Row.Cells(1).FindControl("HyperLink1"), HyperLink).NavigateUrl = "javascript:void window.open('trashow.aspx?tno=" + CType(e.Row.Cells(1).FindControl("HyperLink1"), HyperLink).Text + "','', 'left='+(window.top.screen.width-454)/2+',top='+(window.top.screen.height-454)/2+',width=625,height=500,scrollbars=yes,resizeable=yes');"
            
'當(dāng)有編輯列時(shí),避免出錯(cuò),要加的RowState判斷 
            If e.Row.RowState = DataControlRowState.Normal Or e.Row.RowState = DataControlRowState.Alternate Then

                
If CType(e.Row.Cells(12).FindControl("Label11"), Label).Text = "1" Then
                    
CType(e.Row.Cells(12).FindControl("Label11"), Label).Text = "在職"
                
End If
            
End If
        
End If
    
End Sub
    


前臺(tái):
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width=100% BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1" GridLines="None" AllowPaging="True" AllowSorting="True">
 
<!-- 
 
-->
</asp:GridView>
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
GridView+FormView 示范數(shù)據(jù) 新增/修改/刪除
ASP.NET2.0下含有DropDownList的GridView編輯、刪除的完整例子!...
DataKeyNames 屬性指定表示數(shù)據(jù)源主鍵的字段
GRIDVIEW后臺(tái)綁定數(shù)據(jù)源問(wèn)題
asp.net讀取GridView中某行或某單元格值
GridView中選中,編輯,取消,刪除操作?
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服