asp.net - Modifying the html output of a gridview -


I'm trying to modify the output of my GridView in RowDataBound event handler, but it does not work - . Nothing happens

My code:

  private sub MyGridView_RowDataBound (ByVal) MyGridView.RowDataBound e.Row.Attributes as this object, ByVal e GridViewRowEventArgs. Add ("data-xkoordinat" handle, 0) End Sub  

What I expected to see:

   

what comes

  & lt; Tr & gt; ... & lt; / Tr & gt;  

How can I add attribution

Update :
I have done a lot more research, and seen there anything Not to know about the RowDataBound method - should it be there? I Page_Load is routine, where data binding, as follows:

  Protected Sub Page_Load (ByVal as this object, ByVal e System.EventArgs ) handles using IDatabaseAdapter = Locator.GetDatabaseAdapter (db as Me.Load) db.Open () MyGridView.DataSource = db.ExecuteReader ( "MatpunktLista", it is true, {db.CreateParameter ( "id_uppdrag", Request .QueryString ( "id_uppdrag"))}) will MyGridView .DataBind () end end using sub  

is there anything here due to which not pollute the lines? I'm reloading through the F5 , or by selecting the address field in your browser and hitting the Enter , so I do not think Postbacks should be an issue .

Why I do not know, but now it works, I believe this server code There may be something with the service of the old version up, because when I look at the trace annotations pair to see what happened, nothing is visible - even after I compile and reload

Now, . Suddenly, everything works in the expected way. Everything I did was to compile again, so I think the problem was the old code for someone else that finds: supply should be done in the code question - Just make sure that this is actually the code that is being worked for the browser ...


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -