GrapeCity.Xaml.SpreadSheet.Data
SetValue(Int32,Int32,SheetArea,Object) Method
Example 


The row index.
The column index.
The sheet area.
The value to set for the specified cell.
Sets the value for the specified cell in the specified sheet area.
Syntax
'Declaration
 
Public Overloads Sub SetValue( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal area As SheetArea, _
   ByVal value As Object _
) 
'Usage
 
Dim instance As Worksheet
Dim row As Integer
Dim column As Integer
Dim area As SheetArea
Dim value As Object
 
instance.SetValue(row, column, area, value)
public void SetValue( 
   int row,
   int column,
   SheetArea area,
   object value
)

Parameters

row
The row index.
column
The column index.
area
The sheet area.
value
The value to set for the specified cell.
Example
This example uses the SetValue method.
var style = new GrapeCity.Xaml.SpreadSheet.Data.StyleInfo();
style.Background = new SolidColorBrush(Windows.UI.Colors.Blue);
style.BorderLeft = new GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.Red);
style.BorderTop = new GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.Red);
style.BorderRight = new GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.Red);
style.BorderBottom = new GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.Red);
var style1 = new GrapeCity.Xaml.SpreadSheet.Data.StyleInfo();
style1.Background = new SolidColorBrush(Windows.UI.Colors.Green);
var style2 = new GrapeCity.Xaml.SpreadSheet.Data.StyleInfo();
style2.Background = new SolidColorBrush(Windows.UI.Colors.Yellow);

var rule = GrapeCity.Xaml.SpreadSheet.Data.DateOccurringRule.Create(GrapeCity.Xaml.SpreadSheet.Data.DateOccurringType.NextWeek, style);           
rule.Ranges = new GrapeCity.Xaml.SpreadSheet.Data.CellRange[] { new GrapeCity.Xaml.SpreadSheet.Data.CellRange(0, 0, 10, 1) };
gcSpreadSheet1.Sheets[0].ConditionalFormats.AddRule(rule);

gcSpreadSheet1.Sheets[0].SetValue(0, 0, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, DateTime.Now);
gcSpreadSheet1.Sheets[0].SetValue(1, 0, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(1));
gcSpreadSheet1.Sheets[0].SetValue(2, 0, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(5));
gcSpreadSheet1.Sheets[0].SetValue(3, 0, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(6));
gcSpreadSheet1.Sheets[0].SetValue(4, 0, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(7));
gcSpreadSheet1.Sheets[0].SetValue(5, 0, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(8));
Dim style As New GrapeCity.Xaml.SpreadSheet.Data.StyleInfo()
style.Background = New SolidColorBrush(Windows.UI.Colors.Blue)
style.BorderLeft = New GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.Red)
style.BorderTop = New GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.Red)
style.BorderRight = New GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.Red)
style.BorderBottom = New GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.Red)
Dim style1 As New GrapeCity.Xaml.SpreadSheet.Data.StyleInfo()
style1.Background = New SolidColorBrush(Windows.UI.Colors.Green)
Dim style2 As New GrapeCity.Xaml.SpreadSheet.Data.StyleInfo()
style2.Background = New SolidColorBrush(Windows.UI.Colors.Yellow)

Dim rule = GrapeCity.Xaml.SpreadSheet.Data.DateOccurringRule.Create(GrapeCity.Xaml.SpreadSheet.Data.DateOccurringType.NextWeek, style)
rule.Ranges = New GrapeCity.Xaml.SpreadSheet.Data.CellRange() {New GrapeCity.Xaml.SpreadSheet.Data.CellRange(0, 0, 10, 1)}
GcSpreadSheet1.Sheets(0).ConditionalFormats.AddRule(rule)
GcSpreadSheet1.Sheets(0).SetValue(0, 0, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, DateTime.Now)
GcSpreadSheet1.Sheets(0).SetValue(1, 0, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(1))
GcSpreadSheet1.Sheets(0).SetValue(2, 0, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(5))
GcSpreadSheet1.Sheets(0).SetValue(3, 0, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(6))
GcSpreadSheet1.Sheets(0).SetValue(4, 0, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(7))
GcSpreadSheet1.Sheets(0).SetValue(5, 0, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(8))
Requirements

Target Platforms: Windows Server 2012, Windows RT

See Also

Reference

Worksheet Class
Worksheet Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options