Unplanned
Last Updated: 19 Apr 2019 09:41 by ADMIN

Using CommandItemTemplate (Grid - Command Item) for Editing DetailTable records and selecting an item after filtering or from another page, one item from the first page is put for editing instead. Open the attached GIF animation (EditSelectedEditWrongItem.gif) to see it in action.

 

Currently the workaround we offer is to handle the EditSelected command manually for all the DetailTables Except for the Master.

 

Grid markup:

 

        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" Width="100%" PageSize="3"
            OnItemCommand="RadGrid1_ItemCommand"
            OnDetailTableDataBind="RadGrid1_DetailTableDataBind"
            OnNeedDataSource="RadGrid1_NeedDataSource">
            <MasterTableView Name="MasterTable" AutoGenerateColumns="true" DataKeyNames="OrderID">
                <DetailTables>
                    <telerik:GridTableView Name="ChildTable" DataKeyNames="OrderID" AutoGenerateColumns="true" CommandItemDisplay="Top">
                        <CommandItemTemplate>
                            <asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected" CssClass="btn btn-default">Edit Selected</asp:LinkButton>
                        </CommandItemTemplate>
                    </telerik:GridTableView>
                </DetailTables>
            </MasterTableView>
            <ClientSettings>
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
        </telerik:RadGrid>

 

C# - ItemCommand

 

    protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
        // Logic applies for all the tables (detail tables) which are not named "MasterTable"
        if(e.Item.OwnerTableView.Name != "MasterTable" && e.CommandName == RadGrid.EditSelectedCommandName)
        {
            e.Canceled = true;

            GridTableView detailTable = e.Item.OwnerTableView;

            if (detailTable.OwnerGrid.SelectedIndexes.Count == 0)
            {
                return;
            }

            foreach (GridDataItem selectedItem in detailTable.OwnerGrid.SelectedItems)
            {
                selectedItem.Edit = true;
            }

            detailTable.Rebind();
        }
    }

 

VB - ItemCommand


Protected Sub RadGrid1_ItemCommand(ByVal sender As Object, ByVal e As GridCommandEventArgs)
    If e.Item.OwnerTableView.Name <> "MasterTable" AndAlso e.CommandName = RadGrid.EditSelectedCommandName Then
        e.Canceled = True
        Dim detailTable As GridTableView = e.Item.OwnerTableView

        If detailTable.OwnerGrid.SelectedIndexes.Count = 0 Then
            Return
        End If

        For Each selectedItem As GridDataItem In detailTable.OwnerGrid.SelectedItems
            selectedItem.Edit = True
        Next

        detailTable.Rebind()
    End If
End Sub

Unplanned
Last Updated: 22 Mar 2019 13:12 by ADMIN

Currently the Width of the Edit controls inside the inline Edit form of the Grid can be set only in pixels. In order to be able to implement a responsive layout the developer has to be able to set the width of these controls in percentage.

Unplanned
Last Updated: 26 Mar 2019 07:56 by ADMIN
The filter expression that we build should use ToUpperCase in the build expresssion.
Completed
Last Updated: 11 Dec 2020 15:01 by ADMIN
Release R1 2021
When there is at least one ColumnGroup which is not assigned to any of the columns in RadGrid, exporting to Excel throws an exception "Index was outside the bonds of the array"
Unplanned
Last Updated: 08 May 2020 17:38 by ADMIN
Created by: Dan Avni
Comments: 0
Category: Grid
Type: Feature Request
1
When resizing a column in RTL, expectation is to use the left side of a column to expand/shrink it. Instead I have to use the right side. Grabbing the left side resizes the next column on the left and is very confusing for people who are used to think in RTL
Unplanned
Last Updated: 07 Mar 2019 12:03 by ADMIN

When virtualization is enabled for RadGrid, NeedDataSource is called at every Post back with RebindReason = ExplicitRebind, regardless of the event target.

Steps to reproduce:

Use the following Code snippets for the runnable sample and debug the NeedDataSource event while doing post backs using other controls. For instance, you can use the RadButton1 from these snippets to make a standard Post Back.

Markup

        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>

        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel>
        
        <telerik:RadButton runat="server" ID="RadButton1" Text="Postback" AutoPostBack="true" />

        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="false" Width="800px" OnNeedDataSource="RadGrid1_NeedDataSource">
            <MasterTableView AutoGenerateColumns="true" DataKeyNames="OrderID">
            </MasterTableView>
            <ClientSettings>
                <Scrolling AllowScroll="true" />
                <Virtualization EnableVirtualization="true" InitiallyCachedItemsCount="500" ItemsPerView="200" RetrievedItemsPerRequest="200" LoadingPanelID="RadAjaxLoadingPanel1" />
            </ClientSettings>
        </telerik:RadGrid>


