Links inside RadGrid are failing Contrast tests with ANDI tool:
<telerik:RadButton runat="server" ID="RadButton1" Text="Hide Grids with no Contrast issues" AutoPostBack="false" OnClientClicked="OnClientClicked" />
<script>
function OnClientClicked(sender, args) {
var $ = $ || $telerik.$;
var failingSkins = []
$(".RadGrid").each(function () {
var grid = $(this)
if (grid.find(".ANDI508-element-danger").length == 0) {
grid.parent().hide();
} else {
failingSkins.push(grid.parent().find(".label").text())
}
})
console.log(failingSkins)
}
</script>
<a href="javascript:void((function(){andiScript=document.createElement('script');andiScript.setAttribute('src','https://www.ssa.gov/accessibility/andi/andi.js');document.body.appendChild(andiScript)})());">Run ANDI tool</a>
<br />
<telerik:RadSkinManager ID="RadSkinManager1" runat="server"></telerik:RadSkinManager>
<asp:Repeater runat="server" ID="Repeater1" OnItemDataBound="Repeater1_ItemDataBound">
<SeparatorTemplate>
<hr />
</SeparatorTemplate>
<ItemTemplate>
<div class="container">
<asp:Label Text="Label1" CssClass="label" ID="Label1" runat="server" />
<telerik:RadGrid ID="RadGrid1" RenderMode="Lightweight" runat="server" AllowPaging="True" CellSpacing="0"
GridLines="None" Width="800px" PageSize="10" OnNeedDataSource="RadGrid1_NeedDataSource"
AllowSorting="true">
<MasterTableView AutoGenerateColumns="False" DataKeyNames="OrderID">
<Columns>
<telerik:GridHyperLinkColumn DataTextField="ShipName" DataNavigateUrlFields="OrderID" DataNavigateUrlFormatString="https://google.com/search?q={0}" Target="_blank"></telerik:GridHyperLinkColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</div>
</ItemTemplate>
</asp:Repeater>
protected void Page_Load(object sender, EventArgs e)
{
Repeater1.DataSource = RadSkinManager1.GetSkinChooser().Items;
Repeater1.DataBind();
}
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
(sender as RadGrid).DataSource = Enumerable.Range(1,70).Select(x=> new { OrderID = x, ShipName = "Ship name #" + x });
}
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
var grid = e.Item.FindControl("RadGrid1") as RadGrid;
if (grid != null)
{
var skin = (e.Item.DataItem as RadComboBoxItem).Text;
grid.Skin = skin;
(e.Item.FindControl("Label1") as Label).Text=skin;
}
}
Reproduction steps:
The horizontal line just above the group header:
<telerik:RadAjaxPanel runat="server" ID="panel" LoadingPanelID="RadAjaxLoadingPanel1" RenderMode="Inline" EnableAJAX="true">
<div class="row">
<asp:Button runat="server" ID="btnLoad" Text="Load Data" OnClick="btnLoad_Click" />
</div>
<telerik:RadGrid runat="server" ID="radGrid" CssClass="radgrid" Skin="Bootstrap"
ClientSettings-Scrolling-AllowScroll="true"
ClientSettings-Scrolling-ScrollHeight="800"
ClientSettings-Scrolling-UseStaticHeaders="true"
ClientSettings-EnableAlternatingItems="false"
HeaderStyle-Wrap="false" AllowPaging="true" PageSize="50"
ItemStyle-Wrap="false" AllowSorting="true"
OnNeedDataSource="radGrid_NeedDataSource" AllowMultiRowSelection="false"
HeaderStyle-BackColor="White">
<ClientSettings>
<Selecting AllowRowSelect="true" />
</ClientSettings>
<MasterTableView>
<Columns>
<telerik:GridTemplateColumn UniqueName="colEdit" AllowFiltering="false" Exportable="false">
<ItemTemplate>
<asp:LinkButton CssClass="link-button" runat="server" ID="btnEdit">Edit</asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="colDelete" AllowFiltering="false" Exportable="false">
<ItemTemplate>
<asp:LinkButton CssClass="link-button" ID="btnDelete" runat="server">Delete</asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</telerik:RadAjaxPanel>
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
radGrid.Visible = false;
}
}
protected void btnLoad_Click(object sender, EventArgs e)
{
radGrid.Visible = true;
radGrid.Rebind();
}
protected void radGrid_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
var grid = sender as RadGrid;
grid.DataSource = LoadData();
}
private DataTable LoadData()
{
DataTable tbl = new DataTable();
tbl.Columns.Add(new DataColumn("ADFAFD", typeof(string)));
tbl.Columns.Add(new DataColumn("ADFADFADF", typeof(string)));
tbl.Columns.Add(new DataColumn("ADFADFADFADFASDF", typeof(string)));
tbl.Columns.Add(new DataColumn("HGDH", typeof(string)));
tbl.Columns.Add(new DataColumn("ADFADF ADFADFADF", typeof(string)));
tbl.Columns.Add(new DataColumn("ADF ADSFADF", typeof(string)));
tbl.Columns.Add(new DataColumn("FKHDGJHFGJH", typeof(string)));
tbl.Columns.Add(new DataColumn("SHFSFHSGH", typeof(string)));
tbl.Columns.Add(new DataColumn("ADF ASDFASDF ASDFADSF", typeof(string)));
tbl.Rows.Add(new object[] { "ADFADF", "ASDFADFAFD", "ADFADF", "ADFADFADF ADFADFADFADF ADFADF ADFADFADF ADFADFADFADF ADFADF", "ADFADF", "ASDFADFAFD", "ADFADF", "ADFADFADF ADFADFADFADF ADFADF"});
tbl.Rows.Add(new object[] { "ADFADF", "ASDFADFAFD", "ADFADF", "ADFADFADF ADFADFADFADF ADFADF", "ADFADF", "ASDFADFAFD", "ADFADF", "ADFADFADF ADFADFADFADF ADFADF"});
return tbl;
}
Currently, the "GridButtonColumn" and "GridEditCommandColumn" columns render only ASP Buttons such as ImageButton, PushButton, LinkButton.
We would like to have the option to Choose Telerik Buttons such as RadButton, RadImageButton as ButtonType for the Columns.
<ExportSettings>
<Excel Format="Biff" DefaultCellAlignment="NotSet"/>
</ExportSettings>
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>
Currently, using HeaderContextFilterMenu on RadGrid with client-side binding results in JavaScript error and unexpected behavior.
<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>
Currently, the Headers are cycled by pressing the Tab key and this FeatureRequest is to improve the behavior and allow arrow navigation between headers, similar to the Kendo UI Grid:
Also, pressing Home/End should navigate to the first/last focusable cell in the row, while Ctrl+Home/Ctrl+End should navigate to the first/last focusable element in the Grid.
Set up to reproduce:
<telerik:RadGrid ID="RadGrid1" runat="server" ....>
<MasterTableView EditMode="Batch" ....>
<BatchEditingSettings HighlightDeletedRows="true" />
<Columns>
<telerik:GridBoundColumn DataField="OrderID" Display="false" UniqueName="OrderID">
</telerik:GridBoundColumn>
<telerik:GridDateTimeColumn DataField="OrderDate" DataType="System.DateTime"
FilterControlAltText="Filter OrderDate column" HeaderText="OrderDate"
SortExpression="OrderDate" UniqueName="OrderDate">
</telerik:GridDateTimeColumn>
....
Axe Tool Accessibility
Structure for reproduction:
<telerik:RadGrid RenderMode="Lightweight" ID="RadGrid_CIPCodes" GridLines="None" runat="server" Skin="Bootstrap" role="application"
PageSize="10"
AllowPaging="true"
AutoGenerateColumns="False"
OnNeedDataSource="RadGrid_CIPCodes_NeedDataSource"
AllowSorting="true"
AllowFilteringByColumn="true"
GroupingSettings-CaseSensitive="False" FilterType="Combined"
EnableAriaSupport="true">
<MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="OrderID" HorizontalAlign="NotSet" EditMode="Batch" Caption="Master Table" AutoGenerateColumns="False"
AllowMultiColumnSorting="false"
NoMasterRecordsText="No new CIP Code(s) to add!" ShowHeadersWhenNoRecords="true">
<BatchEditingSettings EditType="Row" />
<CommandItemSettings ShowAddNewRecordButton="false" SaveChangesText="Save" CancelChangesText="Cancel" ShowRefreshButton="false" />
<SortExpressions>
<telerik:GridSortExpression FieldName="OrderID" SortOrder="Ascending" />
</SortExpressions>
<PagerStyle Mode="NextPrevAndNumeric" PageButtonCount="3" Position="Bottom" ChangePageSizeButtonToolTip="PageSizeButton" ChangePageSizeTextBoxToolTip="ChangePageSizeToolTip" />
<RowIndicatorColumn CurrentFilterFunction="Contains" FilterListOptions="VaryByDataType" Visible="False">
<HeaderStyle />
</RowIndicatorColumn>
<Columns>
<telerik:GridBoundColumn DataField="OrderID" HeaderStyle-Width="100px" HeaderText="CIP Code" SortExpression="CIP_Code" UniqueName="CIP_Code" ForceExtractValue="InEditMode"
FilterListOptions="VaryByDataType" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" ReadOnly="true" FilterControlWidth="90px">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ShipCountry" HeaderStyle-Width="210px" HeaderText="Display Text" SortExpression="Display_Text" ForceExtractValue="InEditMode" AutoPostBackOnFilter="true"
UniqueName="Display_Text" CurrentFilterFunction="Contains" ShowFilterIcon="false">
<ColumnValidationSettings EnableRequiredFieldValidation="true">
<RequiredFieldValidator ForeColor="Red" Text="*This field is required" Display="Dynamic">
</RequiredFieldValidator>
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderStyle-Width="210px" HeaderText="Value" ShowFilterIcon="false" UniqueName="Disp_Value" DataField="ShipCountry" SortExpression="Disp_Value" ForceExtractValue="InEditMode" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderStyle-Width="210px" HeaderText="Open Doors Code" UniqueName="OpenDoorsCode" DataField="ShipCountry" AllowFiltering="false" HeaderStyle-Font-Bold="true" ConvertEmptyStringToNull="true"></telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="STEM Eligible" DefaultInsertValue="" HeaderStyle-Width="100px" UniqueName="StemEligible" AllowFiltering="false" HeaderStyle-Font-Bold="true">
<ItemTemplate>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadDropDownList RenderMode="Lightweight" runat="server" ID="StemEligibleDropDown">
<Items>
<telerik:DropDownListItem Text="" Value="" Selected="true" />
<telerik:DropDownListItem Text="Yes" Value="1" />
<telerik:DropDownListItem Text="No" Value="0" />
</Items>
</telerik:RadDropDownList>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridCheckBoxColumn HeaderStyle-Width="100px" HeaderText="Add to DB" HeaderTooltip="header tooltip" UniqueName="AddToDB" AllowFiltering="false" HeaderStyle-Font-Bold="true" ToolTip="Is Checked?"></telerik:GridCheckBoxColumn>
</Columns>
</MasterTableView>
<ClientSettings AllowKeyboardNavigation="true"></ClientSettings>
<FilterMenu>
<CollapseAnimation Type="OutQuint" Duration="100" />
</FilterMenu>
</telerik:RadGrid>
Data binding
protected void RadGrid_CIPCodes_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
(sender as RadGrid).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"] };
for (int i = 0; i < 70; i++)
{
int index = i + 1;
DataRow row = dt.NewRow();
row["OrderID"] = index;
row["OrderDate"] = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0).AddHours(index);
row["Freight"] = index * 0.1 + index * 0.01;
row["ShipName"] = "Name " + index;
row["ShipCountry"] = "Country " + index;
dt.Rows.Add(row);
}
return dt;
}
When filtering for a negative number in a GridNumericColumn with a Numeric Type of "Currency" and AutoPostBackOnFilter="true" filter loses its negative value on Enter keypress.
Setup to reproduce:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" Width="800px" OnNeedDataSource="RadGrid1_NeedDataSource"
AllowFilteringByColumn="true">
<MasterTableView AutoGenerateColumns="False">
<Columns>
<telerik:GridNumericColumn DataField="Price" DataType="System.Decimal"
FilterControlAltText="Filter Price column" HeaderText="Price"
SortExpression="Price" UniqueName="Price" NumericType="Currency"
AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo">
</telerik:GridNumericColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
C#
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
(sender as RadGrid).DataSource = Enumerable.Range(1,6).Select(x=> new { Price = Math.Pow(-1, x) * (x * 0.1 + x * 0.01) });
}
These issues can be reproduced here:
1. Navigate to the above site on an iOS device (IPhone or IPad).
2. Touch the top right hamburger menu to open the Columns Display Form.
3. Touch a checkbox.
The first touch over a checkbox or its corresponding label is not changing the state of the checkbox but at the same time, the header buttons are switched to Done and Cancel (as if changes have been made).
Touching between separate column fields changes the state of the checkbox of the upper column but the same is not updating the header buttons (Back button remains visible and Done and Cancel remain hidden).
Video of reproduction - http://somup.com/crX0Q80F0j.
The row selection in RadGrid is not proper if the row is deselected via the checkbox, while the Shift button is pressed.
Steps to reproduce the problem:
I have a grid with several columns - so many that they cannot all appear at once. Users are allow to reorder the columns as they wish. If my grid is set to FrozencolumnsCount=0, then when they drag a column to the edge of the grid, the grid starts to horizontally scroll so that they can see additional columns and drop their column in the desired location.
However if I set FrozenColumnsCount=1, then when they drag a column to the edge of the grid, the grid does not horizontally scroll.
Settings to reproduce the problem:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" Width="800px" OnNeedDataSource="RadGrid1_NeedDataSource">
<ClientSettings>
<Scrolling AllowScroll="true" UseStaticHeaders="true" />
</ClientSettings>
<MasterTableView InsertItemDisplay="Bottom"
I've used the Telerik Themebuilder to create a css file for the grid and set up my application to use the theme. This is working however, there are many classes that are not being output by the themebuilder. For instance, the buttons on the pager don't work.
When AJAX is enabled for the Grid with the <PagerStyle Mode="Advanced"> or <PagerStyle Mode="NextPrevNumericAndAdvanced"> the Go To Page by Number and Change Page Size Bugtons would not work.
On the other hand, if changing the Page or PageSize by typing and hitting the ENTER key instead of clicking the buttons, the Grid will behave accordingly.
Issue appears in RenderMode="Lightweight"