CGXGridCore::DoAutoFill
virtual void DoAutoFill(CGXRange& rgFinal, CGXRange& rgStart);??
RgFinal
The final range on which auto fill will be done.
RgStart
The beginning range from which auto fill will be done.
Remarks
The base class performs a fill according to the following rules:
- For single-cell selection and further extension:
- Numeric values are copied as it is in the extended area.
- Alphanumeric values are changed depending on the type of extension:
- If the extension is downwards or rightwards: Alphanumeric values ending with a number are incremented by 1 (for the ending numeric value) in the subsequent cells of the extended area.
- If the extension is upwards or leftwards: Alphanumeric values ending with a number are decremented by 1 (for the ending numeric value) in the subsequent cells of the extended area.
- For multiple cell selection and further extension:
- The formula is decided based on differences in the values of the first 2 cells of the selected range which would be applicable for the same direction of expansion.
- The formula is applied under the following 3 conditions:
- The values in all cells are either numeric or alphanumeric (ending with a number) but not mixed.
- The difference between the values of the cells should be consistent.
- The direction of expansion has multiple selected cells in the same direction (if 2 or more columns are selected and expanding horizontally either left or right and vice versa).
- The values not satisfying the above 3 conditions are copied as it is in the extended area.
- If the expansion is downwards or rightwards, values are incremented and if the expansion is upwards or leftwards, values are decremented based on the formula formed in the first step.
Note: Decimal (float) numbers are treated as numeric, and all formulas are applicable. Only numeric (whole numbers, decimal numbers) and alphanumeric values ending with a number are considered. For all other formats, the values in the selected range are copied in the extended area (which is existing behavior, simple fill).
Override this method to change this behavior. If you override this method, then call the base class for default functionality. You can restrict the area from and to which auto fill will be done by modifying rgFinal and rgStart before calling the base class.
See Also
CGXGridCore:: OnStartAutoFillSelection CGXGridCore::CanChangeAutoFillSelection CGXGridCore::OnAutoFillDone