Using radGrid for Editing and inserting records

2 posts, 0 answers
  1. Rooney
    Rooney avatar
    2 posts
    Member since:
    Jan 2015

    Posted 21 Jan 2015 Link to this post


    I am new to using Telerik and new to this forum too. Kindly pardon me if missed any necessary details in my question.

    I am using EditFormSettings  with EditFormType as Template. I want to allow the user to edit two columns (say, column A and B) but I while inserting a new record, the user should be able to insert three columns (say, A, B and C). Is it possible to using the telerik:RadGrid? If yes, can you please share the idea/code on how it needs to be done?

  2. Eyup
    Eyup avatar
    3322 posts

    Posted 26 Jan 2015 Link to this post

    Hello Rooney,

    You can determine whether the item is in edit or insert form:

    And hide the required cell:
    ( Section Accessing controls in edit/insert mode )

    For example, if you want to hide a field only during inserting, it will be something similar to this:

    Copy Code
    Copy Code
    Copy Code
    Copy Code
    Protected Sub RadGrid1_ItemCreated(sender As Object, e As GridItemEventArgs)
        If TypeOf e.Item Is IGridInsertItem Then
            Dim cell As TableCell = TryCast(e.Item, GridEditableItem)("ColumnUniqueName")
            cell.Parent.Visible = False
        End If
    End Sub

    Hope this helps.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top