Issue in the Grid Graph
Hi,
I try to draw a history graph in the grid column. In the graph column I'm getting the text "Collection". Drawn graph is over writing on the text. In which case I will get this text "Collection". How I can remove this.
Regards
Sasee.G
-
Hi,
This is a normal behaviour of the Grid. While drawing it knows nothing about custom painting and if there is no specified format, the grid takes a text by calling object.ToString() method. In your case it will be 'Collection'
There are many ways to resolve the problem.
1. Setup an EmptyFormat for the property, returning the collection:class YourClass
{
[Format(typeof(EmptyFormat))]
IList History
{
...
}
}
2. Setup this format for the specified column:grid.Headers[0]["History"].Format = new EmptyFormat();
3. Replace text in the grid.PaintCell event:grid.PaintCell += delegate(object sender, PaintCellEventArgs e)
{
if(e.Cell.Column != null && e.Cell.Column.Id == "History")
{
e.Text = string.Empty;
e.PaintAll();
e.Handled = true;
//your code here
...
}
};
More information about data formatting you can find here:
http://www.dapfor.com/en/net-suite/net-grid/tutorial/data-formatting-and-presentation
Best regards,
Dapfor0
Please sign in to leave a comment.
Comments
1 comment