2

I'm not sure if anyone else has had trouble with this. I'm trying to use a RAD Grid to create a 4-level hierarchy to display to the user. I followed the tutorial on this website, and couldn't get it to work. I know that there is data within the child select statements, but the second layer is always coming up empty. I've checked my select statements against the database, and they're all correct. I believe that the problem is where I'm populating my parameters for my datasources. I've tried using the session method used in the tutorial, but that didn't work. I saw another way of doing it by using just regular asp:Parameters, but that doesn't work either. I think that the issue is with my parameter names because the tutorial puts a large emphasis on making sure they're named properly, but I don't see where it's incorrect. Has anyone else had this issue before using a rad grid?

Thanks for your help.

EDIT

DataKeyNames for the GridTableView and their relational MasterKeyField in the GridRelationField are case sensitive...this caused the issue.

Community
  • 1
  • 1
Aaron
  • 7,431
  • 12
  • 35
  • 37

1 Answers1

2

IIRC The Paramters names for the relation must match both their parents DataKeyField name, and the parameter name you are supplying to SQL / SP.

Ive had this issue before, best to break it down one nested table at a time, eg start with two and work from there.

Also,

<telerik:GridTableView DataKeyNames="ID,loc" DataSourceID="checkDFSource" Width="100%"
                            runat="server">
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="batch_ID" MasterKeyField="ID" />
                                <telerik:GridRelationFields DetailKeyField="loc" MasterKeyField="loc" />
                            </ParentTableRelation>
                            <DetailTables>
                                <telerik:GridTableView DataKeyNames="ID,loc"

Are you sure those datakey names are correct? Ie they are the same for the master and the first child

Edit - Also, maybe i dont fully understand the markup but do you need two GridRelationField entries for each? Ive only ever used one in the past.

Jammin
  • 3,050
  • 2
  • 23
  • 34
  • Yes, the checkDFsource holds batch_id and the batchsource holds ID...both hold loc...unless I'm thinking about this incorrectly. – Aaron Feb 24 '10 at 16:02
  • Yes, I do need 2 for each because it is a composite primary key. I read in the tutorial that that's how it's supposed to be done. I took your advice and am trying just a 2-tier structure, and I can't get the second tier to work...so the problem must first lie there. – Aaron Feb 24 '10 at 16:07
  • Thanks for your help Jammin. Your suggestion of splitting it up lead me to the answer...the whole problem was that I used "Location" in my datakeyname and i used "location" in my masterkeyfield...it's apparently case sensitive. – Aaron Feb 24 '10 at 16:19
  • No problems, ive had similar issues with nested grids - headache! – Jammin Feb 24 '10 at 16:35