Click the displayed page of The gridview to modify the current row.

Source: Internet
Author: User

'Protected sub gridview1_rowdatabound1 (byval sender as object, byval e as gridviewroweventargs) handles gridview1.rowdatabound
'If E. Row. rowtype = datacontrolrowtype. datarow then
''E. Row. Attributes. Add ("onclick", "If (document. oldtr! Export null1_document.oldtr.runtimestyle.css text = '{%this.runtimestyle.css text = 'background-color: red'; document. oldtr = This; window. showmodelessdialog ('bb. aspx? Id = "+ E. Row. cells (0). Text + "');")
''E. Row. Attributes. Add ("onclick", "If (document. oldtr! Export null1_document.oldtr.runtimestyle.css text = ''{%this.runtimestyle.css text = 'background-color: Blue'; document. oldtr = This ;")
''Viewstate ("pageindex") = E. Row. cells (0). Text
''Response. Write (viewstate ("pageindex "))
'E. Row. Attributes. Add ("onclick", E. Row. clientid. tostring () + ". Checked = true; selectx (this )")
'End if

'End sub
'Protected sub gridview1_rowdatabound (byval sender as object, byval e as gridviewroweventargs) handles gridview1.rowdatabound
'If E. Row. rowtype = datacontrolrowtype. datarow then
''E. Row. Attributes. Add ("onmouseover", "If (this! = Prevselitem) {This. style. backgroundcolor = E. Row. style. backgroundcolor }")
''Change the background color when the mouse stays
''E. Row. Attributes. Add ("onmouseout", "If (this! = Prevselitem) {This. style. backgroundcolor = E. Row. style. backgroundcolor }")
''The background color is restored when you move the mouse away.
''E. row. attributes. add ("onclick", E. row. clientid. tostring () + ". checked = true; selectx (this); window. showmodelessdialog ('course. aspx? Id = "+ E. Row. cells (0). Text + "');")
'E. Row. Attributes. Add ("onclick", E. Row. clientid. tostring () + ". Checked = true; selectx (this );")
'End if
'End sub

'Protected sub gridview1_rowdatabound (byval sender as object, byval e as gridviewroweventargs) handles gridview1.rowdatabound
''E. Row. Attributes. Add ("onmouseover", "c = This. style. backgroundcolor; this. style. backgroundcolor = '# 95b8ff '")
''E. Row. Attributes. Add ("onmouseout", "This. style. backgroundcolor = C ")
'E. Row. attributes ("style") = "cursor: hand"
'Dim count as integer = gridview1.rows. Count
'Dim ID as string = ""
'For I as integer = 0 to count-1
'Session ("Course") = gridview1.datakeys (I). value. tostring ()
''Session ("Course") = E. Row. cells (I). Text
''Gridview1. Rows (I). Attributes. Add ("onclick", "newwin = Window. Open ('addclass. aspx? Id = "+ ID +" ', 'newwin', 'width = 500, Height = 550 ')")
'Response. Write (Session ("Course "))
'Next
'End sub

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.