This question is locked. New answers and comments are not allowed.
Hey,
I'm trying to follow the Grid Demo with Client Side Selection. I have managed to alter the code to accommodate my database, and when I build the solution I get no errors, and when I run it and navigate to my alerts page my grids are displayed but the page hangs and my grids are empty.
I think the problem is because the customerID in the Northwind database is a string and my ClientID is an integer. So I might have altered the code incorrectly.
My view has another grid which is independent of the selection grids which are on the bottom of the page. This grid is working without any problems.
I was wondering if someone could please have a look at my code and let me know what I have missed?
My View and Controller code is attached below.
Cheers
Staci
I'm trying to follow the Grid Demo with Client Side Selection. I have managed to alter the code to accommodate my database, and when I build the solution I get no errors, and when I run it and navigate to my alerts page my grids are displayed but the page hangs and my grids are empty.
I think the problem is because the customerID in the Northwind database is a string and my ClientID is an integer. So I might have altered the code incorrectly.
My view has another grid which is independent of the selection grids which are on the bottom of the page. This grid is working without any problems.
I was wondering if someone could please have a look at my code and let me know what I have missed?
Cheers
Staci
6 Answers, 1 is accepted
0
Hi Staci,
Usually when something goes wrong there are JavaScript errors in the console which are really helpful to trace the problem. Could you please check the console and tell us if there are any when you load the page?
Kind regards,
Petur Subev
the Telerik team
Usually when something goes wrong there are JavaScript errors in the console which are really helpful to trace the problem. Could you please check the console and tell us if there are any when you load the page?
Kind regards,
Petur Subev
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
0
Staci
Top achievements
Rank 1
answered on 01 Aug 2012, 04:07 PM
Hi Petur,
Thanks for the reply.Do you mean looking at the console within the browser? If so then I have looked in the console within the Developer Tools in Chrome and the details it displays is:
The Controller code has been changed slightly from my original post to:
Cheers,
Staci
Thanks for the reply.Do you mean looking at the console within the browser? If so then I have looked in the console within the Developer Tools in Chrome and the details it displays is:
- POST http://localhost:3704/Alerts/_SelectionClientSide_Clients 500 (Internal Server Error) asset.axd:4
- Uncaught TypeError: undefined is not a function
The Controller code has been changed slightly from my original post to:
public
ActionResult SelectionClientSide()
{
ViewData[
"tbl_ClientDetails"
] = GetClients();
ViewData[
"tbl_Campaigns"
] = GetCampaignsForClient(1);
ViewData[
"id"
] = 1;
return
View();
}
[GridAction]
public
ActionResult _SelectionClientSide_Campaigns(
int
? clientID)
{
clientID = clientID ?? 1;
return
View(
new
GridModel<tbl_Campaign>
{
Data = GetCampaignsForClient(clientID)
});
}
[GridAction]
public
ActionResult _SelectionClientSide_Clients()
{
return
View(
new
GridModel<tbl_ClientDetail>
{
Data = GetClients()
});
}
private
static
IEnumerable<tbl_Campaign> GetCampaignsForClient(
int
? clientID)
{
FrontEndDBSQLDataContext frontend =
new
FrontEndDBSQLDataContext();
return
from campaign
in
frontend.tbl_Campaigns
where campaign.ClientID == clientID
select campaign;
}
private
static
IQueryable<tbl_ClientDetail> GetClients()
{
FrontEndDBSQLDataContext frontend =
new
FrontEndDBSQLDataContext();
return
frontend.tbl_ClientDetails;
}
Cheers,
Staci
0
Pedro
Top achievements
Rank 2
answered on 01 Aug 2012, 06:14 PM
try parsing your var clientID to int
var clientID = parseInt(e.row.cells[0].innerHTML);
var clientID = parseInt(e.row.cells[0].innerHTML);
0
Staci
Top achievements
Rank 1
answered on 01 Aug 2012, 07:32 PM
Thanks Pedro-Martir,
I tried your code but it made no difference. My grids still say No records to display.
Is anyone able to give me some example code where the two grids are related by an id which is an integer instead of a string?
Cheers
I tried your code but it made no difference. My grids still say No records to display.
Is anyone able to give me some example code where the two grids are related by an id which is an integer instead of a string?
Cheers
0
Hello Staci,
It seems that there is an error being thrown in the server while processing your request to the _SelectionClientSide_Clients action.
You could use the debugger (in visual studio hit F5) to trace down the problem.
Kind regards,
Petur Subev
the Telerik team
It seems that there is an error being thrown in the server while processing your request to the _SelectionClientSide_Clients action.
You could use the debugger (in visual studio hit F5) to trace down the problem.
Kind regards,
Petur Subev
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
0
Staci
Top achievements
Rank 1
answered on 06 Aug 2012, 09:40 PM
Ok thanks I will play around with that and hopefully see where I have gone wrong. Thanks again, I appreciate your time.