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

[Solved] Hiding Edit Button with custom EditFormSettings

1 Answer 116 Views
Grid
This is a migrated thread and some comments may be shown as answers.
J. David
Top achievements
Rank 1
J. David asked on 09 Apr 2013, 05:39 PM

Hello,

Have custom EditFormSettings with a delete button that is wired to a postback event handler.

<EditFormSettings>
...
<FormTemplate>
...

<telerik:RadButton ID="btnDelete" Text="Delete" Visible='<%# (Container is GridEditFormInsertItem) ? false : true %>' runat="server" CausesValidation="false" Icon-PrimaryIconCssClass="rbRemove" Icon-PrimaryIconLeft="4" Icon-PrimaryIconTop="4" onclick="btnDelete_Click"/>


</FormTemplate>
</EditFormSettings>
<LinqDataSource ...

code

 

dataContext.TableName.DeleteOnSubmit(item);

 

sdb.SubmitChanges();

rgFormEmail.DataBind()

Grid is shown and edit button is hidden. Code below resolves but why would the edit column be hidden?

rgFormEmail.MasterTableView.GetColumn("BtnEdit").Visible = true;

 

 

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 12 Apr 2013, 01:02 PM
Hi David,

Could you please provide the code snippet of your EditButton because the one which you provided is for the Delete button? If the Visible expression is the same, the button will be visible only when you are editing a row. On insert command the button will be hidden.

Kind regards,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
J. David
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or