Dear developers I would like to see an easy way to have straight forward navigation / edit / save operations in radgrid the way it works for MS Access grids. When working in MS Access grid the record automatically gets dirty on edit, has an easy cancel by ESC button, and auto-saves without any trouble when moving to the next record. The way it works in MS Access is until 2018 still hard to find in a web-control. I managed to use the batch edit and have a kind of auto save when moving to the next record. but it is a pain because the postback action results in loosing the focus on the field you navigated to. Why is it so hard to built what the MS boys (the old guys did great work) already built ages ago. Its about time that our web controls behave like old fashioned windows fat client controls. Please don't lean behind, thinking that all is fine now. its not, a lot can be improved and made easier to handle and give user better user experience. When I look at the current NEW / UPDATES for ASP.NET Ajax Controls it make me cry to see that its apparently put aside as FINISHED. Wake up, improve more or give a clear roadmap for future developments. Progress should not loose focus on the Telerik ASP.NET Ajax toolbox because that one is still a major tool for the coming 5-10 years I expect.
When I use TimePicker in GridDateTimeColumn it works fine in a normal browser but fails on mobile with the following error "Value must be 00:00 or earlier"
This works fine from Firefox, but when I use a mobile browser I get the following error "Value must be 00:00 or earlier" or "Value must be 12:00 AM or earlier".
Markup
<telerik:RadGrid ID="RGTimesheet" runat="server" OnNeedDataSource="RGTimesheet_NeedDataSource" RenderMode="Mobile"
AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowAutomaticDeletes="True"
Skin="MetroTouch"
Width="100%" AllowSorting="True" GroupPanelPosition="Top">
<ClientSettings>
<Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling>
</ClientSettings>
<MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Bottom" DataKeyNames="OrderID" ShowFooter="True">
<Columns>
<telerik:GridEditCommandColumn ButtonType="FontIconButton">
</telerik:GridEditCommandColumn>
<telerik:GridClientDeleteColumn ButtonType="FontIconButton">
</telerik:GridClientDeleteColumn>
<telerik:GridDateTimeColumn DataField="Start" DataType="System.TimeSpan" EditDataFormatString="hh:mm:ss tt" HeaderText="Start" SortExpression="Start" UniqueName="Start" PickerType="TimePicker">
</telerik:GridDateTimeColumn>
<telerik:GridDateTimeColumn DataField="Finish" DataType="System.TimeSpan" HeaderText="Finish" SortExpression="Finish" UniqueName="Finish" PickerType="TimePicker">
</telerik:GridDateTimeColumn>
</Columns>
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn1" ButtonType="PushButton">
</EditColumn>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
C# - Markup
private DataTable OrdersTable()
{
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("OrderID", typeof(int)));
dt.Columns.Add(new DataColumn("Start", typeof(TimeSpan)));
dt.Columns.Add(new DataColumn("Finish", typeof(TimeSpan)));
dt.PrimaryKey = new DataColumn[] { dt.Columns["OrderID"] };
for (int i = 0; i < 10; i++)
{
int index = i + 1;
DataRow row = dt.NewRow();
int hours = DateTime.Now.Hour;
int minutes = DateTime.Now.Minute;
int seconds = DateTime.Now.Second;
row["OrderID"] = index;
row["Start"] = new TimeSpan(hours, minutes, seconds);
row["Finish"] = new TimeSpan(hours+index, minutes, seconds);
dt.Rows.Add(row);
}
return dt;
}
protected void RGTimesheet_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
RGTimesheet.DataSource = OrdersTable();
}
How is it possible to autofit / autosize a giving column (or all columns) when exporting the contents from RadGrid to xlsx using ExportStructure? The only option available is Width with a defined value. I was unable to find an autofit / autosize function. And also add AutoFilter feature... Please consider to add this features :-)
The behavior described in the following KB should be fixed https://www.telerik.com/support/kb/aspnet-ajax/grid/details/horizontal-scroll-speed-is-slow-with-static-headers In the meantime, you can use the workarounds from the article, or, if it fits your scenario, move to scrolling horizontally through frozen columns via the Prev/Next buttons the grid can provide. You can find an example of that in the second grid (Navigate through the columns by clicking on the Prev/Next buttons) in the following demo: https://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/columns/frozen-columns/defaultcs.aspx
In RadGrid, we can use the ClientSettings.Scrolling.UseStaticHeaders property to have a fixed header when scrolling the grid. This requires a fixed height of the grid. However, what if we do not want a fixed height of the grid, but rather want the grid to flow down the page, using as much space as necessary do display its records. In such a scenario, the grid header will disappear when we scroll down the page. I have implemented a kind of fix for this in one of my projects. Instead of trying to explain how it works, I have prepared an example. You can find it here: http://www.ifag.no/RadGridHeader.aspx Maybe some of you can suggest even better solutions to the scenario I have described. Comments are welcome!
As shown in the attached screen, please keep the column headers Fixed or Visible so they are still visible when users scroll down to see the other data, for both RadGrid and PivotGrid:
This feature request is regarding the ExportToExcel button in Radgrid. ExportToExcel button in Radgrid adds an extra row in the exported excel sheet. This is due to the presence of Filtering items. Export to Excel code in radgrid: <ExportSettings ExportOnlyData="true" IgnorePaging="true" Excel-Format="Biff" OpenInNewWindow="True"> <Excel Format="Biff" AutoFitImages="True"></Excel> </ExportSettings> <CommandItemSettings ShowAddNewRecordButton="False" ShowRefreshButton="False" ShowExportToExcelButton="True" ExportToExcelText="Export Grid To Excel"/> The above code produces an extra row. I know there is a fix by disabling the Filtering items in the grid in OnItemCommand event. So I used that. The code is given below: protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == RadGrid.ExportToExcelCommandName) { ReviewByCollegeGrid.AllowFilteringByColumn = false; ReviewByCollegeGrid.Rebind(); ReviewByCollegeGrid.ExportSettings.Excel.Format = GridExcelExportFormat.Biff; ReviewByCollegeGrid.ExportSettings.IgnorePaging = true; ReviewByCollegeGrid.ExportSettings.ExportOnlyData = true; ReviewByCollegeGrid.ExportSettings.OpenInNewWindow = true; } } But it is a lot of work when you have to do it for all the web pages in your application. Please provide a feature which will help to solve this issue in an easier way.
Hi, Our Accessibility partner while evaluating our product for 508 compliance we got one report saying RadGrid control is not accessible. We do have enablearia attribute on the radgrid and is emitting the aria-attributes as mentioned in your demo. http://demos.telerik.com/aspnet-ajax/grid/examples/accessibility-and-internationalization/wai-aria-support/defaultcs.aspx As per them : "So it does not alert the user that arrow keys may be used to navigate it". I have attached a snippet of their report regarding radgrid accessibility. Can you please let me know if anything is missing. Thanks and best regards, Mirang
Currently when doing a Batch Edit with the Grid each row and cell must be updated with a new/edited value before saving. Example: a User has a Grid containing records and would like to update several records because a Date field requires updating. Can it be possible for the User to select the Rows they would like to update, Edit the Date Field(using the example above), but this time when Saved all records that were selected are updated. This solution may require a modal to be displayed that shows all fields available, similar to Edit/Insert grid Popup. The appropriate field is then updated and saved only to selected records. This feature would save a lot of time by not having to edit each row individually then saving.
If AllowPaging, AllowScroll and UseStaticHeaders are set to true, then there will be 2 empty <th> elements workaround: <ClientSettings> ... <ClientEvents OnGridCreated="OnGridCreated" /> </ClientSettings> <script> function OnGridCreated(sender, args) { var emptyth = $telerik.$(sender.get_element()) .find("th").filter(function (ind, item) { return item.textContent == "" }); // alert(emptyth.length) emptyth.append("<span style='display:none'>Hidden empty table header</span>") } </script>
Images that reside in the grid will get resized (scaled down with about 3-5 %) which might cause issues, specially if exporting bar-codes, thus the bar-code scanners won't be able to read them. Current workaround is to use the Telerik Documents Processing Library and build the table manually where the images are inserted without changing the size. Here is an example: protected void RadGrid1_InfrastructureExporting(object sender, GridInfrastructureExportingEventArgs e) { Telerik.Web.UI.ExportInfrastructure.Table table = e.ExportStructure.Tables[0]; Workbook workbook = new Workbook(); workbook.Worksheets.Add(); Worksheet worksheet = workbook.ActiveWorksheet; foreach (var row in table.Rows) { if (row.Index > 1) { worksheet.Rows[row.Index - 1].SetHeight(new RowHeight(55, true)); } foreach (var cell in row.Cells) { if (row.Index == 1 || cell.ColIndex != 2) { worksheet.Cells[cell.Index.Y - 1, cell.Index.X - 1].SetValue(cell.Value.ToString()); } else { FloatingImage image = new FloatingImage(worksheet, new CellIndex(cell.Index.Y - 1, cell.Index.X - 1), 0, 0); Stream stream = File.Open(Server.MapPath(cell.Value.ToString()), FileMode.Open); using (stream) { image.ImageSource = new Telerik.Windows.Documents.Media.ImageSource(stream, "jpg"); } worksheet.Shapes.Add(image); } } } byte[] data; using (MemoryStream ms = new MemoryStream()) { XlsxFormatProvider xlsProvider = new XlsxFormatProvider(); xlsProvider.Export(workbook, ms); data = ms.ToArray(); } Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; Response.Headers.Remove("Content-Disposition"); Response.AppendHeader("Content-Disposition", "attachment; filename=" + RadGridLista.ExportSettings.FileName + ".xlsx"); Response.BinaryWrite(data); Response.End(); }
A valid SQL statement should look like SELECT * FROM Products WHERE ([Discontinued] = 1) or SELECT * FROM Products WHERE ([Discontinued] = 'True') but RadGrid provides something like ([Discontinued] = True) in the MasterTableView.FilterExpression property. By default RadGrid filters the data on its own after retrieving the entire data set form the data source, and the filtering operation works like that. If you will be using the filter expression provided by the grid in a custom data source operation you may need to tweak the string first. Note that changing this may result in a breaking change if you are already using the current syntax. Workaround: https://www.telerik.com/support/kb/aspnet-ajax/grid/details/get-sql-compliant-filterexpressions-from-radgrid
Private
Function
SomeTable()
As
DataTable
Dim
dt
As
New
DataTable()
dt.Columns.Add(
New
DataColumn(
"FieldName"
, Type.
GetType
(
"System.String"
)))
row(
"FieldName"
) =
"C:\SomeDirectory\RadGridExport.pdf"
dt.Rows.Add(row)
Return
dt
End
Function
<
telerik:GridAttachmentColumn
DataSourceID
=
"ObjectDataSource1"
HeaderText
=
"Attachment Column"
AttachmentKeyFields
=
"FieldName"
AttachmentDataField
=
"FieldName"
DataTextField
=
"FieldName"
UniqueName
=
"FieldName"
ButtonType
=
"ImageButton"
UploadControlType
=
"RadAsyncUpload"
FileName
=
"RadGridExport.pdf"
ImageUrl
=
"pdf-icon.png"
ItemStyle-Height
=
"36px"
ItemStyle-Width
=
"36px"
>
</
telerik:GridAttachmentColumn
>
<
asp:ObjectDataSource
ID
=
"ObjectDataSource1"
runat
=
"server"
SelectMethod
=
"MySelectMethod"
TypeName
=
"MyApp"
>
<
SelectParameters
>
<
asp:Parameter
Name
=
"FieldName"
Type
=
"String"
/>
</
SelectParameters
>
</
asp:ObjectDataSource
>
Public
Class
MyApp
<DataObjectMethodAttribute(DataObjectMethodType.
Select
,
True
)>
Public
Function
MySelectMethod(filePath
As
String
)
As
DataTable
Dim
dt
As
New
DataTable(
"Base"
)
Dim
col
As
New
DataColumn(
"FieldName"
)
col.DataType = System.Type.
GetType
(
"System.Byte[]"
)
dt.Columns.Add(col)
Dim
row
As
DataRow = dt.NewRow
row(0) = My.Computer.FileSystem.ReadAllBytes(filePath)
dt.Rows.Add(row)
Return
dt
End
Function
End
Class
Description:
If RadGrid has UseStaticHeaders enabled, different HTML Tables are rendered and instructing JAWS to read the tables one by one will also read the Header. It would say Header with "n" number of columns and one rows, since the table has only one row and that is containing the Column Names.
Goal:
It would be great, if the grid with Static Header could be made in a way that JAWS will only treat the grid as one Table instead of two separate tables.
Workaround and discussion:
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>
When using iPad touch to open the header context menu of a grid column, an immediate postback prevents the opening of the menu when the RadGrid is in Mobile RenderMode. The reason is that this action gets recognized as dragging when AllowDragToGroup is enabled.
I would like to get a visual indiation on the grouppanel of the RadGrid for column which are not allowed to group on. Forum reference: http://www.telerik.com/forums/grouppanel-drop-indicator-style-of-not-groupable-columns#yjnsALhKekGuqD_Ze0Kmqw