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

set style of insert/cancel in Editforms forms

1 Answer 33 Views
Grid
This is a migrated thread and some comments may be shown as answers.
kieran
Top achievements
Rank 1
kieran asked on 01 Jul 2009, 05:45 PM
hi

When set style of edit on grids to EditForms, it all works fine except how do you apply style or change the styles of the insert/update/cancel buttons on these Editforms and also their position, they appear on the bottom left of the edit form

Thanks
Kieran

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Jul 2009, 06:00 AM
Hello Kieran,

You can acces the buttons and set the required styles as shown in the example below:
c#:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridEditFormItem && e.Item.IsInEditMode && !e.Item.OwnerTableView.IsItemInserted) 
        { 
            GridEditFormItem editItem = (GridEditFormItem)e.Item; 
            LinkButton btnUpdate = (LinkButton)editItem.FindControl("UpdateButton"); 
            LinkButton btnCancel = (LinkButton)editItem.FindControl("CancelButton"); 
            btnUpdate.Style.Add("margin-left""800px"); 
            btnUpdate.Style.Add("color""red"); 
            btnCancel.Style.Add("color""red"); 
        } 
        if (e.Item is GridEditFormInsertItem && e.Item.OwnerTableView.IsItemInserted) 
        { 
            GridEditFormInsertItem editItem = (GridEditFormInsertItem)e.Item; 
            LinkButton btnInsert = (LinkButton)editItem.FindControl("PerformInsertButton"); 
            LinkButton btnCancel = (LinkButton)editItem.FindControl("CancelButton"); 
            btnInsert.Style.Add("margin-left""800px"); 
            btnInsert.Style.Add("color""red"); 
            btnCancel.Style.Add("color""red"); 
        } 

Thanks
Princy.
Tags
Grid
Asked by
kieran
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or