Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
Hierarchical Webgrid
posted

How to make the Relation of hierarchical webgrid for 3 layes.

I have 3 tables in my dataset and i wrote relation like this.

 

dsMeetExp.Relations.Add(dsMeetExp.Tables[

 

"GetMeetingExpenceByDiv"].Columns[0], dsMeetExp.Tables["GetMeetingExpenceByDiv1"].Columns[0]);

// Define relation for to get tree structure in webgrid.

dsMeetExp.Relations.Add(dsMeetExp.Tables[

 

"GetMeetingExpenceByDiv1"].Columns[2], dsMeetExp.Tables["GetMeetingExpenceByDiv2"

].Columns[2]);

BUt i got "This constraint cannot be enabled as not all values have corresponding parent values." exception

Please help me to resolve this.

Thanks

Annakuttyy

Parents
  • 45049
    Suggested Answer
    posted

    Annakuttyy,

    This sounds like a data error.

    The exception states that you have data in one of your child tables that doesn't have corresponding data in its parent table.  ADO.NET doesn't allow this to occur, so you have to ensure that all of your child data has corresponding parent data.

Reply Children
No Data