ReoGrid Forum

Fast and powerful .NET Spreadsheet Component

You are not logged in.

Announcement

This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.

https://github.com/unvell/ReoGrid/issues

#1 2015-05-20 03:44:54

ebrouen
Member
Registered: 2015-05-20
Posts: 6

Customize format

Hi,
First, I'd like to thank you for such a great control. It's amazing. I discovered it a week ago and I'm currently working on a (generic) Pivot analysis system and that fits perfectly.
I'd love to continue with open source software, like the version 0.8.5 and below, but I can also understand some motivations. Hope that it will go always in the same direction.

One feature that could be great is the ability to define custom format for cells, as it can be done with custom formulas. Formulas are good to show some data, but if the user change the cell, there is a risk to mistype the formula...
On the other hand, cell formats are more reliable in the user-experience.
One of the example is to transform a number of seconds to a well-formatted duration. [DateTime] format is not enough because it gives a reference to a precise date. And making a sum of the [formatted by customized formula] duration is not possible.
Other example could be translation inside the sheet (not for menus). And so on.

Once again, congratulations for this SUPERB control.
Eric

Offline

#2 2015-05-23 01:09:24

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Customize format

Hi Eric,

Thanks! Glad to hear that, and thanks for nice suggestions.
The next version of ReoGrid would provide the customize cell formatter interface, classes could implement from this interface to format cells on worksheet:

/// <summary>
/// Data format provider interface
/// </summary>
public interface IDataFormatter
{
	/// <summary>
	/// Format data stored in specified cell.
	/// </summary>
	/// <param name="cell">Instance of cell to be formatted.</param>
	/// <returns>Return non-empty string if formatting was performed successfully; Otherwise return null.</returns>
	string FormatCell(ReoGridCell cell);

	/// <summary>
	/// Indicate that whether or not to check the data type before format.
	/// </summary>
	/// <returns>True to perform test; Otherwise return false.</returns>
	bool PerformTestFormat();
}

I will post the url of document once the next version get released.

Offline

#3 2015-05-24 16:44:24

ebrouen
Member
Registered: 2015-05-20
Posts: 6

Re: Customize format

Hi Jing,
I think it would be necessary (or at least useful) to have a second parameter in FormatCell to specify a format model. With such a parameter, the same user function could be used to handle different formats. Something like CellDataFormatFlag.User with a string argument.
Another solution would be to get the format of a cell with a method like GetDataFormat(ReoGridCell cell).
I hope that these suggestions will fit your road map.
Can you tell me when you plan to release this version?
Regards
Eric

Offline

#4 2015-09-07 03:07:46

Jingwood
Moderator
From: jing at reogrid.net
Registered: 2014-06-03
Posts: 615

Re: Customize format

Hi Eric, is there any unsolved problems here? Sorry for late reply.

For the GetDataFormat method, could be achieved by access this property:

worksheet.Cells["A1"].DataFormat

Last edited by Jingwood (2015-09-07 03:10:29)

Offline

Board footer

Powered by FluxBB