Beispiel #1
0
        protected virtual void OnSelectedIndexChanging(AccordionChangingEventArgs e)
        {
            AccordionChangingEventHandler eventHandler = (AccordionChangingEventHandler)Events[EventSelectedIndexChanging];
            if (eventHandler != null)
            {
                this.SelectedIndex = e.OldIndex;
                eventHandler(this, e);

                if (!e.Cancel)
                {
                    this.SelectedIndex = e.NewIndex;
                    this.OnSelectedIndexChanged(new AccordionChangedEventArgs(e.NewIndex, e.OldIndex, this.SelectedItem, this));
                }
            }
        }
Beispiel #2
0
        public void RaisePostBackEvent(string eventArgument)
        {
            if (eventArgument != null)
            {
                if (eventArgument.StartsWith("selectedindexchanging"))
                {
                    string[] values = eventArgument.Split(':');

                    int selectedIndex = Convert.ToInt32(values[1]);
                    int selectedOldIndex = Convert.ToInt32(values[2]);

                    AccordionChangingEventArgs args = new AccordionChangingEventArgs(selectedIndex, selectedOldIndex);
                    this.OnSelectedIndexChanging(args);
                }
                if (eventArgument.StartsWith("selectedindexchanged"))
                {
                    string[] values = eventArgument.Split(':');

                    int selectedIndex = Convert.ToInt32(values[1]);
                    int selectedOldIndex = Convert.ToInt32(values[2]);

                    AccordionChangedEventArgs args = new AccordionChangedEventArgs(selectedIndex, selectedOldIndex, this.SelectedItem, this);
                    this.OnSelectedIndexChanged(args);
                }
            }
        }