Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error when binding to mmGridView
Message
De
05/07/2010 07:49:33
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
03/07/2010 08:06:29
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01471237
Message ID:
01471381
Vues:
54
>>>>Hi,
>>>>
>>>>I have a GridView on a form which is giving me this error:
>>>>
>>>>Unable to cast object of type 'OakLeaf.MM.Main.Web.UI.WebControls.mmGridView' to type 'OakLeaf.MM.Main.Web.UI.ImmWebBindingSimple'.
>>>>
>>>>When I do this:
>>>>
>>>>
            this.oPolicyRider.NewRow(dsPolicyRider, this.oPolicyRider.TableName);
>>>>            Guid newPK = (Guid)dsPolicyRider.Tables[0].Rows[dsPolicyRider.Tables[0].Rows.Count - 1]["PolicyRiderPK"];
>>>>
>>>>            // Get the list of Riders & Waivers available for this plan
>>>>            this.dsRiders = this.oPlan.GetRidersAndWaiversByPlan(this.oPolicy.Entity.PlanFK);
>>>>            // default the Rider to the first item in the Riders data session
>>>>            dsPolicyRider.Tables[0].Rows[dsPolicyRider.Tables[0].Rows.Count - 1]["RiderFK"] = this.dsRiders.Tables[0].Rows[0]["PlanPK"];
>>>>
>>>>            // default the CountryFK to the first item in the Country data session
>>>>            //dsAddress.Tables[0].Rows[dsAddress.Tables[0].Rows.Count - 1]["CountryFK"] = this.oCountry.DataSet.Tables[0].Rows[0]["CountryPK"];
>>>>
>>>>            this.BindControl(this.grdRiders);
>>>>
>>>>The error occurs on the BindControl line.
>>>>
>>>>I've done many grids like this and not seen this error before, so I figure it's something simple but can't see what is wrong.
>>>>
>>>>Any help appreciated.
>>>>
>>>
>>>I'm really stuck here. :( Has anybody got any ideas?
>>Frank,
>>Have you tried to step into the BindControl method so you can inspect things to see what might be happening?
>>Also have you verified the value of newPK and checked the DataSet Visualizer on dsRiders and dsPolicyRider?
>>Those don't really make sense to the error message, but I would verify. Based on the error message you are getting it would appear that maybe there is a reference that isn't good or an old dll still exists somewhere in your project bin folder or somewhere. Did you recently upgrade the version of MM? I would check the bin folder and make sure you don't have any old dll's still in there.
>>
>>Beyond that, I would step into that method and maybe get better clues.
>>Tim
>
>
>Hi Tim,
>
>I thought the BindControl was a .NET thing rather than a MM .NET one. :)
>
>I have tried following the instructions in th ehelp to let me step through MM.NET code, but it does not work. Where the help file says:
>
>"After the application is running, go the Visual Studio menu and select Debug | Windows | Modules."
>
>I do not have a Modules option under Windows.
>
>This is in the section "If You STILL Can't Step Through MM .NET Code In the Debugger..."
>
>as setting the paths as suggested in the help didn't work.
>
>I have checked the datasets and values and all looks OK.

What you most likely want to do is add the Debug symbols for MM to your Visual Studio so you can just always step into the MM code as needed. You do this without your application running by going into Tools / Options and under debug select the Symbols. Add them as it shows in the dev guide under Advanced topics / Stepping through MM code in the debugger.

BindControl() is a method in the mmBusinessWebPage.
Tim
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform