コード例 #1
0
        protected override void CBDeleteRow(string[] args)
        {
            LoadDataIfNotBinded(true);

            var keyValueFromScript = DataProxy.GetKeyValueFromScript(args[0]);

            if (keyValueFromScript == null)
            {
                return;
            }

            var visibleIndex = FindVisibleIndexByKeyValue(keyValueFromScript);

            if (HasEventMarker(args))
            {
                CommandButtonCallbackRegistrator.Register(
                    new ASPxGridViewCommandButtonCallbackEventArgs(
                        ColumnCommandButtonType.Delete,
                        visibleIndex
                        )
                    );
            }

            DeleteRow(visibleIndex);
        }
コード例 #2
0
        protected new void CBAddNewRow(string[] args)
        {
            if (HasEventMarker(args))
            {
                CommandButtonCallbackRegistrator.Register(
                    new ASPxGridViewCommandButtonCallbackEventArgs(
                        ColumnCommandButtonType.New,
                        ParseAddNewRowArguments(args)
                        )
                    );
            }

            AddNewRow();
        }
コード例 #3
0
        protected virtual void OnInitNewRow_BaseImplementation(ASPxDataInitNewRowEventArgs e)
        {
            if (SettingsText.InitNewRow.CommandUpdate.IsNotEmpty())
            {
                SettingsText.CommandUpdate = SettingsText.InitNewRow.CommandUpdate.Truncate(
                    SettingsText.InitNewRow.CommandUpdateWidth
                    );
            }

            if (SettingsText.InitNewRow.PopupEditFormCaption.IsNotEmpty())
            {
                SettingsText.PopupEditFormCaption = SettingsText.InitNewRow.PopupEditFormCaption.Truncate(
                    SettingsText.InitNewRow.PopupEditFormCaptionWidth
                    );
            }


            if (this.IsGrouped())
            {
                var lastCallbackOfNewButton = CommandButtonCallbackRegistrator.InCallbacks().FindLastOf(ColumnCommandButtonType.New);

                if (lastCallbackOfNewButton != null)
                {
                    var dataSourceIndex = lastCallbackOfNewButton.VisibleIndex;

                    var dataSource = this.GetItem(dataSourceIndex);

                    if (dataSource != null)
                    {
                        var propertyNames = this.GroupFieldNames();

                        var groupPropertyValues = dataSource.FetchPropertyValues(propertyNames);

                        e.NewValues.Include(groupPropertyValues);
                    }
                }
            }

            if (this.IsFiltered())
            {
                e.NewValues.Include(FilterExpression.FetchPropertyValues());
            }
        }