nobitavn94 Posted December 29, 2006 Share Posted December 29, 2006 Hi all,I have a grid view control (named GridQuestion) and an xml file.I bound xml file to grid view control as follow :1.Using a dataset to read xml file.2.Assign the dataset to data source property of grid view.3.Databound.In GridVew_RowUpdating event ,I get new value that user enter : protected void GridQuestion_RowUpdating(object sender, GridViewUpdateEventArgs e){ GridViewRow row= GridQuestion.Rows[e.RowIndex]; Textbox txtbox =(TextBox)row.FindControl("txtQuestion"); ....}but I cannot get new value user entered. txtbox.Text contains the old value before user enter.How can I get new value that user enter ?Thank you ! Link to comment Share on other sites More sharing options...
jesh Posted December 29, 2006 Share Posted December 29, 2006 The event handling (_RowUpdating) happens after the Load event on the page. If you have code in your Page_Load handler that binds the XML file to the GridView, then it may be overwriting what the user has inputted. If this is the case, try putting the databinding code like this: protected void Page_Load(object sender, EventArgs e){ if(!Page.IsPostBack) { // databinding code goes here and only // runs if the page hasn't been posted back. }} Link to comment Share on other sites More sharing options...
nobitavn94 Posted December 30, 2006 Author Share Posted December 30, 2006 Thank for your response .I put databinding code like your guidance .But this time,the gridview doesn't show up .Can you give me another tutorial ? Link to comment Share on other sites More sharing options...
nobitavn94 Posted December 30, 2006 Author Share Posted December 30, 2006 Thank you .I got the new value . Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now