The reason for the behavior is that the column editor does not move to the cell when you cancel its opening. Opening a cell in the same column expects the column editor to be in the previously opened cell, however, and this causes the error. Repro is attached to illustrate the scenario. Workarounds: - Use EditType=Cell so that each cell opens independently of the row (wokaround 1). - Use the provided function override (workaround 2). Make sure to remove it after upgrading to a release that has the fix. This function override may prevent you from getting other updates and fixes in this function. - Use a template column and hide the editor based on your condition in the OnBatchEditOpened event (workaround 3)
Alternating Row style of RadGrid is not applied when using Bootstrap skin. Steps to reproduce: For all other Skins these approaches work: div.RadGrid tr.rgAltRow { background-color: aqua; } Or: <AlternatingItemStyle BackColor="Aqua" /> The reason probably is because there is >td directive built-in, which needs to be overridden manually in order for the styling to take effect (this works): div.RadGrid tr.rgAltRow > td { background-color: aqua; } A possible workaround for this issue is available in the following forum post: https://www.telerik.com/forums/alternatingitemstyle-5e16887f3085#odVQBomUikiIJfrxeBQrww
There are two possible approaches to overcome this issue: - First approach would be to get a reference to the GridHTMLEditorColumn and add the desired tools in the code behind using the "OnItemCreated" server event handler of RadGrid. - Second approach would be to use GridTemplateColumn with RadEditor.
Enable filtering, Enable HeaderContextMenu and HeaderContextMenuFilter. First, filter using the HeaderContextMenu filter (e.g. OrderDate GreaterThanOrEqualTo "someDate" AND OrderDate LessThanOrEqualTo "someOtherDate" Second, apply a filter on another column using the Header filter only (e.g. Freight GreaterThanOrEqualTo "4") At this point, the filtering applied by the HeaderContexFilterMenu is now partially removed. Issue only appears when Header filter and HeaderContextMenu filter are used in combination. They work as expected when used separately.
If the Chrome browser zoom is different from 100%, it is not possible to reorder the RadGrid columns. The problem can be reproduced at https://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/columns/column-row-resize-reorder/defaultcs.aspx .
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
Hello, I have Radgrid with editable & non editable columns. I edit a row. If I click an editable cell, it places the cursor within the editable cell. Its correct. But if I click a readonly cell, it places the cursor in the first editable cell of the line. If the readonly cell is the last cell of the line and if I click the readonly cell, it places the cursor in the first editable cell. If the grid column width is very large, the grid is scrolled to show the first editable cell, and I loose the data which I am visualizing. If I click in readonly cell, I want to open all the editable cells of the line, but the page should remain in same place. I don't want to place the cursor in any of the editable cells of the line. Example grid: I have a simple Radgrid with batch mode and edit type row. I have 3 columns id,name and age. Id and name columns are editable columns. Age column is non editable column. If I click on age column which is non editable , the focus moves to id column, which is the first editable column. If there many columns in my grid and if I click the last non editable column, the grid scrolls to first editable column, and I lose the focus of data which I am seeing. If I click in non editable column, I want the grid to remain in same place. This feature can be added as an option by adding property of grid ForceFocusinEdit. When ForceFocusinEdit= true, if we click in readonly column, focus moves to first editable column. When ForceFocusinEdit = false, if we click in readonly column, focus is in clicked cell. Please refer to Ticket ID: 1168296 for more informations. Thank you
Such an exposed method, which returns the value from the ExportOutput, would be useful to further enhance the exporting capabilities of the RadGrid control. A very practical example would be to export numerous RadGrid controls into one Excel file.
When Scrolling is enabled with Frozen columns in RadGrid, horizontal scrollbar not visible in Microsoft Edge. Issue appears in Microsoft Edge Version: - Microsoft Edge 42.17134.1.0 - Microsoft EdgeHTML 17.17134 WORKAROUND: Apparently, setting the horizontal scrollbar's height to 17 pixels will make Microsoft Edge display it. (Note: in case it still not displaying, you may try with 18px) To set the height, you can choose one of the options below: 1. Using CSS style to increase the size of the horizontal scrollbar by one pixel. <style type="text/css"> .RadGrid div[id$="_Frozen"] { height: 18px; /* or */ /*padding-bottom: 1px;*/ } </style> 2. Using JavaScript Subscribe the grid to its GridCreated client-side event, and in the event handler increase the element's height with the scrollbar then revert it back to its original size with a delay: <script type="text/javascript"> function GridCreated(sender, args) { $('div[id$="_Frozen"]').height(17); } </script>
Would be great if font awesome could be used for the radgrid edit/delete/ icons etc....
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(); }
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
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
>
<
MasterTableView
>
<
Columns
>
<
telerik:GridClientDeleteColumn
CommandName
=
"Delete"
ButtonType
=
"LinkButton"
></
telerik:GridClientDeleteColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
>
<
ClientEvents
OnCommand
=
"OnCommand"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
function
OnCommand(sender, args) {
}