Get updated values from DataGrid

C

Chris Mahoney

Hi

I have a DataGrid, with Edit links in each row. The Edit button works, the
user can change the values. But I can't get updating to work.

<asp:datagrid id="Content" runat="server" OnUpdateCommand="Content_Update"
OnCancelCommand="Content_Cancel" OnEditCommand="Content_Edit">
<Columns>
<asp:EditCommandColumn EditText="Edit" UpdateText="Update"
CancelText="Cancel" />
</Columns>
</asp:datagrid>

Sub Content_Update(ByVal sender As Object, ByVal e As
DataGridCommandEventArgs)
Dim txt1 As String = CType(e.Item.Cells(2).Controls(0), TextBox).Text
Dim txt2 As String = CType(e.Item.Cells(3).Controls(0), TextBox).Text
etc.

My problem is that txt1 and txt2 end up with the original values, not the
new ones that have been entered by the user. I've looked for a PostBack
function but there doesn't seem to be one. How can I get the updated values?

Thanks
Chris
 

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,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top