Re: Conditional color - datagrid

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You have conditional formatting with the Dataview webpart. You can use it
to access relational data including SQL!, webservices, xml, server side
script etc. You don't even have to put up with it unghosting pages.

Brett

www.combined-knowledge.com

"Santiago" <santiago.ortino@xxxxxxxxx> wrote in message
news:1138995090.032286.178360@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi, i´m creating a web part (using vb.net) that has a datagrid
connected to msSQL.
i 'd like to use conditional columns, where de forecolor, fontcolor
changes depending on some condition. The problem's that i cant do it, i
tried with this code:

Private Sub dg_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dg.ItemDataBound

If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then
If e.Item.Cells(1).Text = "Green" Then
CType(e.Item.Cells(1).FindControl("column1"),
TextBox).BackColor = Color.DarkGreen
End If
End If
End Sub

but it doesn't work
any idea?

thanks


.



Relevant Pages

  • Re: Import XML from Command-Line into SQL
    ... >>I'd probably create a mapping schema and a VB Script ... >that uses the SQL XML ... >>Bulk Load component to bulk load the data. ... >>remote server other than the server that is running MS ...
    (microsoft.public.sqlserver.xml)
  • Re: PHP to XML Post using form data
    ... and am not sure what a curl_ function is. ... correctly formatted XML? ... They fill in the form and send it back to your server side script ... Your server process takes the data from the form and formats it into ...
    (comp.lang.php)
  • Re: importing xml into sql server 7
    ... You may use Bulkload in VB script, ... > xml and use xslt rather than datasets and datagrids. ... > it saves quite a bit on server load. ... > I would like to store them in sql server. ...
    (microsoft.public.sqlserver.xml)
  • Re: .NET version of ServerXMLHTTP?
    ... > I am very new to XML and webservices. ... > So from examing the VB code that works against the server, ... > uses ServerXMLHTTP in conjunction with DOMDocument. ...
    (microsoft.public.dotnet.framework.aspnet)
  • ACT generates incorrect script when request body contains binary p
    ... page that posts a binary back to the server then the generated script is ... In my case this binary is compressed XML and the server couldn't uncompress ... This causes havoc when I try to uncompress the XML back on the server. ...
    (microsoft.public.vsnet.enterprise.tools)