Hi to all, I have the following question:
I 'm using the GridView control in aspx, I bound the data with the Wizard in VS2005.
And everything is working just fine, my problem is that I want to change the data in the Grid in runtime (meaning the user can choose some filter and receive the new data in the Grid).
I'll explain my problem:
1. When the page load the user receives all the rows from the table
2. User filter with with a combo box a insert
3. User receive the new data in grid
4. The problem is when I go over the new data, I still receive the old data, for example if I retrieve the data that is store in the row 0 in cell 0 I still get the old data.
This is the way I do it, when clicking on a button:
// retreive the current query
string str = mySqlDataSource.SelectCommand;
// add new condition + id the user input
str = str + "WHERE id= '" + txtID.Text + "'";
// here I change the query with new condition
mySqlDataSource.SelectCommand = str;
// set the sqlDatasource to the Grid
myGridView.DataSourceID = "mySqlDataSource";
* where
mySqlDataSource - Object type SQLDataSource
myGridView - Object type GridView
Like I say in the Grid I see the new data filtered, but if I retrieve the data that is store in row 0 col 0, I still receive the old data(without filtering).
Thanks in advanced