bu gride xml record set “dsoRS” ten alanlar dolmaktadır. Ben bu alanların font rengini koşula göre kırmızı yapacağım window.onload da ama yapamadım. Yardımcı olabilecek kimse var mı?
Dim i i=0 While Not dsoRS.Recordset.EOF dsoRS.Recordset.Fields("txtadSoyad").value="Ali" Document.getElementById("txtadSoyad").style="font-color:red;" dsoRS.Recordset.movenext i=i+1 wend
Böyle yapmaya çalıştım olmuyor, grid satırlarını nasıl kullanabilirim. Şimdiden çok teşekürler.
Tam hatırlamıyorum ama windows.onload yerine grid.onload kısmında yapman gerekiyor sanırım.
Örnek iki kod var burda.
Visual Basic Copy CodeProtected Sub DataList1_ItemCreated(ByVal sender As Object, _
ByVal e As EventArgs)
Select Case e.Item.ItemType
Case ListItemType.Item
e.Item.BackColor = _
System.Drawing.Color.LightGoldenrodYellow
Case ListItemType.AlternatingItem
e.Item.BackColor = System.Drawing.Color.DarkGoldenrod
Case ListItemType.SelectedItem
e.Item.BackColor = System.Drawing.Color.Yellow
Case Else
' Add code here to hand the header, footer, and
' separator templates.
End Select
End Sub
Visual Basic Copy CodeProtected Sub DataList1_ItemDataBound(ByVal sender As Object, _
ByVal e As DataListItemEventArgs)
If e.Item.ItemType = ListItemType.Item Or _
e.Item.ItemType = ListItemType.AlternatingItem Then
Dim drv As System.Data.DataRowView = _
CType(e.Item.DataItem, System.Data.DataRowView)
Dim quantity As Integer = _
Integer.Parse(drv.Row("Quantity").ToString())
If (quantity < 10) Then
e.Item.BackColor = System.Drawing.Color.Red
End If
End If
End Sub
< Bu mesaj bu kişi tarafından değiştirildi Computeus -- 26 Ağustos 2008; 15:44:34 >
dsoRS.Recordset.AbsolutePosition=1 While Not dsoRS.Recordset.EOF If dsoRS.Recordset.Fields("kayitGecerli").value="0" Then frm.txtGrup(dsoRS.Recordset.AbsolutePosition-1).style.backgroundcolor="red" frm.txtadSoyad(dsoRS.Recordset.AbsolutePosition-1).style.backgroundcolor="red" frm.txtadres(dsoRS.Recordset.AbsolutePosition-1).style.backgroundcolor="red" frm.txtevtel(dsoRS.Recordset.AbsolutePosition-1).style.backgroundcolor="red" frm.txtceptel(dsoRS.Recordset.AbsolutePosition-1).style.backgroundcolor="red" End if dsoRS.Recordset.movenext Wend
bu şekilde çözdüm @Computeus teşekürler. vbscriptte grid ile ilgili işlemi olan olursa yardımcı olabilirim.