I have filters in my grid all are working fine but when i filter date column attached arror is coming in telerik.grid.filtering.min.js file.Please suggest.
this property is binded with grid column
[DisplayName("My Date")] [DataType(DataType.Date)] public DateTime MyDate{ get { return MyDate; } set { MyDate= value; } }
Thanks
6 Answers, 1 is accepted
Please upgrade to the Q2 2011 SP1 and see if there is change in the observed behavior.
Regards,Rosen
the Telerik team
Now filtering is fine on date column, 2 more issue are coming.
1 - flter is not opening on its proper location see the attached image.
2 - 2 editor templates are not working properly when i click on cell error come in file telerik.grid.editing.min.js error is attached.
Please check and let me know what is the issue.
Thanks
Please provide a small runnable sample (step by step instructions) in which those issues could be recreated locally.
Greetings,Rosen
the Telerik team
I can not send you full code, but i am sending you code of my model,view and controller, I belieave you can see and rectify the problem.
Thanks
Code is:
Model combobox properties are where error is coming
[UIHint("DFPCombo"), Required]
public string DFP {
get { return DFP; }
set { DFP = value; }
}
[UIHint("AssignedClientCombo"), Required]
public string AssignedClient {
get { return AssignedClient; }
set { AssignedClient = value; }
}
EditorTemplates
Its Name is : DFPCombo.ascx
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%= Html.Telerik().DropDownList()
.Name("DFP")
.BindTo(new SelectList((IEnumerable)ViewData["dfps"], "Value", "Text"))
%>
Its Name is: AssignedClientCombo.ascx
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%= Html.Telerik().DropDownList()
.Name("AssignedClient")
.BindTo(new SelectList((IEnumerable)ViewData["assignedClients"], "RefAssignedClient_DESC", "RefAssignedClient_DESC"))
%>
Controller Code :
private void Grid_PopulateDFPCombo()
{
ViewData["dfps"] = new SelectList(new[] { new { Value="Yes", Text="Yes" },
new { Value="No", Text="No"},
new { Value="", Text=""}},
"Value", "Text");
}
private void Grid_PopulateAssignedClientCombo()
{
IEnumerable<AssignedClient> assignedClients = assetManagementService.GetActiveAssignedClients();
assignedClients = assignedClients.Concat(new[] { new AssignedClient { RefAssignedClient_ID = 0, RefAssignedClient_DESC = string.Empty }});
ViewData["assignedClients"] = assignedClients.Select(e => new AssignedClient { RefAssignedClient_ID = e.RefAssignedClient_ID, RefAssignedClient_DESC = e.RefAssignedClient_DESC });
}
View
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Search>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Detail
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script id="assignedClientTemplate" type="text/x-jQuery-tmpl">
<option value="${RefAssignedClient_ID}">${RefAssignedClient_DESC}</option>
</script>
<script type="text/javascript">
function onDDL_EquipmentStateChange(e) {
var ddlState = $("#EqpState").data("tDropDownList");
//var ddlStatus = $("#EqpStatus").data("tDropDownList");
//var values = Grid_PopulateCustomStatusCombo();
//ddlStatus.reload(values);
//alert(ddl.value());
}
var searchClicked = false;
jQuery(document).ready(function () {
})
function OnResize(e) {
// update the hidden values which will be posted as IDictionary<string,int>
var grid = $('#Grid').data('tGrid');
$('#config_0__value').val(grid.$tbody.outerWidth());
var index = $.inArray(e.column, grid.columns) + 1;
$('#config_' + index + '__value').val(e.newWidth);
}
function OnDataBinding(e) {
if (!searchClicked) return false;
var commaSeparatedClientBasket = $('#ClientBasketMulti option:selected').not('option[value=\'-1\']').map(function () {
return this.innerHTML;
}).get().join(',');
var commaSeparatedImportedClient = $('#ImportedClientMulti option:selected').not('option[value=\'-1\']').map(function () {
return this.innerHTML;
}).get().join(',');
e.data = {
"request.FileCode": $('#FileCode').val(),
"request.SerialNo": $('#SerialNo').val(),
"request.TopLevelEquipment": $('#TopLevelEquipment').val(),
"request.EquipmentState": $('#equipState option:selected').text(),
"request.EquipmentStatus": $('#EquipmentStatus option:selected').text(),
"request.DFP": $('#DFP option:selected').text(),
"request.Active": $('#Active option:selected').val(),
"request.OwnerSite": $('#OwnerSite').val(),
"request.ControlSite": $('#ControlSite').val(),
"request.Location": $('#Location').val(),
"request.StampedFC": $('#StampedFC').val(),
"request.StampedSN": $('#StampedSN').val(),
"request.CustomsStatus": $('#CustomStatus option:selected').text(),
"request.ImportType": $('#ImportType option:selected').text(),
"request.ClientBasket": commaSeparatedClientBasket,
"request.ImportClient": commaSeparatedImportedClient,
"request.AssignedClient": $('#AssignedClient option:selected').text(),
"request.ToolFamily": $('#ToolFamily').val()
};
}
function onEdit(e) {
//var combobox = $(e.row).find("#EqpState").data("tDropDownList");
//alert(combobox);
}
</script>
<div class="module" style="margin-bottom:10px">
<div class="caption">
<span>Asset Management</span>
<%Html.ValidationSummary(true);%>
</div>
<div class="body">
<div id="colright" style="height:745px">
<div id="searchCriteria">
<%Html.RenderAction("SearchCriteria", "SearchCriteria"); %>
</div>
<% Html.Telerik().Grid<Search>()
.Name("Grid")
.DataKeys(Keys =>
{
Keys.Add(a => a.Equipment_ID);
})
.ToolBar(commands =>
{
commands.SubmitChanges();
})
.DataBinding(dataBinding => dataBinding.Ajax()
.Select("Select", "Search")
.Update("UpdateResults", "Search"))
//.TableHtmlAttributes(new { style = "width:590px" })
.Columns(columns =>
{
columns.Bound(o => o.FileCode).Width(100);
columns.Bound(o => o.SerialNo).Width(100);
columns.Bound(o => o.RevLevel).Width(100);
columns.Bound(o => o.EqpDescription).Width(150).Title("Description").ReadOnly()
.HeaderTemplate(() => {%>
<table cellspacing="0" class="data-header">
<tr>
<td align="left"><img alt="Can not edit this column." src="../../Content/Images/Cancel_black.GIF" /> Description</td>
</tr>
</table>
<%});
columns.Bound(o => o.Manufacturer).Width(100).Title("Manufacturer");
columns.Bound(o => o.BuildDate).Width(85).Title("Build Date").Format("{0:MM/dd/yyyy}");
columns.Bound(o => o.ControlSite).Width(120).ReadOnly().HeaderTemplate(() => {%>
<table cellspacing="0" class="data-header">
<tr>
<td align="left"><img alt="Can not edit this column." src="../../Content/Images/Cancel_black.GIF" /> Control Site</td>
</tr>
</table>
<%});
columns.Bound(o => o.OwnerSite).Width(100).ReadOnly().HeaderTemplate(() => {%>
<table cellspacing="0" class="data-header">
<tr>
<td align="left"><img alt="Can not edit this column." src="../../Content/Images/Cancel_black.GIF" /> Owner</td>
</tr>
</table>
<%});
columns.Bound(o => o.Location).Width(150).ReadOnly().HeaderTemplate(() => {%>
<table cellspacing="0" class="data-header">
<tr>
<td align="left"><img alt="Can not edit this column." src="../../Content/Images/Cancel_black.GIF" /> Current Location</td>
</tr>
</table>
<%});
columns.Bound(o => o.EqpState).Width(100).Title("Eq. State");
columns.Bound(o => o.EqpStatus).Width(100).Title("Eq. Status");
columns.Bound(o => o.DFP).Width(100).Title("D F P");
columns.Bound(o => o.Remarks).Width(200).ReadOnly().HeaderTemplate(() => {%>
<table cellspacing="0" class="data-header">
<tr>
<td align="left"><img alt="Can not edit this column." src="../../Content/Images/Cancel_black.GIF" /> Current Remarks</td>
</tr>
</table>
<%});
columns.Bound(o => o.Lawson_ID).Width(100);
columns.Bound(o => o.SAP_ID).Width(100).Title("SAP NO");
columns.Bound(o => o.PONumber).Width(150).Title("PO NO");
columns.Bound(o => o.PurchaseInvoiceNo).Width(150).Title("Purchase Inv. NO");
columns.Bound(o => o.SalesInvoiceNo).Width(90).Title("Sales Inv. NO");
columns.Bound(o => o.LegalEntity).Width(100).Title("Legal Entity");
columns.Bound(o => o.CustomsEntry).Width(100).Title("Customs Entry");
columns.Bound(o => o.CustomReceiptNo).Width(100);
columns.Bound(o => o.CustomsStatus).Width(150).Title("Customs Status");
columns.Bound(o => o.ClientBasket).Width(100).Title("Client Basket");
columns.Bound(o => o.AssignedClient).Width(100).Title("Assigned Client");
columns.Bound(o => o.ImportClient).Width(150).Title("Import Client");
})
.ClientEvents(events => events.OnColumnResize("OnResize"))
.ClientEvents(events => events.OnDataBinding("OnDataBinding"))
.ClientEvents(events => events.OnEdit("onEdit"))
.ClientEvents(events => events.OnError("Grid_onError"))
.Editable(editing => editing.Mode(GridEditMode.InCell))
.Pageable(pager => pager.PageSize(20))
.Scrollable(c => c.Height("440px"))
.Sortable(sorting => sorting.SortMode(GridSortMode.MultipleColumn)
.OrderBy(sortOrder =>
{
sortOrder.Add(o => o.FileCode);
sortOrder.Add(o => o.SerialNo);
})
)
.Resizable(resizing => resizing.Columns(true))
.Groupable()
.Filterable()
.KeyboardNavigation()
.Render();
%>
</div>
</div>
</div>
<script type="text/javascript">
function Grid_onError(args) {
if (args.textStatus == "modelstateerror" && args.modelState) {
var message = "Errors:\n";
$.each(args.modelState, function (key, value) {
if ('errors' in value) {
$.each(value.errors, function () {
message += this + "\n";
});
}
});
args.preventDefault();
alert(message);
}
}
</script>
<style type="text/css">
.field-validation-error
{
position: absolute;
display: block;
}
* html .field-validation-error { position: relative; }
*+html .field-validation-error { position: relative; }
.field-validation-error span
{
position: absolute;
white-space: nowrap;
color: red;
padding: 17px 5px 3px;
background: transparent url('<%= Url.Content("~/Content/Common/validation-error-message.png") %>') no-repeat 0 0;
}
/* in-form editing */
.t-edit-form-container
{
width: 350px;
margin: 1em;
}
.t-edit-form-container .editor-label,
.t-edit-form-container .editor-field
{
padding-bottom: 1em;
float: left;
}
.t-edit-form-container .editor-label
{
width: 30%;
text-align: right;
padding-right: 3%;
clear: left;
}
.t-edit-form-container .editor-field
{
width: 60%;
}
</style>
</asp:Content>
I'm afraid that the provided information is not sufficient in order to track the caused for the described issues. Therefore, please consider providing a small sample which recreates the issue. There is not need to provide your full project and database, but a simplified/striped down version in which the unwanted behavior can be observed will be sufficient .
All the best,Rosen
the Telerik team
Thanks alot and waiting for your reply