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

EditMode="InPlace" for radgrid not working

1 Answer 302 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Akki
Top achievements
Rank 1
Akki asked on 12 May 2012, 08:33 AM
Hi ,
I have a radgrid with 4 columns, where i have to edit 2nd column highlighted below. What are things i have to achieve this ?
With below code last row 2nd column of grid is in editable mode and entire row is getting highlighted..  what are things i have to do for editing all rows and only 2 column.

Please Suggest   .

   <telerik:RadGrid ID="rdGrdMenu" runat="server" AutoGenerateColumns="false" AllowFilteringByColumn="true"
                Skin="Office2007" GridLines="Both" OnItemDataBound="rdGrdMenu_ItemDataBound" >
                <MasterTableView EditMode="InPlace">
                    <Columns>
                        <telerik:GridBoundColumn HeaderText="Group Level" UniqueName="prdlvl" DataField="prdlvl"
                            Visible="true" ReadOnly="true">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Description" UniqueName="prdlvldsc" DataField="prdlvldsc"
                            Visible="true" >
                        </telerik:GridBoundColumn>

                        <telerik:GridTemplateColumn HeaderText="Budget" UniqueName="budflg" DataField="budflg">
                            <ItemTemplate>
                                <cc1:AFSAt_CodeDropDown ID="drpDownBdgt" runat="server" AtCodeType="000006" Width="100%">
                                </cc1:AFSAt_CodeDropDown>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Status" UniqueName="Status" DataField="codsts">
                            <ItemTemplate>
                                <cc1:AFSAt_CodeDropDown ID="drpDownStatus" runat="server" AtCodeType="000001" Width="100%">
                                </cc1:AFSAt_CodeDropDown>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

Codebehind :
     protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        //to set the Grid always in edit mode
        foreach (GridDataItem item in rdGrdMenu.MasterTableView.Items)
        {
            item.Edit = true;
        }
        rdGrdMenu.Rebind();
    }

   Regards,
Akki      

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 16 May 2012, 03:52 PM
Hi,

By default RadGrid, SQL Server and most of the databound controls perform edit operation over a row, not by columns. However, you could try the approach shown in this online demo and in this code-library project.


Give these suggestion a try and check whether they suit your needs.

Kind regards,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Akki
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or