المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Re: Grid Column Event Help - Need to fill Grid column with text on the fly



C# Programming
05-20-2010, 06:32 AM
Thanks to everyone for you help in advance.

I have a Grid that currently has a column that does not fill with data from the db but with an image depending on a condtion met. What is the same method but not a rendering method that draws a graphic but rather fills cell with text.

something like:

if (D.Flags == 1)
{
........?? //Draw Text = "Warning"
}
namespace Freepour.Studio.Controls.Grid
{

public class InventoryWorksheetGridImageColumn : GridImageColumn
{
.....

protected override void DrawCell(Divelements.SandGrid.Rendering.RenderingContext context, GridRow row, object value, Font rowFont, Image image, Rectangle bounds, bool selected, Divelements.SandGrid.Rendering.TextFormattingInformation textFormat, Color foreColor)
{
float x = (2) + bounds.Left;
float y = (1) + bounds.Top;
float width = 16.0F;
float height = 16.0F;

object O = row.DataItem;
DownloadAudit D = O as DownloadAudit;

if (D.Flags == 1)
{
context.Graphics.DrawImage(ExclusionImage, x, y, width, height);
}