The Rotator is displaying 4 buttons... Up, Down, Left, Right.
How can I hide, Up and Down?
Thanks.
JC
I amusing this technique to set an edit link in a grid template column.
editlink.Attributes.Add("href", "#");
editlink.Attributes.Add("onclick", string.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["SubscriberID"], e.Item.ItemIndex));
In the past, I have called a telerik window with a separate aspx page that would display the detail record data for the ID that was passed in the querystring.
I am now working with bootstrap and would like to do this with a bootstrap modal.
Are there any examples where this has been done?
Hi,
Well i am new to Sitefinity. I was trying to implement Dynamic Sorting Filtering and Pagination in client side. I have implemented sorting and pagination. I want to implement excel type filtering as explained in the demo ( http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/excel-like-filtering/defaultcs.aspx) to my department column. The issue is i cant use FilterType="HeaderContext". I get a issue saying The values permitted for this attribute dosent inclue HeaderContext. I went to multiple article but couldn't figure out. Can you please help me out. The other issue is i am binding my radgrid in ajax call i don't know how to bind the data for the filtering in ajax call and how to pass filter data from ajax call to webservice.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="SitefinityWebApp.Pages.test" EnableEventValidation="true" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="sf" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.PublicControls" %>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
<title>Telerik ASP.NET Example</title>
<telerik:RadScriptBlock ID="RadCodeBlock" runat="server">
<script type="text/javascript">
function rad_gridCreated(sender, args) {
tableView = $find("<%= gridData.ClientID %>").get_masterTableView();
makeServiceCall(updateGrid, serviceFailure);
};
function serviceFailure(error) { alert("failure " + error.statusText); };
function updateGrid(result) {
tableView.set_dataSource(result.employee);
tableView.dataBind();
tableView.set_virtualItemCount(result.totalCount);
};
function getRequestStringfyData(startIndex, pageSize, sortExpression, filterExpression) {
return JSON.stringify({
startIndex: startIndex,
maximumRows: pageSize,
sortExpression: sortExpression,
filterExpression: filterExpression
});
};
function makeURL(startIndex, pageSize, sortExpression, filterExpression) {
return "/CustomServices/NewsService/getmyWork?startIndex=" + startIndex + "&maximumRows=" + pageSize + "&sortExpression=" + sortExpression + "&filterExpression=" + filterExpression;
};
function makeServiceCall(onCallBackSuccess, onCallbackFailure) {
var pageSize = tableView.get_pageSize(); var startIndex = (tableView.get_currentPageIndex() * pageSize);
var sortExpression = tableView.get_sortExpressions().toString(); var filterExpression = "";
$.ajax({
type: "GET",
url: makeURL(startIndex, pageSize, sortExpression, filterExpression),
dataType: "json",
data: getRequestStringfyData(startIndex, pageSize, sortExpression, filterExpression),
contentType: "application/json; charset=utf-8",
processData: true,
success: onCallBackSuccess,
error: onCallbackFailure
});
};
function radgrid_OnCommand(sender, args) {
tableView = sender.get_masterTableView();
makeServiceCall(updateGrid, serviceFailure);
};
</script>
</telerik:RadScriptBlock>
</head>
<body>
<form id="form1" runat="server">
<script type="text/javascript" src="test.js"></script>
<telerik:RadScriptManager runat="server" ID="RadScriptManager1">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
</Scripts>
</telerik:RadScriptManager>
<div style="margin-top: 100px;">
<asp:UpdatePanel ID="ProductsUpdatePanel" runat="server" ChildrenAsTriggers="False" UpdateMode="Conditional">
<ContentTemplate>
<telerik:RadGrid RenderMode="LightWeight" ID="gridData" name="gridData" runat="server" EnableViewState="false" AutoGenerateColumns="false" AllowPaging="true" PageSize="10" AllowSorting="true" FilterType="HeaderContext">
<MasterTableView TableLayout="Fixed">
<Columns>
<telerik:GridBoundColumn DataField="EmpID" HeaderText="Emp ID" ReadOnly="true" SortExpression="EmpID" UniqueName="EmpID" />
<telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" ReadOnly="true" SortExpression="FirstName" UniqueName="FirstName" />
<telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" ReadOnly="true" SortExpression="LastName" UniqueName="LastName" />
<telerik:GridBoundColumn DataField="Department" HeaderText="Department" ReadOnly="true" SortExpression="Department" UniqueName="Department" />
</Columns>
</MasterTableView>
<ClientSettings EnablePostBackOnRowClick="false">
<ClientEvents OnCommand="radgrid_OnCommand" OnGridCreated="rad_gridCreated" />
</ClientSettings>
</telerik:RadGrid>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
Interface
namespace SitefinityWebApp.CustomServices
{
[ServiceContract]
[AllowDynamicFields]
public interface INewsService
{
[OperationContract]
[WebInvoke(Method = "GET", UriTemplate = "getmyWork?startIndex={startIndex}&maximumRows={maximumRows}&sortExpression={sortExpression}&filterExpression={filterExpression}", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)]
SitefinityWebApp.CustomServices.NewsService.DynamicItemsContext DoWork(int startIndex, int maximumRows, string sortExpression, string filterExpression);
}
wcf class
[ServiceBehavior(IncludeExceptionDetailInFaults = true, InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Single)]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
public class NewsService : INewsService
{
public DynamicItemsContext RetrieveItems(int startIndex, int maximumRows, string sortExpression)
{
DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager();
Type testType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.Employees.Employee");
var dynamicItems = dynamicModuleManager.GetDataItems(testType).Where(d => d.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Master);
if (!string.IsNullOrEmpty(sortExpression))
dynamicItems = dynamicItems.OrderBy(sortExpression);
List<Employee> employees = new List<Employee>();
foreach (var item in dynamicItems)
{
var employee = new Employee();
employee.FirstName = item.GetValue("FirstName").ToString();
employee.LastName = item.GetValue("LastName").ToString();
employee.Department = item.GetValue("Department").ToString();
employee.EmpID = item.GetValue("EmpID").ToString();
employees.Add(employee);
}
var dynamicItemContext = new DynamicItemsContext();
dynamicItemContext.totalCount = employees.Count;
dynamicItemContext.employee = employees;
dynamicItemContext.employee = dynamicItemContext.employee.Skip(startIndex).Take(maximumRows);
// employees.Skip(startIndex).Take(maximumRows);
return dynamicItemContext;
}
public DynamicItemsContext DoWork(int startIndex, int maximumRows, string sortExpression, string filterExpression)
{
var items = RetrieveItems(startIndex, maximumRows, sortExpression);
return items;
}
public class Employee
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string Department { get; set; }
public string EmpID { get; set; }
}
[DataContract]
[KnownType(typeof(Employee))]
public class DynamicItemsContext
{
[DataMember]
public IEnumerable<Employee> employee { get; set; }
[DataMember]
public int totalCount { get; set; }
}
}

<telerik:RadGrid ID="ReporteGridView" runat="server" AllowPaging="True" PageSize="20" AllowAutomaticInserts="false" AllowSorting="True" ShowStatusBar="true" Width="880px"> <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true" /> <MasterTableView NoMasterRecordsText="No hay registros para mostrar" ShowHeadersWhenNoRecords="True" PageSize="20" CommandItemDisplay="None" Width="100%"> <PagerStyle FirstPageToolTip="Primera página" LastPageToolTip="Ultima página" NextPagesToolTip="Página siguiente" PageSizeLabelText="Tamaño página" PrevPagesToolTip="Página anterior" /> <RowIndicatorColumn> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> </MasterTableView> <ClientSettings> <Scrolling AllowScroll="true" UseStaticHeaders="True"></Scrolling> </ClientSettings></telerik:RadGrid>
.RadInput_MMSM_MTS input.riRead { background-color: rgb(216, 216, 216);}.RadInput_MMSM_MTS input.riRead { background-color: #D8D8D8;}html body .RadInput_MMSM_MTS .riTextBox, html body .RadInputMgr_MMSM_MTS { background: none repeat scroll 0 0 #FFFFFF; border-color: #898772; color: #272722; font: 12px "segoe ui",arial,sans-serif;}<telerik:RadTextBox ID="RadTextBox1" runat="server" ReadOnly="True"> </telerik:RadTextBox>
I'm having an issue with the veritcal size of the Radgrid in chrome. Each time a control refreshes the grid the grid resizes and I lose the command menu at the bottom of the grid.
This issue only happens in Chrome, i'm unable to replicate it on other browsers.

Hi
I am trying to style the generated table using the 'ApplyStylesToPdfExport' example, and all is working with fonts, and alignment, but I haven't found the way to set cell padding. I tried using cell.style("cellpadding") = "5px" and, a few variants, but I can't make it work. What is the right way to do this?
I am probably being dumb...
Thanks a lot
Clive

This code isn't firing the custom validator's ServerValidate event for my GridDropDown column. The exact same code works fine if I hook it into a standard GridBoundColumn with an underlying TextBox control and the necessary underlying control type changes.
protected void dtgFields_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
GridEditableItem item = e.Item as GridEditableItem;
GridDropDownListColumnEditor editor = (GridDropDownListColumnEditor)item.EditManager.GetColumnEditor("EDocFieldTagCtl");
TableCell cell = (TableCell)editor.ComboBoxControl.Parent;
CustomValidator validator = new CustomValidator();
validator.ControlToValidate = editor.ComboBoxControl.ID;
validator.ErrorMessage = "testing custom validator";
validator.Display = ValidatorDisplay.Dynamic;
validator.ServerValidate += new ServerValidateEventHandler(tagvalidate);
cell.Controls.Add(validator);
}
}