Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with New button
Message
 
À
21/07/2008 16:17:24
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01332870
Message ID:
01332950
Vues:
8
Tim,
I want to use the default behavior if possible. I modified my click method as shown below but it just ignores the base.OnClick line. I set a break on the base.OnClick line but it didn't follow that code anywhere. Did I type something wrong? Thanks.
         private void btnNew_Click(object sender, EventArgs e)
        {
            base.OnClick(e);
            this.ChangeEditStatus(((mmButton)sender).Parent, "Edit");
        }
>>Hi Tim,
>>I do have some code in the mmButtonNew click method. I have some code that needs to execute right after the new row is added that needs to reside in the form, so a hook method won't work. Where should I put that code? I think I have another form that has code in the click method that works correctly. Thanks.
>
>It is ok to have code there but if you are relying on the default mechanism of the New Button you would also need a "base.OnClick(e)" in there to get the default behavior.
>
>I had thought you might have inadvertantly added a click method causing the button to stop working. If you put a break point on the first line of code in your button does it still call the default behavior? Or are you doing all the save stuff in the button yourself?
>Tim
>
>>
>>>Hi Linda,
>>>
>>>>I have a business form that has multiple search criteria by which users can locate records and have them displayed in a grid. When the user goes to the detail tab, the currently selected row is displayed. At one time, the new button worked correctly. Now, when I press the New button, I do not get a new row. The only things I can think of that might have affected this are (1)that I decided to use the Business Layer Generator to generate stored procedures and (2) that I put some code in the DetailPage_Enter method to reset the values of a couple of combo boxes. Any idea what may be causing the problem? Thanks.
>>>
>>>Is this an mmButtonNew in the form you are talking about? You might want to verify you didn't inadvertantly double click it and cause a Click Event to be created for this button as I think that would break the MM behavior already in the button.
>>>Tim
Linda Harmes
HiBit Technologies, Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform