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:
Thank you.
PS: I also tried to set the AllowAutomaticDeletes/Inserts/Updates to False but nothing..
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> |
PS: I also tried to set the AllowAutomaticDeletes/Inserts/Updates to False but nothing..