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

Override inline edit style (one instance)

1 Answer 114 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mike
Top achievements
Rank 1
mike asked on 24 Mar 2009, 10:36 PM
Hi;

I need to be able to override the style for inline editting on one of my grids.  This grid is a batch update where all the rows are changed to edit mode in PreRender.

My skin shows the grid as a green row when selected by default. 

Is there anyway to change it so it will look like the gridrow is not in edit mode?

Here is my preRender code:  But it does not change the style.

 // change all rows into edit mode.
            bool altRow = false;
            foreach (GridItem item in this.RadGridThematicLayer.MasterTableView.Items)
            {
                if (item is GridEditableItem)
                {
                    // Here is where we add the style to make it look like everything else.
                    GridEditableItem editableItem = item as GridDataItem;
                    if (editableItem != null)
                    {
                        editableItem.Edit = true;
                        editableItem.CssClass = altRow ?  "GridAltRow_Telerik" : "GridRow_Telerik";
                        altRow = !altRow;
                    }
                }
            }
            RadGridThematicLayer.Rebind();

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 25 Mar 2009, 04:05 AM
Hello Mike,

A rather simpler approach is to set the backcolor of the edit rows in the EditItemStyle tag of the RadGrid as shown below:
aspx:
 <telerik:RadGrid  ID="RadGrid1" AutoGenerateEditColumn="true"  DataSourceID="SqlDataSource1" AllowMultiRowEdit="true" runat="server" AutoGenerateColumns="false" > 
         <EditItemStyle BackColor="Transparent"/> 
           <MasterTableView EditMode="InPlace" DataSourceID="SqlDataSource1" > 

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