Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error when binding to mmGridView
Message
De
03/07/2010 08:06:29
 
 
À
02/07/2010 09:48:00
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01471237
Message ID:
01471337
Vues:
44
>>>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.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform