I have an aplication which use a RadGrid, i´m trying to use built-in controls, how ever it is not working.
CS File
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;
using SCAPWEB.ods;
using System.Data;
namespace SCAPWEB.Views
{
public partial class GridStocks : ContentControl
{
ScapWebServ.Service1SoapClient consulta = new ScapWebServ.Service1SoapClient();
protected void Page_Load(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(Page, typeof(Page), "nudgeIE6", "if ($telerik.isIE6) $telerik.$('.itemDetails, .pageNav, .ordersTitle').each( function() { this.style.cssText = this.style.cssText; });", true);
}
protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
RadGrid grid = (RadGrid)sender;
grid.DataSource = consulta.AllExistence("NIS", this.Tipo, this.FechaInicial, this.FechaFinal,this.Flujo).Answer.Select().ToList();
}
protected void Page_PreRender(object sender, EventArgs e)
{
RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
manager.AjaxSettings.AddAjaxSetting(RadGridEstadistica, RadGridEstadistica,LoadingPanel);
}
}
}
ViewFile
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="GridStocks.ascx.cs" Inherits="SCAPWEB.Views.GridStocks" %>
<div style="width: 100%; height: 100%; float: left; margin: 10px">
<telerik:RadGrid ID="RadGridEstadistica" runat="server" Culture="es-ES" Width="100%" Height="500px" AllowSorting="True" UseAllDataFields="True"
AllowPaging="true" PageSize="18" ClientSettings-Scrolling-AllowScroll="true" OnNeedDataSource="RadGrid1_NeedDataSource" AllowFilteringByColumn="True" FilterType="Combined">
<MasterTableView CommandItemDisplay="Top" PagerStyle-Mode="NextPrevAndNumeric" TableLayout="Fixed">
<CommandItemSettings ShowExportToCsvButton="True" ShowExportToExcelButton="True" ShowExportToPdfButton="False" ShowExportToWordButton="False" ShowAddNewRecordButton="false" ShowRefreshButton="false" />
</MasterTableView>
<ClientSettings AllowDragToGroup="true" EnableRowHoverStyle="true">
<Selecting AllowRowSelect="true" />
<Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="360px" />
</ClientSettings>
</telerik:RadGrid>
<telerik:RadAjaxLoadingPanel ID="LoadingPanel" runat="server">
</telerik:RadAjaxLoadingPanel>
</div>