C# 

    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"] };

        for (int i = 0; i < 10000; 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;
    }

Completed
Last Updated: 30 Nov 2020 14:21 by ADMIN
Release R1 2021
There should be RadGrid.ExportSettings.WorksheetName property to name a Sheet inside the Excel file, instead of having it named after the RadGrid.ExportSettings.FileName property as well as to avoid additional coding to Work around this.
Completed
Last Updated: 15 Dec 2020 10:14 by ADMIN
Release R1 2021
Status bar in Grid does not hide after Exporting a document when OnCommand client event is handled
Unplanned
Last Updated: 20 Mar 2019 15:33 by ADMIN
When virtualization is enabled for RadGrid, NeedDataSource is called at every Post back with RebindReason = ExplicitRebind, regardless of the event target.
Unplanned
Last Updated: 20 Mar 2019 15:45 by ADMIN
Created by: Odd Dahm
Comments: 1
Category: Grid
Type: Bug Report
1
RadGrid with Hierarchical structure throws the error when an item is expanding while it's in edit mode and the Table's HierarchyLoadMode is set to Client.
Completed
Last Updated: 10 Apr 2019 15:29 by ADMIN
Created by: Richa Chauhan
Comments: 2
Category: Grid
Type: Bug Report
1
Keyboard navigation does not work in Firefox 65.0.1

While attempting to implement Keyboard Navigation for one of our RadGrid controls, we discovered that this navigation (Arrow Up/Down and Page Up/Down) did not work correctly in Firefox (though it did within IE, Edge, and Chrome). We also tested the Firefox Keyboard Navigation within the Telerik Grid Demo Site, and experienced the same behavior. 

Issue can also be observed with the Grid - Keyboard Support demo using Firefox 65.0.1

Do you know how to resolve this issue, or of any workaround?

Thank you,
Krassimir

Declined
Last Updated: 04 Jun 2020 10:39 by ADMIN
ExcelML currently does not support multiple column headers (aka ColumnGroups). This was first requested in the forms back in 2012 and no feature request was created for ExcelML. It is important that ExcelML support ColumnGroups as Excel does support this functionality.
Unplanned
Last Updated: 17 Jun 2020 16:20 by ADMIN
Steps to reproduce the error.

Create a ClientDeleteColumn with CommandName="Delete" and wire up the onCommand client-event to RadGrid.

<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>

The event handler does not need to do anything.

function OnCommand(sender, args) {
}
Unplanned
Last Updated: 29 May 2020 15:15 by ADMIN
GridAttachmentColumn malforms the String filepath, from "C\SomePath\SomeFile.PDF" to something like "C:" & vbBack &"SomePathSomeFile.PDF"

Steps to reproduce the error:

DataSource Bound to grid:

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

GridAttachmentColumn markup as well as the ObjectDataSource that returns a byte array when user clicks on download attachment:

<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>

MyApp.MySelectMethod that is supposed access the file by "filePath" and read it to byte, but the filePath is malformed, hence throws an exception.

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


Completed
Last Updated: 02 Oct 2019 14:33 by ADMIN
Exporting an empty RadGrid to XLSX or Biff with ExportSettings-ExportOnlyData="true" and Caption set, throws exception: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Steps to reproduce:

RadGrid markup:

<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>


C# - Code behind

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;
}
Completed
Last Updated: 28 Jun 2019 08:52 by ADMIN

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.

Completed
Last Updated: 02 Oct 2019 14:32 by ADMIN
Created by: Felix
Comments: 8
Category: Grid
Type: Bug Report
3

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

Declined
Last Updated: 28 Jun 2019 11:50 by ADMIN
Created by: product
Comments: 1
Category: Grid
Type: Bug Report
0
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
Unplanned
Last Updated: 29 May 2020 15:53 by ADMIN
ADMIN
Created by: Attila Antal
Comments: 0
Category: Grid
Type: Bug Report
1
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();
        }
Completed
Last Updated: 17 Jun 2020 11:48 by ADMIN
Created by: Darren
Comments: 1
Category: Grid
Type: Feature Request
1
Would be great if font awesome could be used for the radgrid edit/delete/ icons etc....