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>
....
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.
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.
Good morning,
we have a strange issue using RadGrid with horizontal scroll and frozen columns: there a resizing of the height which gets user experience not the best.
See attached gif.
Could you please help us?
Hi
AllowKeyboardNavigation="true" allow for users to navigate the grid with the keyboard. This is great for people with disabilities and Section 508 compliance. But when this is enabled, and the "Enter" key is pressed, the default behavior is to present an update process.
This update process should be controllable when AllowKeyboardNavigation="true".
Just as a user note ... when I was trying to figure this out, reading through the options, the EditMode was the first place I started looking.
Here is the current workaround ... How do I disable editing when AllowKeyboardNavigation="true"? in UI for ASP.NET AJAX Grid - Telerik Forums
Hope this suggestion helps
<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, using HeaderContextFilterMenu on RadGrid with client-side binding results in JavaScript error and unexpected behavior.
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>
<ExportSettings>
<Excel Format="Biff" DefaultCellAlignment="NotSet"/>
</ExportSettings>
Grid in BatchEdit mode must be one of the most useful features in some serious industry-level web applications. It comes quite naturally, that the data in the grid must be often extensively validated, and in many cases the client side validation is simply not enough. In our case, we had to use BatchEditing mode and we had to validate user-entered values serverside (due to complex rules, external data to validation against in real time and safety/security of the validation itself).
Documentation states that BatchEdit does not support ServerSide validation. This makes BatchEdit mode mostly useless for some serious use, which is a pitty. But how much is needed to do so? The only thing we need is, when processing RadGrid_BatchEditCommand, to send the unsaved changes back to the client (overwrite the old values which would come from the database via NeedDataSource) and mark the changed cells as "EDITED" or "CHANGED", because:
a. We have to make sure, that the unsaved rows from the session variable will always come up, next time the user hits the Save changes button, in the BatchEditCommand in Hashtable newValues = command.NewValues; This is because only rows, which RadGrid understand as changed by user-client side, will come up in the newValues HashTable. In case that the user changed, in the first server-side roundtrip, rows 1 and 2, rows 1 and 2 would be saved to the session variable and they would be presented to the user, but in the second round user would not change rows 1 and 2 but change only row 3, it would be only row 3 which would come up in RadGrid1_BatchEditCommand the newValues Hashtable, and we would never get previous, still unsaved, changes
b. in case the user goes to the next page of the grid, using paging arrows in the grid, the grid normally warns about unsaved changes and prevents user from going to the next page, if there are any unsaved changes. If our changed rows from the session are not marked as EDITED, the grid would never ask this and would proceed to the next page, losing users changes.
We were fighting to make this work via some session variables, etc, but then Doncho from Telerik support sent us this simple solution. I think many would be happy if you could add it to the next release, so it is supported out of the box. Attaching files from Doncho, which give an ide to the solution
Thank you.
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.
<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;
}
Current RadGrid only has headers/header templates for column headers. The only way to have headers for each row would be to manipulate the grid data and adding the header for each row into the grid data itself. And if we wanted to group the row headers is another round of manipulating the grid data and also manually merging the cells. Is it possible to have to have it as a feature of the RadGrid just like column groups and column headers to simplify the task? example of the final output ->
Reproduction of the issue
RadGrid declaration
<telerik:RadButton runat="server" Text="PostBack" AutoPostBack="true"></telerik:RadButton>
<telerik:RadGrid runat="server" ID="RadGrid2">
<MasterTableView DataKeyNames="Column1" ClientDataKeyNames="Column1" CommandItemDisplay="Top">
<Columns>
<telerik:GridBoundColumn UniqueName="Col1" DataField="Column1" HeaderText="Col1"s></telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="Col2" DataField="Column2" HeaderText="Col2"></telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="Co13" DataField="Column3" HeaderText="Co13"></telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="Col4" DataField="Column4" HeaderText="Col4"></telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<ClientSettings ReorderColumnsOnClient="false" AllowColumnsReorder="true">
<DataBinding Location="~/Api/RevCodeGrid" SelectMethod="GetDataAndCount2" >
</DataBinding>
</ClientSettings>
</telerik:RadGrid>
RevCodeGridController
public class Test
{
public String Column1 { get; set; }
public String Column2 { get; set; }
public String Column3 { get; set; }
public String Column4 { get; set; }
}
[HttpPost]
public virtual RadGridResultData GetDataAndCount2(object context)
{
List<Test> items = new List<Test>();
items.Add(new Test() { Column1 = "1", Column2 = "A", Column3 = "A1", Column4 = "A12" });
items.Add(new Test() { Column1 = "2", Column2 = "B", Column3 = "B1", Column4 = "B12" });
items.Add(new Test() { Column1 = "3", Column2 = "C", Column3 = "C1", Column4 = "C12" });
items.Add(new Test() { Column1 = "4", Column2 = "D", Column3 = "D1", Column4 = "D12" });
return new RadGridResultData { Data = items, Count = items.Count };
}
We used Telerik in our application. The network team reported a spam in it.
Using Telerik grid with SortExpression in telerik:GridTemplateColumn, has been reported as high priority network issue.
Issue name : Ajax request header manipulation (DOM-based)
Recorded the issue in below snippet of responce.
onclick="Telerik.Web.UI.Grid.Sort()"
Please let me know if you have any suggestions.!!!
The horizontal line just above the group header: