This question is locked. New answers and comments are not allowed.
Hi,
I am trying to pattern my grid after this demo ..... http://demos.telerik.com/aspnet-mvc-beta/grid/selectionclientside
My Grid looks like this ...
Basically I am trying to get the alert to who my selected company name ? With this code, three things happen ...
1 - I cannot even page forward using my action.
2 - My grid has a green background.
3 - My next page number shows up in grey and when I click on it, the next screen is a full page with no formatting.
This is my action ...
Thanks for any advice
I am trying to pattern my grid after this demo ..... http://demos.telerik.com/aspnet-mvc-beta/grid/selectionclientside
My Grid looks like this ...
| <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<BCAnalytics.Models.CompanyVM>>" %> |
| <%--fx 20100304 - Added datepicker and calendar min js files to keep grid row height correct for |
| version 2010.1.222 * ALSO, COMMENT OUT THESE JS FILES TO USE JQUERY INTELLISENCE --%> |
| <script src="../../Scripts/2010.1.222/telerik.datepicker.min.js" type="text/javascript"></script> |
| <script src="../../Scripts/2010.1.222/telerik.calendar.min.js" type="text/javascript"></script> |
| <%if (false) |
| {%> |
| <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script> |
| <% }%> |
| <h3><%= Html.ActionLink((String)Resources.BCAResources.stdClose, "Index", "Work", new { workindex = 0 }, null)%> |
| <br /> |
| <i style="color:Red;"><%=Session["iqResult"]%> </i> </h3> |
| <%= Html.Telerik().Grid(Model) |
| .Name("CompanyGrid") |
| .Columns(columns => |
| { |
| columns.Add(o => o.cCompanyName).Width(185).Title((string)Resources.BCAResources.coxCompany); |
| columns.Add(o => o.cPhone).Title((string)Resources.BCAResources.stdPhone).Width(75); |
| columns.Add(o => o.cGroupCode).Title((string)Resources.BCAResources.coxGroupCode).Width(100); |
| columns.Add(o => o.cEmail).Format(Html.Mailto("{0}", "{0}")).Encoded(false).Width(150); |
| columns.Add(o => o.cDateUpdated).Format("{0:MM/dd/yyyy}").Width(85).Title((string)Resources.BCAResources.stdUpdated); |
| columns.Add(o => o.cCompanyNo).Format(Html.ActionLink((String)Resources.BCAResources.stdEdit, "Index", "Work", new { workindex = 2, OtherParms = "{0}" }, null).ToString()).Encoded(false).Title("").Width(32).Filterable(false); |
| columns.Add(o => o.cCompanyNo).Format(Html.ActionLink((String)Resources.BCAResources.stdDelete, "CompanyDelete", new { Id = "{0}" }, null).ToString()).Encoded(false).Title("").Width(50).Filterable(false); |
| }) |
| .Selectable() |
| .ClientEvents(events => events.OnRowSelected("onRowSelected")) |
| .DataBinding(dataBinding => dataBinding. |
| Ajax().Select("_AjaxBindingCompany", "Company")) |
| .RowAction(row => |
| { |
| rowrow.Selected = row.DataItem.cCompanyName.Length>0; |
| }) |
| .Pageable() |
| .Sortable(sort => sort.SortMode(GridSortMode.MultipleColumn)) |
| .Scrollable(scrolling => scrolling.Height(253)) |
| .Filterable()%> |
| <p><%= Html.ActionLink((String)Resources.BCAResources.coxCreateNewCompany, "Index", "Work", new { workindex = 2, OtherParms = "Create" }, null)%></p> |
| <script type="text/javascript"> |
| function onRowSelected(e) { |
| var customerN = e.row.cells[0].innerHTML; |
| alert("rowSelected e " + customerN); |
| } |
| </script> |
Basically I am trying to get the alert to who my selected company name ? With this code, three things happen ...
1 - I cannot even page forward using my action.
2 - My grid has a green background.
3 - My next page number shows up in grey and when I click on it, the next screen is a full page with no formatting.
This is my action ...
| // do the ajax binding |
| [GridAction] |
| public ActionResult _AjaxBindingCompany() |
| { |
| IEnumerable<CompanyVM> model = GetCompanies(); |
| return View(new GridModel |
| { |
| Data = model |
| }); |
| } |
Thanks for any advice