This is a migrated thread and some comments may be shown as answers.

Using radGrid for Editing and inserting records

1 Answer 38 Views
Documentation and Tutorials
This is a migrated thread and some comments may be shown as answers.
Rooney
Top achievements
Rank 1
Rooney asked on 21 Jan 2015, 11:10 PM
Hi,

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?

Regards,
Rooney

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 26 Jan 2015, 12:04 PM
Hello Rooney,

You can determine whether the item is in edit or insert form:
http://www.telerik.com/help/aspnet-ajax/grid-distinguish-edit-insert-mode-on-itemcreated-itemdatabound.html

And hide the required cell:
( Section Accessing controls in edit/insert mode )
http://www.telerik.com/help/aspnet-ajax/grid-accessing-cells-and-rows.html

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.


Regards,
Eyup
Telerik
 

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.

 
Tags
Documentation and Tutorials
Asked by
Rooney
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or