Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a datagrid that has a checkbox column defined:

</asp:TemplateColumn>

<asp:TemplateColumn HeaderText="Email" Visible="True">

<ItemTemplate>

<asp:CheckBox ID="cbEmailed" Runat="server">

</asp:CheckBox>

</ItemTemplate>

 

</asp:TemplateColumn>

 

I have a function (called on page load for testing) to check for the values as changed by the user:

 

For Each dgi In myDataGrid.Items

Dim myCheckbox As CheckBox = CType(dgi.Cells(6).Controls(1), CheckBox)

If myCheckbox.Checked Then

'do the work

End If

Next

 

 

 

 

This function never shows values changed by the user. Only the values as set originally by databind of the grid.

 

For Each dgi In myDatagrid.Items

Dim myCheckbox As CheckBox = CType(dgi.Cells(6).Controls(1), CheckBox)

If CBool(getChecked(CInt(dgi.Cells(0).Text), jobId)) Then

myCheckbox.Checked = True

Else

myCheckbox.Checked = False

End If

Next

 

I have confirmed that the databind is not called prior to the check of existing values.

 

Any ideas as to why and examples as how to fix?

 

 

 

Thanks

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...