Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Get updated values from DataGrid

Reply
Thread Tools

Get updated values from DataGrid

 
 
Chris Mahoney
Guest
Posts: n/a
 
      09-19-2005
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


 
Reply With Quote
 
 
 
 
Chris Mahoney
Guest
Posts: n/a
 
      09-19-2005
Sorry, I'm an idiot, ignore this

Chris

"Chris Mahoney" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Elton Wang
Guest
Posts: n/a
 
      09-20-2005
No, you are smart to fingure it out yourself.


"Chris Mahoney" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Sorry, I'm an idiot, ignore this
>
> Chris
>
> "Chris Mahoney" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid: OnUpdateCommand - getting the updated values Dan ASP .Net Datagrid Control 0 08-18-2005 10:16 AM
Retrieve the updated values from datagrid =?Utf-8?B?TWFyeUE=?= ASP .Net 3 08-13-2005 07:20 AM
DataGrid.UpdateCommand I can't get updated values =?Utf-8?B?T3plcg==?= ASP .Net 0 06-12-2004 10:27 PM
DataGrid.UpdateCommand Can't Get Updated Values From Textbox Contr =?Utf-8?B?TmV3YXNwcw==?= ASP .Net 0 06-12-2004 10:20 PM
Datagrid not updated during delete, but updated during insert and update Dmitry Korolyov ASP .Net Datagrid Control 0 09-22-2003 10:57 AM



Advertisments