Excel Behaviour for Large Numbers
Hi there,
We would like to have the same behaviour the Microsoft Excel has for large values. When the number gets too long a mask value is put in place rather than allowing the number to float (Excel uses ######). Is there anyway to do this in the Syncfusion Grids?
Cheers,
TERRY ROSSOW
We would like to have the same behaviour the Microsoft Excel has for large values. When the number gets too long a mask value is put in place rather than allowing the number to float (Excel uses ######). Is there anyway to do this in the Syncfusion Grids?
Cheers,
TERRY ROSSOW
SIGN IN To post a reply.
5 Replies
AD
Administrator
Syncfusion Team
August 28, 2006 12:18 PM UTC
Hi Terry,
The DrawCellDisplayText event of the grid can be handled to achieve this. Try the below piece of code.
Thanks for using Syncfusion Products.
Regards,
Rajagopal
The DrawCellDisplayText event of the grid can be handled to achieve this. Try the below piece of code.
// DrawCellDisplayText event handler
if (e.RowIndex > 0 && e.ColIndex > 0)
{
SizeF siz = e.Graphics.MeasureString(e.Style.CellValue.ToString(), e.Style.GdipFont);
if ((siz.Width + 2) > e.ClipBounds.Width)
{
e.DisplayText = "##############";
}
}
Thanks for using Syncfusion Products.
Regards,
Rajagopal
TR
Terence Rossow
August 31, 2006 01:26 AM UTC
Thanks for the reply. That''s basically what I had in mind.
There is a problem though. We use float/flood cell so that large amounts of text can spill over subsequent cells. Sometimes the flooding behaviour comes into effect before the DrawCellDisplayText event fires, and the ClipBounds is the bounds for both cells. Is there anyway to get the size for JUST the cell in question?
I have tried to turn on Floating and Flooding for only the cells that have numeric values in the PrepareViewStyleInfo, however for some reason Float and Flood doesn''t seem to work properly. I have tried both BeforeDisplayCalculation and OnDemandCalculation for FloatCellsMode of the grid, but no matter whether float or flood is on or off the floating behaviour doesn''t show up. Any ideas why this might be?
Cheers,
TERRY
There is a problem though. We use float/flood cell so that large amounts of text can spill over subsequent cells. Sometimes the flooding behaviour comes into effect before the DrawCellDisplayText event fires, and the ClipBounds is the bounds for both cells. Is there anyway to get the size for JUST the cell in question?
I have tried to turn on Floating and Flooding for only the cells that have numeric values in the PrepareViewStyleInfo, however for some reason Float and Flood doesn''t seem to work properly. I have tried both BeforeDisplayCalculation and OnDemandCalculation for FloatCellsMode of the grid, but no matter whether float or flood is on or off the floating behaviour doesn''t show up. Any ideas why this might be?
Cheers,
TERRY
AD
Administrator
Syncfusion Team
August 31, 2006 01:42 PM UTC
Hi Terry,
Please try the attached sample that seems to work as expected in bringing up the excel behavior for large numbers.
Here is a sample
http://www.syncfusion.com/Support/user/uploads/Forum_48420_4d615800.zip
Let me know if this helps.
Thanks,
Rajagopal
Please try the attached sample that seems to work as expected in bringing up the excel behavior for large numbers.
Here is a sample
http://www.syncfusion.com/Support/user/uploads/Forum_48420_4d615800.zip
Let me know if this helps.
Thanks,
Rajagopal
TR
Terence Rossow
September 1, 2006 04:33 AM UTC
Thanks for the reply.
I think I didn''t explain properly. I wish to have the # mask for large numbers, but if the user enters text in a cell, have it spill over (using the float and flood cell properties).
If you could change the sample to show this I would be most greatful.
Thanks,
TERRY ROSSOW
I think I didn''t explain properly. I wish to have the # mask for large numbers, but if the user enters text in a cell, have it spill over (using the float and flood cell properties).
If you could change the sample to show this I would be most greatful.
Thanks,
TERRY ROSSOW
AD
Administrator
Syncfusion Team
September 1, 2006 12:24 PM UTC
Hi Terry,
I have modifed the previous post attached sample as per your requirement. The modifed attached sample works fine with large number excel behavior and Let me know if you are looking something different.
Here is a sample.
http://www.syncfusion.com/Support/user/uploads/ModifiedForum_48420_ee704a21.zip
Regards,
Haneef
I have modifed the previous post attached sample as per your requirement. The modifed attached sample works fine with large number excel behavior and Let me know if you are looking something different.
Here is a sample.
http://www.syncfusion.com/Support/user/uploads/ModifiedForum_48420_ee704a21.zip
Regards,
Haneef
SIGN IN To post a reply.
- 5 Replies
- 2 Participants
-
TR Terence Rossow
- Aug 28, 2006 04:27 AM UTC
- Sep 1, 2006 12:24 PM UTC