IS the row in Edit mode? (EditIndex > -1 in GridView)
Than use the above code
String Value2 = tr.Cells.Text;
Set a breakpoint on the line with the (TextBox) cast.
When reaching the breakpoint (Build = debug)
add a watch on
See how many controls the Count gives. If larger than 1 try in the watch
all other controls in the array like
tr.Cells.Controls[and so on]
In that case you can see in which control your data exists.
I guess I wasnt clear enough, Ill try to describe the problem again.
The web service has two functions the first one retrives a DataSet and the second one gets DataSet
as a parameter and save it to the DataBase with DataAdapter.
After I get the DataSet from the web service I bind it to the DataGrid (as decribed In my first message)
when I make changes throgh the DataGrid I expect that the DataSet will change but it doesnt,
that's why its irrelevant to save it back in the DB at this stage.
Why does the DataSet doesn't change when I'm changing the DataGrid ?
You are in disconnected state with the database. So after changing data in the gridview you have to change the data in the database. The webservice retrieves it data from the database. So after a change your webservice seems to run a type of reload data from the database.
After a change in a gridview you have to update the data in database.
your working order is:
Load data from database
Bind it to the grid
Edit a row
Update the data from the row in the database (You can use .SelectedValue property to see the DataKeyName and/or DataKeyValue. In that case you can update the row with the SelectedValue als key for the where)
After updating you load data again from the database
Or is it amatter of creating a new console app and breaking down the code and re writting it into the console app?
Yes. However if you followed standard Object Oriented Design Principles and Best Practices there won't be any re-writing, there would just be adding the original source files containing all the code for the application behavior into the new console project.
I believe i have found a solution to my problem, quote me if im wrong, but if i convert my web app to a winform app, it should be alot simpler to convert into a console app. logic is sound not sure about the method of it all, ill keep ya posted.
I have a textbox inside a usercontrol that is part of a modal window. I would like to set the focus to that control once the modal window is displayed. I have tried calling the controls focus() method. I have also tried adding script. It is just not working.
//this.EmployeeNumber1.TextBoxEmployeeNumber.Focus(); it is NOT working
this.Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "money", "document.getElementById('" + this.EmployeeNumber1.TextBoxEmployeeNumber.ClientID + "').focus();", true);