GrapeCity.Xaml.SpreadSheet.Data
FillDate(CellRange,FillSeries,FillDateUnit,Double) Method
Example 


GrapeCity.Xaml.SpreadSheet.Data Namespace > Worksheet Class > FillDate Method : FillDate(CellRange,FillSeries,FillDateUnit,Double) Method
The fill range.
The fill direction.
The fill date unit.
Fills the date using the step value. The step value is the adjacent cells' offset.
Fills the specified range when the source value type is date.
Syntax
'Declaration
 
Public Overloads Sub FillDate( _
   ByVal range As CellRange, _
   ByVal series As FillSeries, _
   ByVal unit As FillDateUnit, _
   ByVal step As Double _
) 
'Usage
 
Dim instance As Worksheet
Dim range As CellRange
Dim series As FillSeries
Dim unit As FillDateUnit
Dim step As Double
 
instance.FillDate(range, series, unit, step)
public void FillDate( 
   CellRange range,
   FillSeries series,
   FillDateUnit unit,
   double step
)

Parameters

range
The fill range.
series
The fill direction.
unit
The fill date unit.
step
Fills the date using the step value. The step value is the adjacent cells' offset.
Exceptions
ExceptionDescription
The range cannot be null.
Remarks
The next value is generated by adding the step value to the current value. The step value is affected by the fill date unit. The default stop value is positive infinity.
Example
This example uses the FillDate method.
gcSpreadSheet1.CanUserDragFill = true;
gcSpreadSheet1.Sheets[0].SetValue(0, 0, new DateTime(2011, 1, 1));
gcSpreadSheet1.Sheets[0].SetValue(0, 1, new DateTime(2011, 2, 9));
gcSpreadSheet1.Sheets[0].SetValue(0, 2, 5);
gcSpreadSheet1.Sheets[0].SetValue(0, 3, 10);
gcSpreadSheet1.Sheets[0].SetValue(0, 4, 1);

        private void button1_Click(object sender, RoutedEventArgs e)
        {
     GrapeCity.Xaml.SpreadSheet.Data.CellRange r = new GrapeCity.Xaml.SpreadSheet.Data.CellRange(0, 0, 4, 1);
        gcSpreadSheet1.Sheets[0].FillDate(r, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column, GrapeCity.Xaml.SpreadSheet.Data.FillDateUnit.Day, 2);
        GrapeCity.Xaml.SpreadSheet.Data.CellRange r2 = new GrapeCity.Xaml.SpreadSheet.Data.CellRange(0, 1, 4, 1);
        gcSpreadSheet1.Sheets[0].FillDate(r2, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column, GrapeCity.Xaml.SpreadSheet.Data.FillDateUnit.Day, 1, new DateTime(2011, 2, 11));
        GrapeCity.Xaml.SpreadSheet.Data.CellRange r3 = new GrapeCity.Xaml.SpreadSheet.Data.CellRange(0, 2, 4, 1);
        //gcSpreadSheet1.Sheets[0].FillAuto(r3, GrapeCity.Xaml.SpreadSheet.Data.FillDirection.Down);
        gcSpreadSheet1.Sheets[0].FillAuto(r3, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column);
        GrapeCity.Xaml.SpreadSheet.Data.CellRange r4 = new GrapeCity.Xaml.SpreadSheet.Data.CellRange(0, 3, 4, 1);
        //gcSpreadSheet1.Sheets[0].FillGrowth(r4, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column);
        //gcSpreadSheet1.Sheets[0].FillGrowth(r4, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column, 2);
        gcSpreadSheet1.Sheets[0].FillGrowth(r4, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column, 2, 55);
        GrapeCity.Xaml.SpreadSheet.Data.CellRange r5 = new GrapeCity.Xaml.SpreadSheet.Data.CellRange(0, 4, 4, 1);
        //gcSpreadSheet1.Sheets[0].FillLinear(r5, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column);
        //gcSpreadSheet1.Sheets[0].FillLinear(r5, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column, 3);
        gcSpreadSheet1.Sheets[0].FillLinear(r5, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column, 3, 20);        
        }
gcSpreadSheet1.CanUserDragFill = True
gcSpreadSheet1.Sheets(0).SetValue(0, 0, New DateTime(2011, 1, 1))
gcSpreadSheet1.Sheets(0).SetValue(0, 1, New DateTime(2011, 2, 9))
gcSpreadSheet1.Sheets(0).SetValue(0, 2, 5)
gcSpreadSheet1.Sheets(0).SetValue(0, 3, 10)
gcSpreadSheet1.Sheets(0).SetValue(0, 4, 1)

Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
        Dim r As New GrapeCity.Xaml.SpreadSheet.Data.CellRange(0, 0, 4, 1)
        gcSpreadSheet1.Sheets(0).FillDate(r, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column, GrapeCity.Xaml.SpreadSheet.Data.FillDateUnit.Day, 2)
        Dim r2 As New GrapeCity.Xaml.SpreadSheet.Data.CellRange(0, 1, 4, 1)
        gcSpreadSheet1.Sheets(0).FillDate(r2, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column, GrapeCity.Xaml.SpreadSheet.Data.FillDateUnit.Day, 1, New DateTime(2011, 2, 11))
        Dim r3 As New GrapeCity.Xaml.SpreadSheet.Data.CellRange(0, 2, 4, 1)
        'GcSpreadSheet1.Sheets(0).FillAuto(r3, GrapeCity.Xaml.SpreadSheet.Data.FillDirection.Down)
        gcSpreadSheet1.Sheets(0).FillAuto(r3, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column)
        Dim r4 As New GrapeCity.Xaml.SpreadSheet.Data.CellRange(0, 3, 4, 1)
        'GcSpreadSheet1.Sheets(0).FillGrowth(r4, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column)
        'GcSpreadSheet1.Sheets(0).FillGrowth(r4, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column, 2)
        gcSpreadSheet1.Sheets(0).FillGrowth(r4, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column, 2, 55)
        Dim r5 As New GrapeCity.Xaml.SpreadSheet.Data.CellRange(0, 4, 4, 1)
        'GcSpreadSheet1.Sheets(0).FillLinear(r5, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column)
        'GcSpreadSheet1.Sheets(0).FillLinear(r5, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column, 3)
        gcSpreadSheet1.Sheets(0).FillLinear(r5, GrapeCity.Xaml.SpreadSheet.Data.FillSeries.Column, 3, 20)
    End Sub
See Also

Reference

Worksheet Class
Worksheet Members
Overload List