Hi All,
I have an entirely code-behind C# Radgrid solution, living in SharePoint. I have implemented a detail table within my mastertable and the hierarchy (parent-child) functionality of the grid works well. However, this is only when I use RadGrid.DataSource = SQLDataSource. Doing this breaks column sorting though.
Changing my code to RadGrid.DataSourceID = SQLDataSource.ID allows me to sort the columns but breaks the hierarchy. Does anyone have any suggestions on how to fix this?
Thanks,
Mark
I have an entirely code-behind C# Radgrid solution, living in SharePoint. I have implemented a detail table within my mastertable and the hierarchy (parent-child) functionality of the grid works well. However, this is only when I use RadGrid.DataSource = SQLDataSource. Doing this breaks column sorting though.
Changing my code to RadGrid.DataSourceID = SQLDataSource.ID allows me to sort the columns but breaks the hierarchy. Does anyone have any suggestions on how to fix this?
Thanks,
Mark
5 Answers, 1 is accepted
0

Mark
Top achievements
Rank 1
answered on 17 Dec 2013, 10:10 PM
OK, it looks like I need to create a new SQLDataSource for the DetailTable to work, but unfortunately, I'm getting a "must declare the scalar variable '@EmployeeID' for example from this link:
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/hierarchy-with-templates/defaultcs.aspx
It's all code-behind. . .
Thanks,
Mark
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/hierarchy-with-templates/defaultcs.aspx
It's all code-behind. . .
Thanks,
Mark
0

Shinu
Top achievements
Rank 2
answered on 18 Dec 2013, 07:34 AM
Hi Mark,
Please make sure that you have set the DataKeyNames as EmployeeID.
ASPX:
Thanks,
Shinu
Please make sure that you have set the DataKeyNames as EmployeeID.
ASPX:
<
MasterTableView
DataKeyNames
=
"EmployeeID"
>
Thanks,
Shinu
0

Mark
Top achievements
Rank 1
answered on 18 Dec 2013, 02:05 PM
Thanks Shinu!
It's all in code behind though, so it looks like this:
RadGrid.MasterTableView.DataKeyNames = new string[] {
It still doesn't work though . . . :-(
It's all in code behind though, so it looks like this:
RadGrid.MasterTableView.DataKeyNames = new string[] {
"EmployeeID"};It still doesn't work though . . . :-(
0

Shinu
Top achievements
Rank 2
answered on 19 Dec 2013, 03:56 AM
Hi Mark,
I couldn't replicate the issue, can you please provide your full code snippet.
Thanks,
Shinu
I couldn't replicate the issue, can you please provide your full code snippet.
Thanks,
Shinu
0

Wendy Prince
Top achievements
Rank 1
answered on 19 Dec 2013, 06:02 PM
_