Ejemplo n.º 1
0
        private void RenderPartialDataTable(ref Basics.Execution.InvokeResult <Basics.ControlResult.IDataSource> invokeResult)
        {
            ArgumentCollection dataListArgs =
                new ArgumentCollection();
            bool isItemIndexColumnExists = false;

            DataTable repeaterList =
                (DataTable)invokeResult.Result.GetResult();

            foreach (DataColumn dC in repeaterList.Columns)
            {
                isItemIndexColumnExists =
                    string.Compare(dC.ColumnName, "ItemIndex", StringComparison.InvariantCultureIgnoreCase) == 0;

                dataListArgs.AppendKey(dC.ColumnName);
            }

            for (int index = 0; index < repeaterList.Rows.Count; index++)
            {
                dataListArgs.Reset(
                    repeaterList.Rows[index].ItemArray);
                dataListArgs.AppendKeyWithValue("_sys_ItemIndex", index);
                // this is for user interaction
                if (!isItemIndexColumnExists)
                {
                    dataListArgs.AppendKeyWithValue("ItemIndex", index);
                }

                this.RenderRow(index, dataListArgs);
            }

            this._Parent.Parent.Arguments.AppendKeyWithValue(
                this._Parent.DirectiveId,
                new DataListOutputInfo(this._Parent.UniqueId, invokeResult.Result.Count, invokeResult.Result.Total, false)
                );
        }