Clarification on Grid items

1 Answer 31 Views
Grid
cest
Top achievements
Rank 1
Iron
cest asked on 11 Jul 2024, 01:00 PM | edited on 11 Jul 2024, 01:01 PM

So have a question as I may just not understand the difference to what I think something controls to what it actually controls. When I select the add new record it triggers the following line control:

If e.CommandName = RadGrid.UpdateCommandName Then

Additionally, the edit button also triggers the same line. Is there a way to make that button on the grid trigger one or the other, specifically the performinsertcommand or are both supposed to trigger the same command?

 

(see picture below)

 

Code headers for that grid:
<telerik:RadGrid ID="RadGrid" runat="server" AllowPaging="True" Width="800px" OnItemDataBound="RadGrid_ItemDataBound" OnNeedDataSource="RadGrid_NeedDataSource" OnItemCommand="RadGrid_ItemCommand" 
    OnItemCreated="RadGrid_ItemCreated" OnDeleteCommand="RadGrid_ItemDeleted" Skin="MetroTouch">

1 Answer, 1 is accepted

Sort by
1
Vasko
Telerik team
answered on 16 Jul 2024, 08:41 AM

Hi Christopher,

When using the default Grid command items, the following commands are being triggered: 

  • When you click the "Add new record" button,  the InitInsert command is triggered, and as the name implies, it initializes the insert: 
  • When you click the checkmark in the insert form (its tooltip says "Insert"), the PerformInsert command is triggered, and as its name implies, it performs the inserting of the new record in the Grid/DataBase.
  • The edit button triggers the Edit command, which opens the edit item to edit it.
  • The Update command is triggered once editing is done and the checkmark is clicked (its tooltip says "Edit")

These are the default commands that are being triggered by the built-in buttons on the Grid. I suggest taking a look at the Command Reference for more information regarding the topic.

Best regards,
Vasko
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
Tags
Grid
Asked by
cest
Top achievements
Rank 1
Iron
Answers by
Vasko
Telerik team
Share this question
or