Hi..
i want to install a Radslider in my project but there is an error in it that i cant fixed :(
i copied the C# and the aspx codes from the page "http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx" but it gives me error like "The name 'startSlider' does not exist in the current context" :((
here are my to check.. it has been a day nearly but i could not find the error :((( please help..
Thanks to Telerik Team in advance..
Adem.
ASPX code:
CS.code:
i want to install a Radslider in my project but there is an error in it that i cant fixed :(
i copied the C# and the aspx codes from the page "http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx" but it gives me error like "The name 'startSlider' does not exist in the current context" :((
here are my to check.. it has been a day nearly but i could not find the error :((( please help..
Thanks to Telerik Team in advance..
Adem.
ASPX code:
<telerik:GridBoundColumn DataField="Yatan" HeaderText="Yatan" UniqueName="Yatan" FilterImageToolTip="Süz" FilterControlAltText="Filtrele" HeaderStyle-Width="250px" SortExpression="Yatan" DataFormatString="{0:###,###.## TL}"> <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle> <FilterTemplate> <div style="float: left; padding: 5px 10px 0 0"> 0 TL </div> <telerik:RadSlider runat="server" ID="RadSlider1" IsSelectionRangeEnabled="true" Style="float: left" MinimumValue="0" MaximumValue="3000" SmallChange="100" Width="135px" ShowDecreaseHandle="false" ShowIncreaseHandle="false" Skin="Sunset" AutoPostBack="True" SelectionStart='<%# startSlider %>' SelectionEnd='<%# endSlider %>' OnClientValueChanged="ClientValueChanged" OnClientSlideStart="ClientSlideStart" OnClientSlideEnd="FreightRangeChanged" /> <div style="float: left; padding: 5px 0 0 10px"> 3000 TL </div> <div style="clear: both"> <asp:Literal ID="Literal1" runat="server" Text='<%# "Showing range between: $" + startSlider + " and $" + endSlider %>' /> </div> <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> <script type="text/javascript"> function FreightRangeChanged(sender, args) { var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>"); var startValue = sender.get_selectionStart(); var endValue = sender.get_selectionEnd(); tableView.filter("Yatan", startValue + " " + endValue, "Between"); } function ClientValueChanged(sender, args) { var tooltip = $find("<%= RadToolTip1.ClientID %>"); if (!tooltip.isVisible()) { var activeHandle = sender.get_activeHandle(); if (!activeHandle) return; tooltip.set_targetControl(activeHandle); tooltip.show(); } else { tooltip.updateLocation(); } tooltip.set_text(args.get_newValue()); } function ClientSlideStart(sender, args) { var tooltip = $find("<%= RadToolTip1.ClientID %>"); tooltip.hide(); } </script> </telerik:RadScriptBlock> </FilterTemplate> </telerik:GridBoundColumn>CS.code:
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;namespace MyFirstBudgetProgram.MyWebPages{ public partial class GelirEkleDuzenle : System.Web.UI.Page { protected void GelirEkleDuzenle_ItemCommand(object source, GridCommandEventArgs e) { if (e.CommandName == RadGrid.FilterCommandName) { Pair filterPair = (Pair)e.CommandArgument; switch (filterPair.Second.ToString()) { case "Yatan": this.startSlider = ((e.Item as GridFilteringItem)[filterPair.Second.ToString()].FindControl("RadSlider1") as RadSlider).SelectionStart; this.endSlider = ((e.Item as GridFilteringItem)[filterPair.Second.ToString()].FindControl("RadSlider1") as RadSlider).SelectionEnd; break; default: break; } } }
protected decimal startSlider { set { ViewState["strSl"] = value; } get { if (ViewState["strSl"] != null) return (decimal)ViewState["strSl"]; else return 0; } } protected decimal endSlider { set { ViewState["endSl"] = value; } get { if (ViewState["endSl"] != null) return (decimal)ViewState["endSl"]; else return 3000; } } protected void Page_Load(object sender, EventArgs e) { } }}