e.Item.BackColor = System.Drawing.Color.Aquamarine
e.Item.BackColor = System.Drawing.Color.Aquamarine
press play on tape
-----
MP3 Listing
https://sourceforge.net/projects/mp3-listing
File Listing
https://sourceforge.net/projects/file-listing-2-0/
victor, toglimi una curiosita' (non e' una critica, bada bene): perche' ti trovi a scrivere codice ? stai provando a fare una cosa tua ?
press play on tape
-----
MP3 Listing
https://sourceforge.net/projects/mp3-listing
File Listing
https://sourceforge.net/projects/file-listing-2-0/
djciko
ho provato il tuo codice
non da errore
ma non funziona ovvero la prima riga del datagrid rimane uguale
victor
----------------------
questa è una pagina di prova
codice:<%@ Page Language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Protected Sub Page_Load(sender As Object, e As System.EventArgs) Dim vs As Integer() = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} Me.DataGrid1.DataSource = vs Me.DataGrid1.DataBind() End Sub Protected Sub DataGrid1_ItemDataBound(sender As Object, e As System.Web.UI.WebControls.DataGridItemEventArgs) If e.Item.ItemIndex = 0 Then e.Item.BackColor = Color.Aquamarine End If End Sub </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:DataGrid ID="DataGrid1" runat="server" OnItemDataBound="DataGrid1_ItemDataBound"> </asp:DataGrid> </div> </form> </body> </html>
Pietro
ok Pietro grazie mille funziona....
victor
----------------------
non ho capito dov'e' il namespace, pietro
@victor, per completezza è buona norma (genericamente) controlare, nell'itemdatabound, che la riga corrente non e' l'header con un altra if, perche' di solito si manipolano anche le singole celle.
c'e' una eNum apposta.
solved comunque
Ultima modifica di djciko; 17-01-2018 a 16:10
press play on tape
-----
MP3 Listing
https://sourceforge.net/projects/mp3-listing
File Listing
https://sourceforge.net/projects/file-listing-2-0/
ok
e come fa a funzionare a Victor ? boh
vabbe' cmq solved, buon anno caro pietro, a te ad al progetto "corso_apogeo"
press play on tape
-----
MP3 Listing
https://sourceforge.net/projects/mp3-listing
File Listing
https://sourceforge.net/projects/file-listing-2-0/