Gary
Gary

Reputation: 305

Telerik radGrid Is there a way to not have edit form embedded in middle of grid?

I am trying out the RadGridControl. I was hoping to use the "Edit" column they have and build my own panel below the RadGrid for adding/updating data. Is there an easy way to do this?

I can't get the grid to stop handling my "Edit' click and expanding.

Upvotes: 2

Views: 352

Answers (1)

Win
Win

Reputation: 62301

You can use regular ButtonColumn and capture the click event in ItemCommand.

<telerik:GridButtonColumn 
   ButtonType="ImageButton" 
   CommandName="Update" 
   ImageUrl="~/Images/Edit.png"
   Text="Click to edit" 
   UniqueName="Edit" 
   HeaderText="Edit">
</telerik:GridButtonColumn>

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
{
   if (e.CommandName == "Update")
   {
      int id = Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues
         [e.Item.ItemIndex]["Id"]);    

      YourEditPanel.Visible = true;
   }
}

Upvotes: 1

Related Questions