Hi,
I am using Kendo Grid for the first time. The existing page already has the kendo UI grid, I am trying to add a filter dropdown to one of the existing columns. I want the dropdown to show the unique list of values from the grid itself.
<asp:Content ID="Content1" ContentPlaceHolderID="MyPage" runat="server">
<script>
function RefreshTables() {
var viewType = document.getElementById('<%=hfEmployeeTypeId.ClientID%>').value
var myChartModel = kendo.data.Model.define({
id: "myChartId",
fields: {
PatientId: {
type: "number"
},
PatientName: {
type: "string"
},
DoctorFullName: {
type: "string"
},
Impression: {
type: "string"
}
}
});
$("#gvMyChart").kendoGrid({
sortable: true,
dataSource: {
schema: {
model: myChartModel
}
},
pageable: {
pageSize: 20,
pageSizes: true
},
filterable: {
extra: false
},
columns: getColumns(viewType),
resizable: true
});
if ($("#gvMyChart").data("kendoGrid")) {
$("#gvMyChart").data("kendoGrid").hideColumn("PatientId");
}
}
function getColumns(viewType) {
var Columns = [{
width: 1,
field: "PatientId"
}, {
width: 180,
field: "PatientName",
title: "Patient Name",
attributes: { style: "text-decoration: none;color: White;white-space: nowrap;" },
template: "<a href='javascript:openPatientSummaryWindow(#=PatientId#)'>#=PatientName#</a>",
filterable: false
}, {
width: 180,
field: "ReferringDoctorDescription",
title: "Referring Doctor",
filterable: true
}, {
field: "Impression",
title: "Impression",
filterable: false
}];
return Columns;
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MyTableContent" runat="server">
<asp:GridView ID="gvMyChart" runat="server" DataSourceID="dsMyCharts"
GridLines="None" Enabled="True" Visible="True" AutoGenerateColumns="False"
Width="100%" OnDataBound="gvMyChart_DataBound" CssClass="GridViewStyle" ClientIDMode="Static">
<Columns>
<asp:BoundField HeaderText="PatientId" DataField="PatientId" />
<asp:BoundField HeaderText="Patient Name" DataField="PatientName" />
<asp:BoundField HeaderText="Referring Doctor" DataField="ReferringDoctorDescription" SortExpression="ReferringDoctorDescription" />
<asp:BoundField HeaderText="Impression" DataField="Impression" SortExpression="Impression" />
</Columns>
<FooterStyle CssClass="GridViewFooterStyle" />
<RowStyle CssClass="GridViewRowStyle" />
<PagerStyle CssClass="GridViewPagerStyle" />
<AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
<HeaderStyle CssClass="GridViewHeaderStyle" />
</asp:GridView>
<asp:ObjectDataSource ID="dsMyCharts" runat="server" TypeName="MyLibrary.MyPage"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetMyCharts">
<SelectParameters>
<asp:ControlParameter ControlID="ddlPractices" Name="LocationIds" PropertyName="SelectedValue" />
<asp:Parameter Name="user" Type="Object" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:HiddenField ID="hfEmployeeTypeId" runat="server" Value=""></asp:HiddenField>
</asp:Content>
So, how to create a dropdown filter for ReferringDoctorDescription field and have the dropdown show the values from the result of the column?
$("#panelbar").data('kendoPanelBar').bind('select', function (e) { e.preventDefault(); });
var
event
= $("#panelbar").data('kendoPanelBar').bind('select', function (e) {
event
.preventDefault(); });
we have just upgraded to Kendo UI Web v2012.1.503. I currently have 2 columns in my grid (col1 and col2)... after clicking add new record and populating col1 with text the save event is fired... e.model.Col1 is empty although their is text in the control. I then proceed in populating col2 with text inspecting the event arguments now showse.model.Col1 with the correct text but e.model.Col2 is empty. Only when I proceed and edit one of fields for the third time are both event arguments populated but the actual argument value is not in sync with the actual value in the grid column.Is this a known issue as I want to make a call to the server only when both argument fields are populated and reflect the actual values in the grid. Many thanks in advance.
Is there a way to get the image name and image extension from the KendoUI Image Editor in imageRendered event?
I have tried to find the image name and the image extension from the event data (image instance). But could not find a property which has that.
E.g. I expected it to have something like e.image.extension and e.image.type etc.
I have a Grid that has two Date field columns. I've implemented filters for both columns as shown below. I'd like to assign an ID to the 4 datepickers that are created to be able to reference them later.
field: "issuedDate",
title: "Issued Date",
template: '#= kendo.toString(new Date(issuedDate), "MM/dd/yyyy HH:mm" ) #',
width: "140px",
filterable: {
ui: "datepicker",
//extra: true,
operators: {
date: {
gte: "From",
lte: "To",
}
},
messages: { "info": "Issued Date From -> To " },
}
field: "receivedDate",
title: "Received Date",
template: '#= kendo.toString(new Date(receivedDate), "MM/dd/yyyy HH:mm" ) #',
width: "140px",
filterable: {
ui: "datepicker",
operators: {
date: {
gte: "From",
lte: "To",
}
},
messages: { "info": "Received Date From -> To " },
}
A kendo treeview is looking rather off, as per the attached file.
I'm not sure how to resolve it exactly as I haven't made any changes to markup or styles.
Though, I feel some styles might be overriding the ones that the treeview uses.
In a bower.json file is the following entry in "dependencies":
"kendo-ui": "https://bower.telerik.com/bower-kendo-ui.git#2017.2.907"
The latest 2020 version was trialled, but there were issues with icons. We are running some old stuff. But since recently, the treeview was completely fine.
Does anyone have any suggestions as to what I should look for to see if I can get the styles to work properly?
Hello everyone,
I have an interesting dilemma.
I have a database column that contains HTML. I have encoded set to false and it appears as it should on the grid.
The issue is I have a filter on the row set to contains and whenever you type in the filter box it is displaying the html instead of the text within the html. Ex: <h1>Test</h1> instead of just Test
I understand why this is happening but I was wondering if anyone had a way to "encoded: false" on the filter dropdown "results" so that the filtered suggestions would only contain text and not the HTML tags