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

command buttons disappear

2 Answers 474 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rick
Top achievements
Rank 1
Veteran
Rick asked on 21 Jun 2019, 05:30 PM

Clicking a command button on my grid and running the code the handler contains causes all command buttons in that row to disappear. Refreshing the page makes them reappear.

Perhaps I am not using it correctly.

     <TelerikGridCommandButton Command="Edit" OnClick="@OpenRequestEditWindow" Icon="edit">Edit</TelerikGridCommandButton>
     <TelerikGridCommandButton Command="Delete" OnClick="@DeleteRequestItem" Icon="delete">Delete</TelerikGridCommandButton>

 

Clicking the "Edit" button opens a window with controls on it. User edits the values in the controls and has a save button 

  <TelerikButton Icon="save" OnClick="@UpdateRequest">Save Purchase Request</TelerikButton><br /><br />

This event simply writes to the database and then rebinds the grid data.

 var grid = await service.GetRequests();
 RequestAddGrid = grid.ToList();

2 Answers, 1 is accepted

Sort by
0
Accepted
Rick
Top achievements
Rank 1
Veteran
answered on 21 Jun 2019, 07:47 PM
It looks like this was because of what i was naming the command, "Edit". Changed the command name and it's fine.
0
Marin Bratanov
Telerik team
answered on 24 Jun 2019, 11:24 AM
Hi Rick,

If you have those buttons in a command column, then firing the Edit or Delete commands have definitive meaning of their own in the grid, and you must, indeed, use different names for custom commands.


Regards,
Marin Bratanov
Progress Telerik UI for Blazor
Rob
Top achievements
Rank 3
Iron
Iron
Iron
commented on 30 Jan 2025, 01:41 AM

Hi Marin,

I'm having a similar issue, all my GridCommandColum with GridCommandButton and the buttons will disappear as soon as I enter into cell edit (InCell).  

I tried renaming the Command="someotheredit" and the problems persists, all buttons disappear as soon as I enter into cell edit on the grid.

Rob.

Dimo
Telerik team
commented on 30 Jan 2025, 12:42 PM

@Rob - command buttons are visible either in display mode, or in edit mode, but not in both cases. This depends on the ShowInEdit parameter. If you need a command to be always usable, then you will need two command buttons.

Tags
Grid
Asked by
Rick
Top achievements
Rank 1
Veteran
Answers by
Rick
Top achievements
Rank 1
Veteran
Marin Bratanov
Telerik team
Share this question
or