Dev2.Runtime.ServiceModel.Data.RecordsetRecord.Add C# (CSharp) Method

Add() public method

public Add ( RecordsetCell item ) : void
item RecordsetCell
return void
        public void Add(RecordsetCell item)
        {
            if(item == null)
            {
                throw new ArgumentNullException("item");
            }
            _cells.Add(item);
        }

Usage Example

Exemplo n.º 1
0
        /// <summary>
        /// Sets the value of the field at the given field index in the given row.
        /// <remarks>
        /// A new row is added if <paramref name="record"/> is <code>null</code>.
        /// A new field is added if <paramref name="fieldIndex"/> is greater than or equal to <see cref="Fields"/> count.
        /// </remarks>
        /// </summary>
        /// <param name="record">The record to be updated; may be null.</param>
        /// <param name="fieldIndex">The index of the field to be updated.</param>
        /// <param name="value">The value.</param>
        public void SetValue(ref RecordsetRecord record, int fieldIndex, string value)
        {
            if (record == null)
            {
                record = NewRecord();
                Records.Add(record);
            }

            var cell = new RecordsetCell
            {
                Name  = record.Label + "." + Fields[fieldIndex].Alias,
                Label = Fields[fieldIndex].Alias,
                Value = value
            };

            if (fieldIndex >= record.Count)
            {
                record.Add(cell);
            }
            else
            {
                record[fieldIndex] = cell;
            }
        }
All Usage Examples Of Dev2.Runtime.ServiceModel.Data.RecordsetRecord::Add