Geben Sie Cell Daten des GridWeb-Arbeitsblatts im Prozentformat ein
Contents
[
Hide
]
Mögliche Nutzungsszenarien
GridWeb unterstützt jetzt Benutzer bei der Eingabe von Zellendaten im Prozentformat wie 3 %, und die Daten in der Zelle werden automatisch als 3,00 % formatiert. Sie müssen den Zellenstil jedoch auf das Prozentformat festlegen, das entweder GridTableItemStyle.NumberType a 9 oder 10 ist. Die Zahl 9 formatiert 3 % als 3 %, aber die Zahl 10 formatiert 3 % als 3,00 %.
Wenn Sie den Zellenstil nicht auf Prozentformat eingestellt haben, werden die Eingabedaten 3 % als 0,03 angezeigt.
Geben Sie Cell Daten des GridWeb-Arbeitsblatts im Prozentformat ein
Der folgende Beispielcode legt die Zelle A1 GridTableItemStyle.NumberType auf 10 fest, daher werden die Eingabedaten 3 % automatisch als 3,00 % formatiert, wie im Screenshot gezeigt.
Beispielcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Access cell A1 of first gridweb worksheet | |
GridCell cellA1 = GridWeb1.WorkSheets[0].Cells["A1"]; | |
// Access cell style and set its number format to 10 which is a Percentage 0.00% format | |
GridTableItemStyle st = cellA1.Style; | |
st.NumberType = 10; | |
cellA1.Style = st; |