or
<
telerik:GridBoundColumn
UniqueName
=
"Total"
DataField
=
"Total"
FooterStyle-Font-Bold
=
"true"
FooterStyle-HorizontalAlign
=
"Right"
HeaderStyle-HorizontalAlign
=
"Right"
ItemStyle-HorizontalAlign
=
"Right"
HeaderStyle-Width
=
"95px"
DataFormatString
=
"{0:N} TL"
HeaderText
=
"Tutar"
Aggregate
=
"Sum"
AutoPostBackOnFilter
=
"false"
ShowFilterIcon
=
"true"
>
<
FilterTemplate
>
<
asp:TextBox
CssClass
=
"rgFilterBox"
Width
=
"20"
ID
=
"ToValue"
runat
=
"server"
Text='<%# endValue %>'></
asp:TextBox
>
<
asp:TextBox
CssClass
=
"rgFilterBox"
Width
=
"20"
ID
=
"FromValue"
runat
=
"server"
Text='<%# startValue %>'></
asp:TextBox
>
<
input
type
=
"button"
class
=
"rgFilter"
title
=
"Filtrele"
id
=
"btnValueFilter"
onclick
=
"DoValueRangeFilter()"
value
=
" "
name
=
"btnValueFilter"
>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function DoValueRangeFilter() {
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
var fromval = $.trim($("#<%# ((GridItem)Container).FindControl("FromValue").ClientID %>").val());
var toval = $.trim($("#<%# ((GridItem)Container).FindControl("ToValue").ClientID %>").val());
tableView.filter("Total", fromval + " " + toval, "Between");
}
</
script
>
</
telerik:RadScriptBlock
>
</
FilterTemplate
>
</
telerik:GridBoundColumn
>
protected
void
grd_ItemCommand(
object
sender, GridCommandEventArgs e)
{
if
(e.CommandName == RadGrid.FilterCommandName)
{
Pair filterPair = (Pair)e.CommandArgument;
switch
(filterPair.Second.ToString())
{
case
"OrderDate"
:
this
.startDate = ((e.Item
as
GridFilteringItem)[filterPair.Second.ToString()].FindControl(
"FromDatePicker"
)
as
RadDatePicker).SelectedDate;
this
.endDate = ((e.Item
as
GridFilteringItem)[filterPair.Second.ToString()].FindControl(
"ToDatePicker"
)
as
RadDatePicker).SelectedDate;
break
;
case
"Total"
:
this
.startValue = ((e.Item
as
GridFilteringItem)[filterPair.Second.ToString()].FindControl(
"FromValue"
)
as
TextBox).Text;
this
.endValue = ((e.Item
as
GridFilteringItem)[filterPair.Second.ToString()].FindControl(
"ToValue"
)
as
TextBox).Text;
break
;
default
:
break
;
}
}
}
protected
string
startValue
{
set
{
ViewState[
"strV"
] = value;
}
get
{
if
(ViewState[
"strV"
] !=
null
)
return
(
string
)ViewState[
"strV"
];
else
return
""
;
}
}
protected
string
endValue
{
set
{
ViewState[
"endV"
] = value;
}
get
{
if
(ViewState[
"endV"
] !=
null
)
return
(
string
)ViewState[
"endV"
];
else
return
""
;
}
}
Hi, I've a boundcolumn named total and i want to filter that column having values range between x to y.
i copied codes from demo in this link and modified for myself to decimal range.
thats my issue :
when i fill range textboxes (ex: ToValue=5 and Fromvalue=1) and press filter button
this.startValue
has "1 5" and this.endValue has "5".
i changed the order of textboxes and realized that the first textbox always gets the both boxes value with a space between them.
Am i missing something or is this a bug??
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.Services;
using System.IO;
using Newtonsoft.Json;
public partial class TestInteraceNotes_testNotes1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
}
}
[WebMethod]
public static string afLoadNotes()
{
Web Service call returns a datatable
return Serialize(dt);
}
public static string Serialize(object value)
{
Type type = value.GetType();
Newtonsoft.Json.JsonSerializer json = new Newtonsoft.Json.JsonSerializer();
json.NullValueHandling = NullValueHandling.Ignore;
json.ObjectCreationHandling = Newtonsoft.Json.ObjectCreationHandling.Replace;
json.MissingMemberHandling = Newtonsoft.Json.MissingMemberHandling.Ignore;
json.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
//if (type == typeof(DataRow))
// json.Converters.Add(new DataRowConverter());
//else if (type == typeof(DataTable))
// json.Converters.Add(new DataTableConverter());
StringWriter sw = new StringWriter();
Newtonsoft.Json.JsonTextWriter writer = new JsonTextWriter(sw);
//if (this.FormatJsonOutput)
// writer.Formatting = Formatting.Indented;
//else
// writer.Formatting = Formatting.None;
writer.QuoteChar = '"';
json.Serialize(writer, value);
string output = sw.ToString();
writer.Close();
sw.Close();
return output;
}
}
Much appreciated...
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
|
item.OwnerTableView.DetailTables.OwnerGrid.BackColor = System.Drawing.Color.BlueViolet;
The grid short icon(arrow) doesn’t sort the data grid instead submitting the page.
The source shows as below
<input type="submit" name="ctl00$ContentPlaceHolder1$_grid$ctl00$ctl02$ctl00$ctl01" value=" " title="Sorted asc" class="rgSortAsc" />
I have even tried adding the ImagesPath to the radgrid. But still have the same behaviour.
Any solution?
<telerik:RadAjaxManager id="RadAjaxManager1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="Panel1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<httpRuntime
executionTimeout="90"
maxRequestLength="16384"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="100"
enableVersionHeader="true"
/>