SharePoint DevelopmentProgramming and development for SharePoint Portal Server and Windows SharePoint Services
Welcome to the p2p.wrox.com Forums.
You are currently viewing the SharePoint Development section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
Dim tf1 As TemplateField = New TemplateField
tf1.HeaderText = "Account Status"
tf1.ItemTemplate = New GridViewTemplate(DataControlRowType.DataRow, "isDisabled")
oGrid.Columns.Add(tf1)
....
End Sub
Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements ITemplate.InstantiateIn
Select Case templateType
Case DataControlRowType.DataRow
Dim cb As CheckBox = New CheckBox
cb.ID = "cbStatus"
cb.AutoPostBack = True
cb.EnableViewState = True
AddHandler cb.DataBinding, AddressOf BindCheckBox
AddHandler cb.CheckedChanged, New EventHandler(AddressOf CheckedChanged)
container.Controls.Add(cb)
End Select
End Sub
Public Sub CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim data As New AdminParentAcctData(GetConnectionString())
Dim StudentId As String = String.Empty
Dim stdnt As New Student(GetConnectionString())
Dim cb As CheckBox = CType(sender, CheckBox)
Dim row As GridViewRow = CType(cb.NamingContainer, GridViewRow)
If cb.Checked = True Then
Dim username As String = CType(row.Cells(2).Text, String)
data.updatePermissions(username, Id)
End If
End Sub