Asp net gridview rowupdating event

The simple trick would be to set the gridview property Enable View State to false.In my VB Gridview, I had bind several column from datatable into one single column of the gridview. The following is the VB code: Protected Sub Grid View1_Row Editing(By Val sender As Object, By Val e As Grid View Edit Event Args) 'Set the edit index. Bind Data() End Sub Protected Sub Grid View1_Row Canceling Edit(By Val sender As Object, By Val e As Grid View Cancel Edit Event Args) 'Reset the edit index. Edit Index = -1 'Bind data to the Grid View control. Add(New Data Column("Col1_TOIL", Get Type(String))) dt.

asp net gridview rowupdating event-68

Connection = conn2 sql = "SET DATEFORMAT dmy; SELECT * FROM XXXX " cmd. Execute Reader() Dim Temp Staff Key As Integer Dim Temp Post Key As Integer Dim Temp Shift Date As Date Time Dim Temp Start Time As Date Time Dim Temp End Time As Date Time Dim Temp SL As String Dim Temp Roster Key As Integer Dim Temp VL As String Dim Temp ML As String Dim Temp PH As String Dim Temp APH As String Dim Temp TOIL As String Dim Temp Others As String Dim Temp Shift Type As Integer Dim Temp Submitted By As Integer Dim dt As New Data Table() dt. Add(New Data Column("Staff Name", Get Type(String))) dt. Add(New Data Column("Post Code", Get Type(String))) dt. Add(New Data Column("Staff Key", Get Type(Int32))) dt. Add(New Data Column("Post Key", Get Type(Int32))) 'Monday dt. Add(New Data Column("Col1_Roster Key", Get Type(Int32))) dt. Add(New Data Column("Col1_Shift Date", Get Type(Date Time))) dt. Add(New Data Column("Col1_Start Time", Get Type(Date Time))) dt. Add(New Data Column("Col1_End Time", Get Type(Date Time))) dt. Add(New Data Column("Col1_SL", Get Type(String))) dt. Hi all, I need to alter a value before it enters the database by changing line breaks to html br tags but I only need to do this with one control in the page. I have a Grid View that I'm databinding to custom objects. When not in edit mode, the user control displays read only values.I know that I can do something like this: protected void grd Comments_Row Updating(object sender, Grid View Update Event Args e) But this works for every control with the Edit Item Template when I only want to apply my method to one control. Row Index]) but I know accessing via index isn't good practice. When the user clicks an 'edit' link on the row, the user control then goes into edit mode where two Text Boxes are displayed.The Grid View control resides in a User Control which is referenced in an page that is housed inside a Master Page.the View state is disabled because I need the the Grid View to be displayed even when there is no data.

Leave a Reply