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

FormTemplate style buttons skin

1 Answer 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 07 Jan 2013, 06:50 PM

Hi there,

At the moment I am using both the auto-generated edit form and the FormTemplate for my grid.
When I use the FormTemplate I want to have the update and cancel buttons the same skin for the buttons as the ones from the auto-generated edit form.


At the moment I use the code below inside the FormTemplate for the Cancel button.
Is there a way the button does not use the ImageUrl="~/Images/Cancel.gif" property but the skin set of my project?

Regards,

Marcel

 

<asp:ImageButton ID="ibCancel"
ImageUrl="~/Images/Cancel.gif"                                              
runat="server" Text="Cancel" CausesValidation="false" CommandName="Cancel" />

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 08 Jan 2013, 05:37 AM
Hello,

<EditFormSettings EditColumn-ButtonType="ImageButton" EditColumn-CancelImageUrl="images/jayesh-Softweb.jpg">
                </EditFormSettings>

//OR

Please set imageURl or CSSClass based on your skin

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item.IsInEditMode)
        {
            if (e.Item is GridEditFormInsertItem)
            {
                GridEditFormItem editItem = (GridEditFormItem)e.Item;
                ImageButton InsertButton = (ImageButton)editItem.FindControl("PerformInsertButton");
                InsertButton.ToolTip = "Add Class ";
                ImageButton CancelButton = (ImageButton)editItem.FindControl("CancelButton");
                CancelButton.ToolTip = "Cancel adding Class";
                CancelButton.ImageUrl = "http://cdn1.iconfinder.com/data/icons/meBaze-Freebies/32/cancel.png";
            }
            else
            {
                GridEditFormItem editItem = (GridEditFormItem)e.Item;
                ImageButton updateButton = (ImageButton)editItem.FindControl("UpdateButton");
                updateButton.ToolTip = "Save Class Changes";
                ImageButton CancelUpdateButton = (ImageButton)editItem.FindControl("CancelButton");
                CancelUpdateButton.ToolTip = "Cancel changes";
                CancelUpdateButton.ImageUrl = "http://cdn1.iconfinder.com/data/icons/meBaze-Freebies/32/cancel.png";
            }
 
        }
    }


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Marcel
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or