Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top