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

Showing update/cancel buttons during edit

2 Answers 105 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 2
Brian asked on 26 Sep 2013, 08:12 PM
I have "auto generate edit column" off and instead added an "edit" button manually because I needed to set it to visible=false in some rows.  The event fires properly but when the grid goes into edit mode, the "update" and "cancel" links don't appear.  

I need to do either one of the following:

  1. Show the update and cancel buttons or 
  2. Use the auto generated edit column but need to know how to access the column.  I thought that I could access the button with item("EditCommandColumn").controls(0) but that isn't accessing the control.

Thanks.


2 Answers, 1 is accepted

Sort by
0
Brian
Top achievements
Rank 2
answered on 26 Sep 2013, 08:47 PM
Resolved.  It's item("AutoGeneratedEditColumn").controls(0)
0
Princy
Top achievements
Rank 2
answered on 27 Sep 2013, 11:45 AM
Hi m Brian,

You can add a GridEditCommandColumn and using its UniqueName, you can access it from code behind and hide it.
Please try the following code snippet.

ASPX:
<telerik:GridEditCommandColumn UniqueName="GridEditCommandColumn" ButtonType="LinkButton">
</telerik:GridEditCommandColumn>

C#:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
 {
    if (e.Item is GridDataItem)
    {
      GridDataItem item=(GridDataItem)e.Item;
      //Condition
       {
         LinkButton edit = (LinkButton)item["GridEditCommandColumn"].Controls[0];
         edit.Visible = false;
       }
    }
 }

Thanks,
Princy
Tags
Grid
Asked by
Brian
Top achievements
Rank 2
Answers by
Brian
Top achievements
Rank 2
Princy
Top achievements
Rank 2
Share this question
or