Assembly: Dapfor.Net (in Dapfor.Net.dll) Version: 2.10.3.24917 (2.10.3.24917)
Syntax
C# |
---|
public void Highlight( TimeSpan interval, Color backColor ) |
Visual Basic |
---|
Public Sub Highlight ( interval As TimeSpan, backColor As Color ) |
Visual C++ |
---|
public: void Highlight( TimeSpan interval, Color backColor ) |
F# |
---|
member Highlight : interval : TimeSpan * backColor : Color -> unit |
Parameters
- interval
- Type: System..::..TimeSpan
The time interval, when the Cell is highlighted.
- backColor
- Type: System.Drawing..::..Color
The background color.
Remarks
.Net Grid provides an extremely convenient mechanism of data highlighting. Highlighting is the process of changing background color of a cell for a specified time interval and gradual restoration of the initial color afterwards. Background color of a cell can be changed twice (at the beginning and at the end) or with a little periodicity (about 30 ms)enabling fading effect with gradual transition between the highlight color and the original background color of the cell.
In programming cell highlighting can be achieved by calling Highlight(TimeSpan, Color). When a programmer calls this method, the grid adds specific information about cell's state into an internal container and launches timers when necessary. The second parameter is the color that may contain alpha-channel enabling mixing of the highlight color and the background color (transparency effect). It's important to mention that the .Net Grid has a very easy to use API that saves programmer's time. Highlighting management and initial parameters are accessible via Highlighting property.
Copy | |
---|---|
public void HowToHighlightCell(Grid grid) { grid.Headers.Add(new Header()); grid.Headers[0].Add(new Column("Price")); grid.Headers[0].Add(new Column("Quantity")); grid.Rows.Add(new Product()); Row row = grid.Rows[0]; //Set a new price programmatically Cell cell = row["Price"]; //Highlight the cell with the red color for 2 seconds cell.Highlight(new TimeSpan(0, 0, 2), Color.Red); } |