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

[Solved] RadGrid not entering in edit mode.

1 Answer 96 Views
Grid
This is a migrated thread and some comments may be shown as answers.
hk proj
Top achievements
Rank 1
hk proj asked on 21 Aug 2009, 10:25 AM
Hi, I'm using RadGrid to show my data.
I programmatically assign the DataSource to the DataGrid
And I'm using almost only TemplateColumn.
And I'm using the EditFormTemplate to define the template for editing (because I need flexibility).
But now, the Grid is not entering in edit mode... I tried a lot of methods.. using CommandName = "Edit" or by using Item.Edit = true or using the EditIndexes Collection... but none of them worked...
Can you help me?
Here the Grid declaration:
<rad:RadGrid ID="articlesGrid" runat="server" AllowPaging="true" AllowSorting="false" 
    AutoGenerateColumns="false" AutoGenerateDeleteColumn="false" AutoGenerateEditColumn="false" 
    AllowAutomaticDeletes="True" AllowAutomaticInserts="True"  
    AllowAutomaticUpdates="True" onitemdatabound="articlesGrid_ItemDataBound"  
    onitemcommand="articlesGrid_ItemCommand"  
    onsortcommand="articlesGrid_SortCommand" oneditcommand="articlesGrid_EditCommand" 
    > 
    <MasterTableView NoMasterRecordsText="<%$ Resources:,NoData %>" PageSize="10" AllowPaging="true" AllowSorting="false"
        <Columns> 
            <rad:GridTemplateColumn UniqueName="id" ReadOnly="true" HeaderText="<%$ Resources:Grids,Articles_ID %>" SortExpression="id_article"
                <ItemTemplate> 
                    <asp:Label ID="labelID" runat="server" Text='<%# Eval("id_article") %>' /> 
                </ItemTemplate> 
            </rad:GridTemplateColumn> 
            <rad:GridTemplateColumn UniqueName="title" HeaderText="<%$ Resources:Grids,Articles_Title %>" SortExpression="title"
                <ItemTemplate> 
                    <asp:Label ID="labelTitle" runat="server" Text='<%# Eval("title") %>' /> 
                </ItemTemplate> 
            </rad:GridTemplateColumn> 
            <rad:GridButtonColumn UniqueName="edit" HeaderText="<%$ Resources:Labels,Edit %>" CommandName="Edit" Text="<%$ Resources:Labels,Edit %>" /> 
            <rad:GridButtonColumn UniqueName="delete" HeaderText="<%$ Resources:Labels,Delete %>" CommandName="Delete" Text="<%$ Resources:Labels,Delete %>" /> 
        <!--CONTINUES--> 
        </Columns> 
        <EditFormSettings EditFormType="Template"
            <FormTemplate> 
                <table> 
                    <tr align="right"
                        <td colspan="2"
                            <asp:ImageButton ID="buttonUpdate" runat="server" CommandName="Update" ToolTip="<%$ Resources:Labels,Update %>" ValidationGroup="editArticle" CausesValidation="true" /> 
                            <asp:ImageButton ID="buttonCancel" runat="server" CommandName="Cancel" ToolTip="<%$ Resources:Labels,Cancel %>" /> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td> 
                            <asp:Label ID="Label1" runat="server" Text="<%$ Resources:,Author %>" AssociatedControlID="textBoxAuthor" /> 
                        </td> 
                        <td> 
                            <asp:TextBox ID="textBoxAuthor" runat="server" Text='<%# Bind("author") %>' MaxLength="80" Width="200px" /> 
                        </td> 
                    </tr> 
                <!--CONTINUES...--> 
                </table> 
            </FormTemplate> 
        </EditFormSettings> 
    </MasterTableView> 
</rad:RadGrid>
Thank you.
PS: I also tried to set the AllowAutomaticDeletes/Inserts/Updates to False but nothing..

1 Answer, 1 is accepted

Sort by
0
hk proj
Top achievements
Rank 1
answered on 21 Aug 2009, 10:50 AM
Ok, solved. There was an error in the template.
Tags
Grid
Asked by
hk proj
Top achievements
Rank 1
Answers by
hk proj
Top achievements
Rank 1
Share this question
or