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

Edit,Delete Columns

4 Answers 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
sushant
Top achievements
Rank 1
sushant asked on 03 Nov 2008, 05:57 AM
Hi Everyone,


I am creating grid dynamically,my problem is when I use simple edit,delete my grid is working fine,but when I used image button I get javascript error,please help me as soon as possible

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 03 Nov 2008, 08:21 AM
Hello sushant,

Please provide a bit more info about this JavaScript error.

Kind regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
sushant
Top achievements
Rank 1
answered on 03 Nov 2008, 09:06 AM
Hi Vlad,

Actually I don't get javascript error but problem is that my edit command event does ot fire,please provide soltion as early as possible
0
Princy
Top achievements
Rank 2
answered on 03 Nov 2008, 11:05 AM
Hello Sushant,

The EditCommand event should fire if the ButtonType is set as ImageButton for the EditCommandColumn. Check if the EditCommand EventHandler is set properly.
aspx:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="True" OnNeedDataSource="RadGrid1_NeedDataSource" OnEditCommand="RadGrid1_EditCommand"
    <MasterTableView> 
        <Columns>             
           <telerik:GridEditCommandColumn ButtonType="ImageButton"  EditImageUrl="images/EditImage.bmp"
            </telerik:GridEditCommandColumn> 
            .... 

cs:
 protected void RadGrid1_EditCommand(object source, GridCommandEventArgs e) 
    { 
 
    } 

If you use an ImageButton in TemplateColumn, make sure that you have set the CommandName property for the button to Edit/Delete.
aspx:
<telerik:GridTemplateColumn> 
      <ItemTemplate> 
            <asp:ImageButton ID="ImageButton1" CommandName="Edit" ImageUrl="~/images/Edit.gif" runat="server" /> 
      </ItemTemplate> 
</telerik:GridTemplateColumn>     

Thanks
Princy.
0
sushant
Top achievements
Rank 1
answered on 03 Nov 2008, 12:08 PM
Hi Princy,

Thanx for the reply,but I am creating grid at run time and also tried your solution but still it is not working,edit form is not opening.
Tags
Grid
Asked by
sushant
Top achievements
Rank 1
Answers by
Vlad
Telerik team
sushant
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or