CreateChildView() private method

private CreateChildView ( DataRelation relation, int index ) : DataView
relation DataRelation
index int
return DataView
Esempio n. 1
0
        /// <include file='doc\DataRowView.uex' path='docs/doc[@for="DataRowView.this1"]/*' />
        /// <devdoc>
        ///    <para>
        ///       Gets or sets a value in a specified column.
        ///    </para>
        /// </devdoc>
        public object this[string property] {
            get {
                if (dataView.Table.Columns.Contains(property))
                {
                    return(row[property, dataView.IsOriginalVersion(this.index) ? DataRowVersion.Original : DataRowVersion.Default]);
                }
                else if (dataView.Table.DataSet != null && dataView.Table.DataSet.Relations.Contains(property))
                {
                    return(dataView.CreateChildView(property, index));
                }

                throw ExceptionBuilder.PropertyNotFound(property, dataView.Table.TableName);
            }
            set {
                if (!dataView.Table.Columns.Contains(property))
                {
                    throw ExceptionBuilder.SetFailed(property);
                }
                if (!dataView.AllowEdit && (row != dataView.addNewRow))
                {
                    throw ExceptionBuilder.CanNotEdit();
                }
                SetColumnValue(dataView.Table.Columns[property], value);
            }
        }
Esempio n. 2
0
 public DataView CreateChildView(DataRelation relation)
 {
     return(DataView.CreateChildView(relation, _index));
 }