Gridview rowupdating templatefield


I think my question was more to the point, if I have a datasource then I have to have boundfields, and this would preclude use of template fields? you're not using a single datasource in your templatefields. Because as you can see from the html I posted, I am using boundfields and template fields in the same gridview, and I am reading and writing.I believe that databinding on every postback is the cause but that's not something that I can change right now, same goes with the autogeneratedcolumns setting. I'm not sure if I know what you mean about 2 way binding. If you meanam I using Bind instead of Eval in my HTML, then yes. And the result of your code is no different than my version or what I was doing before, which was just using the findcontrol method, and that just returns what was in the grid when it was first binded to the database on page load. Yes ok i think i know what you are probably doing wrong. I'd like to know if there are any other ways to retrieve the new values? I have been using the web site successfully for just over a year, and I am presently using a Select button in the row to launch a detailsview, and I edit the database that way. Net a year and a half ago, and VB programmer forever before that, but I feel pretty confident in this large and powerful website I have created, but the users don't like the details view have expressed a desire to edit on the fly in the gridview. My user base has a hold of management's ear, and my management wants to dump ASP. This could be the straw that broke the camel's back - a person's job hangs in the balance - MINE!! If you are databinding in page_load then you need to only do it if(! Protected Sub Page_Load(By Val sender As Object, By Val e As System. Load Dim i Col As Integer, c As Integer = 0, i Chx As Integer 'If In Str(Http Context. Selected = True Else End If Fill Grid View() End Sub Private Sub Fill Grid View() Dim i Col As Integer, c As Integer = 0, i Chx As Integer, i As Integer Dim str SQL As New System. String Builder Dim str Params As String = "" 'THE FOLLOWING CODE THAT INDICATES SPECIFIC COLUMN NUMBERS IS DETERMINED 'BY THE HTML ASPX CODE THAT DETERMINES HOW THE GRIDVIEW LOOKS For i Chx = 0 To Me. i.e, if I have a customers ID column in a gridview and I'd like to show the customers last name for each rows ID..then I just: convert the boundfield to a templatefield ||| insert an extra label into the Item Template Field (and sometimes also the edit Template Field) ||| then bind the newly inserted label to a some linq code in a rowdatabound (or databound event for detailsview) based on the value of the bound label that was already in the template after I'd converted the boundfield to template ..voila each time a row fires my code fires and not only do I get the customers ID I get the customers last name as well, even though the customers last name is in a completely different table.



Grid View has a method that is unfortunately protected called Extract Row Values. Auto Generate Edit Button = True Then i Col Date = 8 i Col Proj Stat = 10 End If Dim lbl Text As Label For i Row = 0 To Track Projects. Edit Index Then i Row = 1 If i Row = Track Projects. Count Then Exit For lbl Text = Direct Cast(gv Track Projects. you can always just turn the boundfield into a template field then put whatever control you want in templatefield then bind that control to any datasource you'd like (once again I prefer linq over all of the rest).