Found an additional issue when implementing this on a project:
When aria-enabled=true and we follow their instructions if we have a gridnumericcolumn in the grid, then we get a finding that "Elements must only use supported ARIA attributes" because To solve this problem, you need to fix the following:
ASPX
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" AllowFilteringByColumn="true" OnNeedDataSource="RadGrid1_NeedDataSource" EnableAriaSupport="true">
<ClientSettings>
<ClientEvents OnGridCreated="OnGridCreated" />
</ClientSettings>
<MasterTableView>
<Columns>
<telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID" />
<telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="Name" />
<telerik:GridCheckBoxColumn DataField="IsActive" HeaderText="Active" UniqueName="IsActive" />
<telerik:GridNumericColumn DataField="Score" HeaderText="Score" UniqueName="Score" DataType="System.Int32" DataFormatString="{0:N0}" />
</Columns>
</MasterTableView>
</telerik:RadGrid>
ASPX.CS
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
// Creating a dummy data source
var data = new List<DummyData>
{
new DummyData { ID = 1, Name = "John Doe", IsActive = true, Score = 88 },
new DummyData { ID = 2, Name = "Jane Doe", IsActive = false, Score = 92 }
};
RadGrid1.DataSource = data;
}
public class DummyData
{
public int ID { get; set; }
public string Name { get; set; }
public bool IsActive { get; set; }
public int Score { get; set; }
}
Hi,
How can I translate the "clear" button in the mobile Filter Window? I manage to translate everything in that window except the clear button:
King regards
Blas González
HeaderContextMenu filter functions such as "GreaterThanOrEqualTo", "LessThanOrEqualTo" are not working.
This issue happens with the Header Context Menu. The following scenarios are affected:
When the Grid is set to have FilterType="HeaderContext" and filtering by a keyword that starts with a question mark "?MyKeyword", an exception will be thrown: System.ArgumentOutOfRangeException: Index was out of range.
The issue can be replicated in our online demo Excel-like Filtering.
Note that the demos will not display the exact exception because it is handled by the CustomError mechanism of the demo site.
<script runat="server">
protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
(sender as RadGrid).DataSource = Enumerable.Range(1, 10).Select(x => new { Id = x, Name = "Name " + x });
}
</script>
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecorationZoneID="test" DecoratedControls="All" />
<div id="test">
<telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource" AutoGenerateColumns="true"
EnableHeaderContextMenu="true" FilterType="HeaderContext">
</telerik:RadGrid>
</div>
By changing the application's thread Culture to Persian (fa-IR) and the Grid's RenderMode to Lightweight, the application fails with "System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values."
1. Change the application culture to Persian
protected void Page_Init(object sender, System.EventArgs e)
{
var culture = new System.Globalization.CultureInfo("fa-IR");
System.Threading.Thread.CurrentThread.CurrentCulture = culture;
System.Threading.Thread.CurrentThread.CurrentUICulture = culture;
}
2. Change the RenderMode of the Grid to Lightweight
<telerik:RadGrid ID="RadGrid1" runat="server" RenderMode="Lightweight">
</telerik:RadGrid>
Replicated when the ClickToOpen is enabled:
protected void Page_Load(object sender, EventArgs e)
{
RadGrid1.HeaderContextMenu.ClickToOpen = true;
}
WORKAROUND: Loading the following script under the script manager
<script>
var original = Telerik.Web.UI.GridColumn.prototype._onContextMenuItemClicking;
Telerik.Web.UI.GridColumn.prototype._onContextMenuItemClicking = function (sender, args) {
original.call(this, sender, args);
var item = args.get_item();
var itemValue = item.get_value();
if (itemValue == "FilterList" || itemValue == "FilterMenuContainer" ||
itemValue == "AggregatesContainer" || itemValue == "FilterMenuParent" || itemValue == "ColumnsContainer" ||
(Telerik.Web.UI.RadMenuItem.isInstanceOfType(item.get_parent()) && item.get_parent().get_value() == "ColumnsContainer")) {
if (sender.get_clickToOpen()) {
args.get_item().open();
}
}
}
</script>
I issue is replicated consistently with the following simple setup, when the page is scrolled so the grid is on the top and right-clicking the column, to open the menu
<div style="height: 200px"></div>
<telerik:RadGrid ID="RadGrid2" runat="server" AllowFilteringByColumn="true" EnableHeaderContextMenu="true">
</telerik:RadGrid>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
RadGrid2.DataSource = Enumerable.Range(1, 3).Select(x => new { ID = 1, Desc = "Some text" });
RadGrid2.DataBind();
}
</script>
<div style="height: 4000px"></div>
When page scrolling is enabled and scrolling down the page, the row context menu of RadGrid rows do not open at a correct position.
Demo: Video Recording
Testing conducted in Safari 13, MacOS
I would assume that Delete and Edit columns should never be exported to excel to begin with, especially if HideStructureColumns="true".
If the HideStructureColumns is hiding something else, it would be nice to have another flag that would control showing/hiding Edit/Delete columns.
Hello,
There is an issue with Classic render mode Grid when grouping is enabled. The width of the grouping is incorrect and some of the icons are wrapped on the next row.
I found issue here in your forum and received an updated fix.
However, the sample fix has the grid name ("RadGrid1") hard-coded in the method "function OnClientHidden(sender, args)". In our code we need to use this for many grids; each with its own name. Please show me how to obtain the grid name generically; preferably from the arguments (sender, args).
Also in the example the checkbox isn't explicitly declared; I assume the code is using some implicit name. However, in our code the name of the checkbox is declared (see below my signature). Please show me how to change the code to use different checkbox names.
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AutoGenerateColumns
=
"true"
OnNeedDataSource
=
"RadGrid1_NeedDataSource"
>
<
ExportSettings
ExportOnlyData
=
"true"
>
<
Excel
Format
=
"Biff"
/>
</
ExportSettings
>
<
MasterTableView
Caption
=
"My Personalized caption"
CommandItemDisplay
=
"Top"
>
<
CommandItemSettings
ShowExportToExcelButton
=
"true"
/>
</
MasterTableView
>
</
telerik:RadGrid
>
protected
void
RadGrid1_NeedDataSource(
object
sender, GridNeedDataSourceEventArgs e)
{
RadGrid1.DataSource = OrdersTable();
}
private
DataTable OrdersTable()
{
DataTable dt =
new
DataTable();
dt.Columns.Add(
new
DataColumn(
"OrderID"
,
typeof
(
int
)));
dt.Columns.Add(
new
DataColumn(
"OrderDate"
,
typeof
(DateTime)));
dt.Columns.Add(
new
DataColumn(
"Freight"
,
typeof
(
decimal
)));
dt.Columns.Add(
new
DataColumn(
"ShipName"
,
typeof
(
string
)));
dt.Columns.Add(
new
DataColumn(
"ShipCountry"
,
typeof
(
string
)));
dt.PrimaryKey =
new
DataColumn[] { dt.Columns[
"OrderID"
] };
return
dt;
}