Hello,
I have a radtreelist and I would like to extend a node according to the objects.
this is the .ascx side code :
<telerik:RadTreeList ID="WindowDynamicGrid" runat="server" AllowPaging="false" RenderMode="Lightweight"
Skin="Metro" DataKeyNames="NodeId" ParentDataKeyNames="ParentId" ClientDataKeyNames="Value" Width="800px"
AllowSorting="false" AllowFilteringByColumn="false" GridLines="None" OnNeedDataSource="WindowGrid_NeedDataSource"
AutoGenerateColumns="false" AllowMultiRowSelection="false" ExpandCollapseMode="Client">
<Columns>
<telerik:TreeListSelectColumn HeaderStyle-Width="20" visible="true" />
</Columns>
<ClientSettings>
<ClientEvents OnTreeListCreated="OnTreeListCreated" />
<Selecting AllowItemSelection="true" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" />
</ClientSettings>
</telerik:RadTreeList>
And this is the .ascx.cs side code :
protected void Page_PreRender(object sender, EventArgs e)
{
var expandedOrSelectedItems = controlItems.Cast<HierarchicalComboBoxItem>().Where(i => i.Checked || i.Expanded);
foreach (var expandedOrSelectedItem in expandedOrSelectedItems)
{
var item = WindowDynamicGrid.FindItemByKeyValue("NodeId", expandedOrSelectedItem.NodeId);
if (item != null)
{
item.Expanded = expandedOrSelectedItem.Expanded;
item.Selected = expandedOrSelectedItem.Checked;
}
}
}
Do you have an idea of my problem ?
Thank you
I have a grid which has just one colomn [RoleName] with filtering, multi-filtering enable and it is bound to a data source (Role object- it contains RoleName and RoleID). When the filter renders it displays RoleName. Is there any way that i could change checkbox value to role-ID While the filters still displays RoleName.
@(Html.Kendo().Grid<Keymaster.Models.UserRoleModel>()
.Name(
"grid"
)
.Columns(columns =>
{
columns.Bound(c => c.UserID).Width(140).Filterable(
false
);
columns.Bound(c => c.FirstName).Width(140).Filterable(
false
);
columns.Bound(c => c.LastName).Width(140).Filterable(
false
);
columns.Bound(c => c.Role).Width(140).Filterable(f => f.Multi(
true
).UI(
""
).DataSource(source => source.Read(r => r.Action(
"GetRolesForGrid"
,
"UserActivityByRoles"
))));
columns.Bound(c => c.Location).Width(140).Filterable(
false
);
columns.Bound(c => c.LastLogin).Width(140).Filterable(
false
);
})
.HtmlAttributes(
new
{ style =
"height:500px;width:60%;align:center;margin:0 auto"
})
.Scrollable()
.Sortable()
.Mobile()
.Filterable()
.Pageable(pageable => pageable
.Refresh(
true
)
.PageSizes(
true
)
.ButtonCount(5))
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action(
"GetRolesForGridForDisplay"
,
"UserActivityByRoles"
))
)
)
img
Thanks,
Dinesh B
I'm trying to achieve what was done in this example: http://stackoverflow.com/questions/25439340/how-do-i-display-kendo-grid-inside-kendo-grid-cell
I can in fact achieve the grid within a cell using the 1st concept where I have a grid column defined like this:
columns.Template(o => "").Width(460).Title("QA").ClientTemplate("#= buildInquiryGrid(data) #");
This does work, and each item related to the main grid is displayed along with a button where I try to find the row detail of button click but nothing seems to work.
This the current attempt, but other suggestion on how to do this on standard html table works. Everything always comes back undefined. It seems to me that the HTML table is re-formatted to something else and therefore not find able through standard methods.
function addResponse(id) {
var $row = $(this).parents("tr");
var name = $(this).closest("div").find(".theQuestion").text();
alert(name);
}
Ideally, I'd like to use this:
columns.Template(o => "").Width(460).Title("QA").ClientTemplate(
(Html.Kendo().Grid<Domain.Entities.AIMS.Inquiry>()
.Name("ActionItems_#=ActionItemId#")
.Columns(c =>
{
c.Bound(e1 => e1.Question).Width(200);
c.Bound(e1 => e1.AskedBy).Width(60);
c.Bound(e1 => e1.Asked).Width(80).Format("{0:MM/dd/yyyy}");
c.Bound(e1 => e1.Response).Width(200).Title("Answer");
})
.AutoBind(true)
.DataSource(source1 => source1
.Ajax()
.PageSize(5)
.Read(read1 => read1.Action("GetInquiries", "AIMS", new { id = "#=ActionItemId#" }))
)
.ToClientTemplate()
.ToHtmlString()
));
This will display an empty grid with header row inside each row column whether I have the event called or not.
.Events(e => e.DataBound("onGridDataBound"))
function onGridDataBound(e) {
$('#ActionItems script').appendTo(document.body);
}
Adding this has no affect and I did debug and stop on the line to ensure the event was in fact being called and it was.
The GetInquiries Ajax call to the controller never gets called and I don't see any errors in the console to indicate why. The method does work as I use in the 1st approach.
For completeness here is the Controller Method,
// Approach #1 Works
public JsonResult GetInquiries( int id)
{
var model = _aimsService.GetInquiries(id);
return Json(model, JsonRequestBehavior.AllowGet);
}
// Approach #2
public ActionResult GetInquiries( [DataSourceRequest] DataSourceRequest request,int id)
{
var model = _aimsService.GetInquiries(id);
var result = model.ToDataSourceResult(request);
return Json(result);
}
Maybe the method signature is not appropriate?
I prefer to get the 2nd way working, but will use the 1st method if that can be figured out.
Best Regards,
Hi,
I've been searching on the net for some while to see if there's a way to do this. I'll try my best to formulate what I mean in an understandable way.
Take this view for instance. I was wondering if there's any way to specifiy a parameter to the Action.
What I essentially am trying to do is this; I have a organizational diagram of some business. And say this map only contains the names of the employees and departments. But the view contains different checkboxes for altering the map. If I for instance press a certain checkbox, I would like to see the organizational map with both names AND titles of the employees. So in that case I want to send an int value of for example 1 to the Action to indicate what values the diagram should contain. Is there a way to declare this in the view?
Hi,
I'm facing an issue with popup of a Kendo MVC grid.
The Popup renders a custom "EditData.cshtml" view which is under the following folder structure--> Views/My/EditorTemplates/EditData.cshtml
But if I move the EditorTemplates folder to another folder say "controls" (eg; Views/My/Controls/EditorTemplates/EditData.cshtml), the EditData.cshtml template view is not found by the pop-up and renders the default popup.
The "EditData.cshtml" is also found if I move the Editortemplates folder to the Shared folder (Shared/EditorTemplates/EditData.cshtml).
I want to place the EditorTemplates under the Controls folder in this structure --> Views/My/Controls/EditorTemplates/EditData.cshtml
Any help would be highly appreciated:
Below is the sample Grid :
@(Html.Kendo().Grid<MyViewModel>()
.Name("aliasGrid")
.Columns(columns =>
{
columns.Bound(c => c.AccountNumber).Title("Account No").Width(30);
columns.Bound(c => c.Identifier).Title("Identifier").Width(40);
columns.Bound(c => c.Name).Title("Alias Name");
columns.Bound(c => c.Status.DisplayName).Title("Status/Reason");
columns.Template(@<text></text>).ClientTemplate(@"<a class='k-grid-edit' ><u>Edit</u></a>").Title("Action");
})
.Editable(x => x.Mode(GridEditMode.PopUp).TemplateName("EditData").Window(y=>y.Animation(false))) //rendering a view from the EditorTemplates folder
.Groupable()
.Sortable()
.Filterable()
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.Events(e => e.Edit("CheckAccess"))
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetData", "My").Data("GetMemberNo"))
.Update(update => update.Action("UpdateData", "My"))
.PageSize(10)
.Model(model => model.Id(p => p.ID))
)
)
Im using DropDownList with remote data binding and it works great on Firefox and Chrome, but there is an issue with filtering on Internet Explorer. After few keystrokes it selects top filtered position automatically instead of just filter out unmatching positions.
Code i use:
01.
Html.Kendo().DropDownList()
02.
.Name(
"DropDown"
)
03.
.DataTextField(
"Text"
)
04.
.DataValueField(
"Value"
)
05.
.Filter(FilterType.Contains)
06.
.DataSource(source =>
07.
source.Read(read =>
08.
{
09.
read.Action(
"ReadMethod"
,
"Applications"
);
10.
}))
11.
.Events(e =>
12.
{
13.
e.Select(
"onSelect"
);
14.
e.DataBound(
"onLoad"
);
15.
})
Is there anything that can be done to fix that?
I have a grid that I'm using batch mode for editing. There are only 1 column in the grid that is editable the rest are editable(false). I want to be able to have tab navigation only stop on those editable cells. I've tried setting the tabindex for the non-editable ones to -1 and that doesn't work. I've tried changing my edit mode to InLine but then nothing is editable.
Thanks
Lee
Hi all.
In den Kendo UI docs there is a sample which I would like to use with the MVC wrapper.
But I have no idea how to tell a grid column to have aggregates. Like it is done in the docs.
Any ideas?
Kind regards
Bernd