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

Showing update/cancel buttons during edit

2 Answers 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
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 1
answered on 26 Sep 2013, 08:47 PM
Resolved.  It's item("AutoGeneratedEditColumn").controls(0)
0
Princy
Top achievements
Rank 1
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 1
Answers by
Brian
Top achievements
Rank 1
Princy
Top achievements
Rank 1
Share this question
or