Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Chris Mahoney #1
Get updated values from DataGrid
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
Chris Mahoney Guest
-
Play effect when row updated in DataGrid
I have a DataGrid that contains N number of rows. When one of the rows is updated I'd like to play some sort of effect to highlight the fact that... -
DataGrid: OnUpdateCommand - getting the updated values
Greeting all, I have been reading a number of posts and all the samples I have seen are the same, yet I can't access the updated values of a... -
read row values from datagrid and populate in new datagrid values from connected
Hello, i am new in asp.net and i am having a question: I am having a datagrid_1 in which i am showing the context of PatientDetails table.... -
Datagrid not updated during delete, but updated during insert and update
Hello everyone. A test webform here, single datagrid bound to one table through dataset, and controls to delete, update and insert data. The code... -
Missing CODEGEN values from DataSet Web Reference and Properties are not updated
I've created a web service that has a project reference to a library that contains a strongly typed dataset. The web service has a function that... -
Chris Mahoney #2
Re: Get updated values from DataGrid
Sorry, I'm an idiot, ignore this :)
Chris
"Chris Mahoney" <chris@nzweb.net> wrote in message
news:uET8MqWvFHA.1988@TK2MSFTNGP10.phx.gbl...> 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
>
>
Chris Mahoney Guest
-
Elton Wang #3
Re: Get updated values from DataGrid
No, you are smart to fingure it out yourself.
"Chris Mahoney" <chris@nzweb.net> wrote in message
news:eteZLyWvFHA.724@TK2MSFTNGP14.phx.gbl...the> Sorry, I'm an idiot, ignore this :)
>
> Chris
>
> "Chris Mahoney" <chris@nzweb.net> wrote in message
> news:uET8MqWvFHA.1988@TK2MSFTNGP10.phx.gbl...> > Hi
> >
> > I have a DataGrid, with Edit links in each row. The Edit button works,OnUpdateCommand="Content_Update"> > user can change the values. But I can't get updating to work.
> >
> > <asp:datagrid id="Content" runat="server"the> > 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>> > 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
> >
> >
>
Elton Wang Guest



Reply With Quote

