Unplanned
Last Updated: 27 Jun 2023 18:30 by Rathna

ResizeGridOnColumnResize is not working the same way when Grid has StaticHeaders.

I want to resize the grid based on the contents and still be able to scroll with headers.

Unplanned
Last Updated: 11 Nov 2024 14:16 by ADMIN

Upon inserting a new record after filtering on the Grid with No records, the exception "No property or field 'Name' exists in type 'DataRowView'" is thrown.

Steps to reproduce:

  1. Bind the Grid to an empty data source at initial load
  2. Filter any column
  3. Insert a new record

Code to replicate the issue:

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" AllowFilteringByColumn="true"
    OnNeedDataSource="RadGrid1_NeedDataSource" OnInsertCommand="RadGrid1_InsertCommand">
    <MasterTableView CommandItemDisplay="Top" DataKeyNames="ID">
        <Columns>
            <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
            <telerik:GridButtonColumn CommandName="Delete"></telerik:GridButtonColumn>

            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID" ReadOnly="true"
                CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />

            <telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="Name"
                AutoPostBackOnFilter="false" />

            <telerik:GridBoundColumn DataField="Category" HeaderText="Category" UniqueName="Category" DataType="System.String"
                CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />

            <telerik:GridBoundColumn DataField="Price" HeaderText="Price" UniqueName="Price"
                CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" DataFormatString="{0:C}" />
        </Columns>
        <EditFormSettings InsertCaption="Add New Item" />
    </MasterTableView>
</telerik:RadGrid>

 

C#

private const string DataTableSessionKey = "RadGridDataTable";
private DataTable SessionDataSource
{
    get
    {
        DataTable dt = Session[DataTableSessionKey] as DataTable;

        if (dt == null || !IsPostBack)
        {
            // Create an empty DataTable with schema defined
            dt = new DataTable();

            dt.Columns.Add("ID", typeof(int));
            dt.Columns.Add("Name", typeof(string));
            dt.Columns.Add("Category", typeof(string));
            dt.Columns.Add("Price", typeof(decimal));

            dt.PrimaryKey = new DataColumn[] { dt.Columns["ID"] };

            Session[DataTableSessionKey] = dt;
        }

        return dt;
    }
}
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    (sender as RadGrid).DataSource = SessionDataSource;
}

protected void RadGrid1_InsertCommand(object sender, GridCommandEventArgs e)
{
    GridEditableItem insertItem = (GridEditableItem) e.Item;

    Hashtable newValues = new Hashtable();

    insertItem.ExtractValues(newValues);

    DataRow findLastItem = SessionDataSource.Select("ID=MAX(ID)").FirstOrDefault();

    newValues["ID"] = findLastItem != null ? (int) findLastItem["ID"] + 1 : 0;

    DataRow rowToInsert = SessionDataSource.NewRow();

    foreach (DictionaryEntry entry in newValues)
    {
        rowToInsert[entry.Key.ToString()] = entry.Value ?? DBNull.Value;
    }

    SessionDataSource.Rows.Add(rowToInsert);
}

Completed
Last Updated: 03 Apr 2013 08:07 by ADMIN
ADMIN
Created by: Marin
Comments: 0
Category: Grid
Type: Feature Request
1
Additional improvements for the MultiColumn Headers can be considered if needed:
1. Support for Header context menu
2. Client-side show / hide operations with the columns
Declined
Last Updated: 03 Apr 2015 15:31 by ADMIN
Created by: Fergal
Comments: 1
Category: Grid
Type: Bug Report
1
When Grouping on an Integer value, the groups are not ordering correctly. i.e. if you group on values {864, 1455, 1494}, the actual order comes out as {1455, 1494, 864}.

Ordering on the same data, but converted to a string and padded to the left with zeros resolves this issue.
Completed
Last Updated: 18 Sep 2013 15:01 by Dennis
ADMIN
Created by: Angel Petrov
Comments: 1
Category: Grid
Type: Bug Report
1

			
Completed
Last Updated: 15 Jul 2013 11:35 by ADMIN
ADMIN
Created by: Maria Ilieva
Comments: 0
Category: Grid
Type: Feature Request
1

			
Declined
Last Updated: 21 Dec 2013 10:32 by ADMIN
Created by: Srujal
Comments: 1
Category: Grid
Type: Feature Request
1
Hi,

 In our project we are using the telerik grid on Invoice screen to display item list. 
 We are adding item from text box and adds it to grid dynamically using UpdateGrid javascript function. 
 
 Issue:
  When we add the new item to grid. It adds to grid as last row. But grid is not scrolling to last row.
  We want to scroll grid to last row every time we add new item.
  
  Below are the settings used in grid which did not work out:
<ClientEvents OnRowSelected="rowSelected" OnRowCreated="OnRowCreated" OnRowCreating="OnRowCreating" />
<Scrolling AllowScroll="True" EnableVirtualScrollPaging="True" UseStaticHeaders="false" SaveScrollPosition="true" />
  
Please help.
Completed
Last Updated: 11 Jul 2013 11:56 by ADMIN
Completed
Last Updated: 24 Sep 2014 08:16 by Garry
Completed
Last Updated: 04 Sep 2013 14:08 by ADMIN
ADMIN
Created by: Milena
Comments: 0
Category: Grid
Type: Feature Request
1

			
Declined
Last Updated: 02 Mar 2022 13:25 by ADMIN
Created by: DanKline
Comments: 1
Category: Grid
Type: Feature Request
1
I'm a great fan of KendoUI and love the declarative binding and property declaration with JavaScript Literal notation.  However, Rest Binding in SharePoint is still immature and there is very little support for relationships and data projections.  As a result, I find myself coming back to the SPRadGrid.  However, I find the functionality very limited and in some cases non-functional.  I'd love to see a rewrite of the SPRadGrid that has more functions and used declarative bindings.    I'd also like to see  solution package distributed with a working Grid sample so that it was easier to modify it and deploy a customized solution.  SharePoint is complex.  It's always easier to start with a working sample.
Completed
Last Updated: 24 Nov 2015 09:14 by ADMIN
Declined
Last Updated: 03 Nov 2014 10:56 by Elena
In the following scenario it is not working.
1.	Grid populated with data.
2.	Filter applied on one of the columns in the grid. As a result data filtered correctly in the grid.
3.	For e.g 2nd column is moved to 5th column as vice versa.
4.	Again Filter applied on one of the columns in the grid.
5.	Grid data is not filtering as expected and column reorder that we did in point (3) is rolled back. (i.e., 5th column moved to 2nd column, vice versa)


Please help us in fixing this issue.