Ask a Question related to ASP.NET General, Design and Development.
-
dawn #1
update problem in DataGrid's UpdateCommand method
Hi, anyone can help me to solve this little problem that
i've spent a lot of time to solve it!! but i can't!!!!
actually, i use a DataGrid, and i'd like to save the
changed data! ( this is just a trial method and i'll
use this method with a more complique method later,
that's why i can't use MxDataGrid)
but each time, DataGrid save the original data, not the
one after changed in the Textbox!!!
i've used Database Update Method!!!
but it can't save the new data in the database!
even though i use a Label6 to show out the changed data,
it can't show the new data too!!!
here is the code!!
anyone can give me a hand???
thanks!!!
Dawn
------------------------------
Sub MyDataGrid_UpdateCommand(sender As Object, e As
DataGridCommandEventArgs)
Dim Ucode As TextBox = e.Item.Cells(1).Controls(0)
Dim Unom As TextBox = e.Item.Cells(2).Controls(0)
Dim Uetage As TextBox = e.Item.Cells(3).Controls(0)
Dim Ubureau As TextBox = e.Item.Cells(4).Controls(0)
Dim Upid As integer = e.Item.ItemIndex + 1
Dim Upcode As String = Ucode.Text
Dim Upnom As String = Unom.Text
Dim Upetage As String = Uetage.Text
Dim UpBureau As String = Ubureau.Text
Label6.Text= Upid & "--"& Upnom &"---" & Upcode & "--
UpdateSite(5,Upnom,Upcode,Upetage,UpBureau)
MyDataGrid.EditItemIndex = -1
BindGrid
End Sub
dawn Guest
-
DataGrid1 UpdateCommand calling DataGrid2 UpdateCommand
When the UpdateCommand gets called on a DataGrid(1) i need to call the UpdateCommand on DataGrid(2), and when complete proceed with the reminder on... -
How to add javascript onClick attribute to datagrid's edit template (update command)?
How to add javascript onClick attribute to datagrid's edit template (update command)? any suggestions? -
Datagrid Updatecommand problem!! Urgent
Hi! I have a datagrid and i want to update new values after editing datagrid. i am using following code; tb = CType(e.Item.Cells(1).Controls(0),... -
new datagrid's problem
my table has total 3 columns like emp_id(primay key),emp_name emp_address i m populating my datagrid at run time successfully . now i add... -
DataGrid's UpdateCommand event handler and CancelCommand handler problem
I am having the same problem: the wrong event handler is being fired when column headings and page changes are clicked. I am using the datagrid... -
Daniel Bass #2
Re: update problem in DataGrid's UpdateCommand method
you need to trace through the code and check the values passed into the 4
Strings you're pulling off the textboxes, then step into the UpdateSite
function to check this does what it says on the tin, i suspect it's in this
method that your problem lies.
Dan.
ps. it's worth noting your first parameter is "5" in the UpdateSite...
should this perhaps be Upid?
"dawn" <bigheaddawn@yahoo.com> wrote in message
news:305801c3550d$1000ce90$a001280a@phx.gbl...> Hi, anyone can help me to solve this little problem that
> i've spent a lot of time to solve it!! but i can't!!!!
>
> actually, i use a DataGrid, and i'd like to save the
> changed data! ( this is just a trial method and i'll
> use this method with a more complique method later,
> that's why i can't use MxDataGrid)
>
> but each time, DataGrid save the original data, not the
> one after changed in the Textbox!!!
> i've used Database Update Method!!!
> but it can't save the new data in the database!
> even though i use a Label6 to show out the changed data,
> it can't show the new data too!!!
>
> here is the code!!
> anyone can give me a hand???
>
> thanks!!!
>
> Dawn
> ------------------------------
> Sub MyDataGrid_UpdateCommand(sender As Object, e As
> DataGridCommandEventArgs)
> Dim Ucode As TextBox = e.Item.Cells(1).Controls(0)
> Dim Unom As TextBox = e.Item.Cells(2).Controls(0)
> Dim Uetage As TextBox = e.Item.Cells(3).Controls(0)
> Dim Ubureau As TextBox = e.Item.Cells(4).Controls(0)
>
> Dim Upid As integer = e.Item.ItemIndex + 1
> Dim Upcode As String = Ucode.Text
> Dim Upnom As String = Unom.Text
> Dim Upetage As String = Uetage.Text
> Dim UpBureau As String = Ubureau.Text
>
> Label6.Text= Upid & "--"& Upnom &"---" & Upcode & "--
>
> UpdateSite(5,Upnom,Upcode,Upetage,UpBureau)
> MyDataGrid.EditItemIndex = -1
> BindGrid
> End Sub
>
>
Daniel Bass Guest



Reply With Quote

