Update Checkbox Column in WebGrid

A

Angel

I have placed a ASP.NET Checkbox in my EditItemTemplate for a particular
column.

<EditItemTemplate>
<asp:CheckBox ID="diRejectStatus" Runat="server" Checked='<%#
CheckVal(Container.DataItem("RejectStatus"), "False") %>'>
</asp:CheckBox>
</EditItemTemplate>

When I click the Edit button to edit the record I uncheck the checkbox
column of the record. When I hit the update for the row, I correctly get the
Control for the record in the Update Event for the Grid

Sub dgStatusMapping_UpdateCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
dgStatusMapping.UpdateCommand

Dim chkReject As CheckBox = CType(e.Item.FindControl("diRejectStatus"),
CheckBox)

but when I check the value of the checkbox, it is returning the original
value of the checkbox

If Not chkReject Is Nothing Then
bolRejectStatus = chkReject.Checked
End If

In other words the checkbox Checked Value still has the original value and
not the value I just changed it too.

Does anyone know how I can get the new value of the checkbox without
performing a postback on the page everytime I click the checkbox?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top