DataGrid双击行事件

 <asp:datagrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 40px" runat="server"
     BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" BackColor="#DEBA84" CellPadding="0"
     Width="272px">
     <SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#738A9C"></SelectedItemStyle>
     <ItemStyle ForeColor="#8C4510" BackColor="#FFF7E7"></ItemStyle>
     <HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#A55129"></HeaderStyle>
     <FooterStyle ForeColor="#8C4510" BackColor="#F7DFB5"></FooterStyle>
     <PagerStyle HorizontalAlign="Center" ForeColor="#8C4510" Mode="NumericPages"></PagerStyle>
    </asp:datagrid>
    <DIV style="DISPLAY: inline; Z-INDEX: 104; LEFT: 168px; WIDTH: 24px; POSITION: absolute; TOP: 360px; HEIGHT: 16px"
     ms_positioning="FlowLayout">ÐÐ</DIV>
    <INPUT id="Hidden1" style="Z-INDEX: 102; LEFT: 8px; POSITION: absolute; TOP: 8px" type="hidden"
     name="Hidden1" runat="server"></FONT>
   <asp:TextBox id="TextBox1" style="Z-INDEX: 103; LEFT: 128px; POSITION: absolute; TOP: 360px"
    runat="server" Width="32px"></asp:TextBox>
   <asp:Label id="Label1" style="Z-INDEX: 105; LEFT: 40px; POSITION: absolute; TOP: 360px" runat="server">ÄúË«»÷Á˵Ú</asp:Label>

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not IsPostBack Then
            Dim d As New Data
            DataGrid1.DataSource = d.getTable
            DataGrid1.DataBind()

        End If
        If Not Request.Form("hidden1") Is Nothing Then
            TextBox1.Text = Request.Form("hidden1").ToString
        End If
    End Sub

    Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemDataBound
        If e.Item.ItemType <> ListItemType.Header And e.Item.ItemType <> ListItemType.Footer Then
            'Response.Write(Color.Beige.ToString())
            'e.Item.Attributes("id") = e.Item.ItemType.ToString() e.Item.ItemIndex.ToString()
            e.Item.Attributes.Add("OnMouseOut", "this.style.backgroundColor='#FFF7E7';this.style.color='#8C4510'")
            e.Item.Attributes.Add("OnMouseOver", "this.style.backgroundColor='#A55129';this.style.color='white';this.style.cursor='hand';")
            e.Item.Attributes.Add("Ondblclick", "javascript:setv(" e.Item.Cells(0).Text ")")
        End If
    End Sub
End Class

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值