Saimactitty
New Member
Ok so what seems like a basic problem is getting the better of me and my exstensive google efforts have come up short. Perhaps I don't understand enough to ask the right questions.Here's my problem:I have a formview control, or rather a series of them, each page displaying entry from previous forms, for a higher level access to approve/edit as needed. So, on form "B", I have the contents of form "A" and the blank part of "B" to filled out...So two seperate fromviews on the page.."A" and "B"That works fine, the issue is when I change the mode to edit previous entry. So if I have a button or the default linkbutton to change from ReadOnly to Edit I not only lose bindings but any efforts to counteract that have left me with issues when I postback. DUE TO LENGTH I'M LEAVING SOME CODE OUTOn my button I'm using FormView2.ChangeMode(FormViewMode.Edit) to change view, the default link button I've not changedBindings on my listboxes are setup like:\[code\]If Not Page.IsPostBack Then 'pulling bindings from table cmd = New OleDbCommand("SELECT * FROM mslToi", objCon) objReader = cmd.ExecuteReader lst1.DataValueField = "listing" lst1.DataTextField = "listing" lst1.DataSource = objReader lst1.DataBind() 'pre-selecting input data from form "A" cmd = New OleDbCommand("SELECT [type_of_injury] FROM S2childToi WHERE ID = " & qs & "", objCon) objReader = cmd.ExecuteReader Do While objReader.Read For Each y As ListItem In lst1.Items If y.Text = objReader.Item(0) Then y.Selected = True End If Next Loopend if\[/code\]In the page load event.That works fine so far...it's when I change view to Edit that my listbox appears to no longer be bound (controls appear but have no content). My thought is that obviously I'm blocking out my code from postback events (I have a reason for this). I can use this code (without the If Not Page.IsPostBack) to force the selections and bindings but whenever I postback they will defualt to the table data, which can't happen, each listbox needs to postback so I can check for a certain selection. So what happens is the user input is trumped. Short and sweet. I'm sorry that I can't explain better, any advice is much appreciated. If I can asnwer any questions or post code let me know.