예제 #1
0
        private void RecordClick(string[] eventArguments)
        {
            DisplayView oldMode = DisplayView;
            string oldEditIndex = InternalId;
            DisplayView = DisplayView.Detail;
            MasterTable.m_GotPostBackData = true;
            MasterTable.m_GotData = false;

            InternalId = eventArguments[2];
            // Happens when the user clicks a link in grid-mode.
            if (RowClick != null)
            {
                RowClickEventArgs ea = new RowClickEventArgs
                                           {
                                               ColumnName = eventArguments[1],
                                               EditIndex = eventArguments[2],
                                               Row = MasterTable.Rows[InternalId]
                                           };
                if (ea.Row == null)
                    return;// throw new GridException("Row was not found.");
                RowClick(this, ea);
                if (ea.AcceptChanges == false) // The programmer can abort further actions.
                {
                    DisplayView = oldMode;
                    InternalId = oldEditIndex;
                    if (DisplayView == DisplayView.Grid)
                        MasterTable.m_GotData = false;
                    return;
                }
            }
            if (Trace.IsTracing)
                Trace.Trace(string.Format("{0} : RecordClick!", ClientID));
        }
예제 #2
0
 private void RecordDeleteClickEvent(string[] eventArguments)
 {
     //m_Deleting = true;
     // Happens when the user clicks on the delete thingy on a record
     if (RecordDeleteClick != null)
     {
         RowClickEventArgs ea = new RowClickEventArgs
                                    {
                                        EditIndex = eventArguments[1],
                                        Row = MasterTable[InternalId]
                                    };
         RecordDeleteClick(this, ea);
         if (ea.AcceptChanges == false)
             return;
     }
     // Delete record! :-O
     MasterTable.DeleteRow(eventArguments[1]);
     // m_Deleting = false;
 }