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.
Hello,
It would be nice to be able to clear the filter for each column as opposed to creating an external button to clear all filters. I was thinking of similar to below.
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.
When the Grid has <HeaderContextMenu> in the Markup and there is no explicitly set RenderMode of the Grid, the Grid is rendered in Classic. It also happens if there is a reference to the ContextMenu in the code behind. Reproduction steps: <script> function f() { //code alert($find("RadGrid1")._renderMode); Sys.Application.remove_load(f); } Sys.Application.add_load(f); </script> <telerik:RadGrid ID="RadGrid1" runat="server" > <HeaderContextMenu></HeaderContextMenu> </telerik:RadGrid> Solutions: 1. Remove the HeaderContextMenu tag 2. Set the RenderMode of the Grid explicitly
<
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;
}
Hi
Since updating to the latest release of UI for ASP.NET AJAY the RadContextMenu of my RadGrid is misaligned at the right edge of the screen. Even in your sample https://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/columns/context-menu/defaultcs.aspx when you open the context menu at the right side of the screen the context menu is nor aligned to the left (like it used to be).
Please ses the attached printscreen.
Kind regards
Felix
Expected: the row disappears.
Actual result: nothing happens.
The following steps create this issue: 1. Use html 4 2. Use telerik AJAX (For consistency) 3. Set a radgrid with some columns that reach beyond the extent of its element (such that it requires horizontal scrolling). Use at least four columns. One being the GridClientSelectColumn. 4. Have the following settings: Control Settings: AllowPaging=true,AllowSorting=true,AllowFiltering=true,AllowFilteringByColumn=true,AllowMultiRowSelection=true Control Events Used: NeedDataSource,OnItemDataBound Client Settings: EnablePostBackOnRowClick=false,Resizing AllowColumnResize=true, Selecting AllowRowSelect=true,UseClientSelectColumnOnly=false,Scrolling,AutoGenerateColumns=false,AllowScroll=true,UseStaticHeaders=true Important note: Retain data on the server, rebind, and, on item databound, select the previously selected rows. Set up a button to perform some action on the selected rows and have this action use AJAX such that this action depends on the currently selected rows in the RadGrid. 5. Scroll away from the selection checkboxes 6. Select some rows in your RadGrid 7. Perform your action with AJAX If all was set up correctly, your grid should have been rebound with the previously selected rows re-selected. The RadGrid should still be scrolled to its previous position. 8. Perform your action with AJAX again. Here's the bug, the grid states that it has no selected items; however, the client shows that there are items selected in the UI. This may be related to "RadGrid's last selected item index is not persisted correctly when two or more postbacks are triggered from external controls."
For keyboard users who don't have a specific Context Menu key (see https://en.wikipedia.org/wiki/Menu_key), they typically need to use the Windows standard SHIFT+F10 hotkey to trigger a contextmenu event. For example: 1. In IE, load http://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/columns/context-menu/defaultcs.aspx 2. Tab to a column header link 3. Press SHIFT+F10 (standard Windows/IE hotkey to open context menu) 4. Notice the context menu displays, however, the focus is really on the IE menubar. IE supports F10 to open the menubar, but is also seeing SHIFT+F10 too. Or 1. In FireFox, load http://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/columns/context-menu/defaultcs.aspx 2. Tab to a column header link 3. Press SHIFT+F10 (standard Windows/IE hotkey to open context menu) then press down arrow 4. Notice the context menu displays, however, the focus is really on FireFox's application system menu in the upper left. Chrome does not have this issue - it opens the grid context menu only. We need IE and FireFox to also only open the grid's context menu, and not trigger default browser behavior. According to https://yuilibrary.com/yui/docs/event/contextmenu.html, it is possible to correct this behavior by calling event.preventDefault() when SHIFT+F10 is pressed, but then trigger a synthetic contextmenu event anyway. As a workaround, we know users can press Escape to close the browser's default menu and bring focus back into the HTML document (and thus the grid's context menu), but this throws off the user experience and becomes a training issue.
Hidden columns are shown on resize when the static headers and frozen column are used. Video: https://www.screencast.com/t/4Lwuvbp7 Possible workarounds: - Hide the column with Visible="False", instead of Display="False" - Hide the column on the client-side: function gridCreated(sender, args) { var masterTableView = sender.get_masterTableView(); columnIndex = masterTableView.getColumnByUniqueName("ShipName").get_element().cellIndex; setTimeout(function () { masterTableView.hideColumn(columnIndex); }, 2); } Steps to reproduse: <telerik:RadGrid RenderMode="Lightweight" HeaderStyle-Width="200px" AutoGenerateColumns="false" ID="RadGrid1" OnNeedDataSource="RadGrid1_NeedDataSource" Width="100%" runat="server"> <ClientSettings> <Scrolling AllowScroll="True" UseStaticHeaders="true" FrozenColumnsCount="2"></Scrolling> </ClientSettings> <MasterTableView AutoGenerateColumns="false"> <Columns> <telerik:GridBoundColumn DataField="SongID" HeaderText="SongID" FilterControlWidth="50px" HeaderStyle-Width="50px"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="SongTitle" HeaderText="Song Title" FilterControlWidth="200px"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="CollectionName" HeaderText="Collection Name" FilterControlWidth="200px"></telerik:GridBoundColumn> <telerik:GridBoundColumn FilterControlWidth="50px" DataField="VersionID" HeaderText="VersionID" Display="false"></telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid> Code Behind: protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { (sender as RadGrid).DataSource = GetData(); } private DataTable GetData() { DataTable dt = new DataTable(); dt.Columns.Add("SongID"); dt.Columns.Add("SongTitle"); dt.Columns.Add("CollectionName"); dt.Columns.Add("VersionID"); for (int i = 0; i < 20; i++) { dt.Rows.Add(i, i + 1, i + 2, i + 3); } return dt; }
When trying to batch edit cell values of the Grid via e.g., RadEditor (GridHTMLEditorColumn or RadEditor in EditItemTemplate of GridTemplateColumn) the cell value always result to a plain text.
In GridTableView.cs, you provide a function protected virtual GridTableView CreateTableView() (Line 7828). This function can be overloaded to return derived classes from GridTableView. But, this is not overloadable completely. Because you create a GridTableView directly in protected void BuildDetailTablesFromDataSource() (Line 8808), too. There you would have to call a virtual creator function, too. This is necessary, because I have a lot of Trouble with your DataBind which I was able to fix with an overload. It is much to hard to make this bug visible for you, I really tried to do so already, but I had to fix this that way, because your GridTableView without my derivation fails in our szenario. The call stack for that problem, I'd had to fix, is always like: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.IndexOutOfRangeException: Cannot find column CheckSum. at System.Data.DataTable.ParseSortString(String sortString) at System.Data.DataView.set_Sort(String value) at Telerik.Web.UI.GridEnumerableFromDataView.PerformTransformation() at Telerik.Web.UI.GridEnumerableFromDataView.TransformEnumerable() at Telerik.Web.UI.GridTableView.GetEnumerator(Boolean useDataSource, GridEnumerableBase resolvedDataSource, ArrayList dataKeysArray, Boolean shouldClearDataKeys) at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) at Telerik.Web.UI.GridTableView.PerformSelect() at Telerik.Web.UI.GridTableView.DataBind() at Telerik.Web.UI.GridItemBuilder.BindDetailTable(GridDataItem parentItem, GridTableView cloned) at Telerik.Web.UI.GridItemBuilder.BindDetailTables(GridDataItem parentItem, GridNestedViewItem detailItem) at Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group) at Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls) at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) at Telerik.Web.UI.GridTableView.PerformSelect() at Telerik.Web.UI.GridTableView.DataBind() In that, your DataTableView gets an invalid sort Expression string. Therefore, I overwrote DataBind. But this is not possible in all cases, if you create GridViewTable() objects on your own. Best regards
System.ArgumentOutOfRangeException
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
This error seems to happen if there is a GridTemplateColumn that has the Exportable property set to False.
Have built-in option to do LIKE filtering on grids.
I have added Listview in Header template in Template column, its showing the data on the grid as expected. When I am exporting to Excel or PDF its not exporting the header. Header you see in headertemplate.jpg is not exporting to PDF Thanks