Color Datagrid

  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Color Datagrid as PDF for free.

More details

  • Words: 93
  • Pages: 1
PrivateSub dgContacts_ItemDataBound(ByVal sender AsObject, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgContacts.ItemDataBound ' Make sure that this is a data row and not a header or footer. If e.Item.ItemType = ListItemType.ItemOrElse e.Item.ItemType = ListItemType.AlternatingItem Then ' Get the value of the manager field. Dim isManager AsString = CType(DataBinder.Eval(e.Item.DataItem, "Manager"), String) If isManager = "1"Then ' Set the text and background color. e.Item.Cells(2).Text = "Manager" e.Item.BackColor = System.Drawing.Color.AliceBlue Else ' Set the text only. e.Item.Cells(2).Text = "Employee" EndIf EndIf EndSub ================================================================================== =========== for each oItem as DataGridItem in DataGrid1.Items oLabel = CType(oItem.FindControl("SessionID"),Label) oLabel.ForeColor = System.Drawing.Color.Orange next

Related Documents

Color Datagrid
October 2019 16
Datagrid
April 2020 13
Datagrid
November 2019 14
Datagrid Web Control
November 2019 13
Color
May 2020 111
Color
June 2020 106