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

EditForm only shown when the EditFormType is AutoGenerated

1 Answer 13 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Zeyad
Top achievements
Rank 1
Zeyad asked on 27 Oct 2013, 01:31 PM
Hello,

In my project i am using a RadGrid control, when the EditFormType in EditFormSettings is set to "AutoGenerated" and once i click the Edit button, the Edit Form is shown perfectly and working.

Now, i am trying to build a template since i don't need all the data to be edited, i tried to use

<EditColumn UniqueName="EditCommanColumn1"></EditColumn>
                        <FormTemplate>
                            Test
                        </FormTemplate>
                    </EditFormSettings>

And once i click the edit image, the form is not showing

Here's my code

<telerik:RadGrid ID="RadGrid1"  runat="server" ShowStatusBar="True"
       AutoGenerateColumns="False" PageSize="3" AllowSorting="True" AllowMultiRowSelection="False"
       AllowPaging="True" OnItemCreated="RadGrid1_ItemCreated"
       AllowAutomaticUpdates="True" OnItemUpdated="RadGrid1_ItemUpdated" Width="843px"
               onupdatecommand="RadGrid1_UpdateCommand" OnItemCommand="RadGrid1_ItemCommand"
                   GridLines="None" Height="248px">
        
          <MasterTableView DataSourceID="SqlDataSourceGrades" DataKeyNames="StudentID" AllowMultiColumnSorting="True"
           Width="100%" CommandItemDisplay="Top" Name="StudentID">
           <Columns>
                            
           <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                    
                    
               <HeaderStyle Width="20px"></HeaderStyle>
               <ItemStyle CssClass="MyImageButton"></ItemStyle>
               </telerik:GridEditCommandColumn>
               <telerik:GridBoundColumn SortExpression="StudentID" HeaderText="ID" HeaderButtonType="TextButton"
                   DataField="StudentID" UniqueName="StudentID" MaxLength="7">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="AC1" HeaderText="AC1" HeaderButtonType="TextButton"
                   DataField="AC1" UniqueName="AC1">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="GR1" HeaderText="GR1" HeaderButtonType="TextButton"
                   DataField="GR1" UniqueName="GR1">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="T1" HeaderText="T1" HeaderButtonType="TextButton"
                   DataField="T1" UniqueName="T1">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="AC2" HeaderText="AC2" HeaderButtonType="TextButton"
                   DataField="AC2" UniqueName="AC2">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="GR2" HeaderText="GR2" HeaderButtonType="TextButton"
                   DataField="GR2" UniqueName="GR2">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="T2" HeaderText="T2" HeaderButtonType="TextButton"
                   DataField="T2" UniqueName="T2">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="AC3" HeaderText="AC3" HeaderButtonType="TextButton"
                   DataField="AC3" UniqueName="AC3">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="GR3" HeaderText="GR3" HeaderButtonType="TextButton"
                   DataField="GR3" UniqueName="GR3">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="T3" HeaderText="T3" HeaderButtonType="TextButton"
                   DataField="T3" UniqueName="T3">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="AC4" HeaderText="AC4" HeaderButtonType="TextButton"
                   DataField="AC4" UniqueName="AC4">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="GR4" HeaderText="GR4" HeaderButtonType="TextButton"
                   DataField="GR4" UniqueName="GR4">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="T4" HeaderText="T4" HeaderButtonType="TextButton"
                   DataField="T4" UniqueName="T4">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="Sem1" HeaderText="Sem1" HeaderButtonType="TextButton"
                   DataField="Sem1" UniqueName="Sem1">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="Sem2" HeaderText="Sem2" HeaderButtonType="TextButton"
                   DataField="Sem2" UniqueName="Sem2">
               </telerik:GridBoundColumn><telerik:GridBoundColumn SortExpression="G" HeaderText="G" HeaderButtonType="TextButton"
                   DataField="G" UniqueName="G">
               </telerik:GridBoundColumn>
               <telerik:GridTemplateColumn>
                    
               <ItemTemplate>
                       
                   <asp:Label ID="lblEvaluate" runat="server"></asp:Label>
                   </ItemTemplate>
                   </telerik:GridTemplateColumn>
                   </Columns>
                   <EditFormSettings EditFormType="Template">
                   <EditColumn UniqueName="EditCommanColumn1"></EditColumn>
                       <FormTemplate>
                           Test
                       </FormTemplate>
                   </EditFormSettings>
                    
                   <SortExpressions>
                
           <telerik:GridSortExpression FieldName="StudentID"></telerik:GridSortExpression>
           </SortExpressions>
            
           </MasterTableView>
           </telerik:RadGrid>

What i am missing?


Many thanks in advance

1 Answer, 1 is accepted

Sort by
0
Zeyad
Top achievements
Rank 1
answered on 27 Oct 2013, 02:27 PM
Got it to work...All i had to do was to remove Name="StudentID" from the MasterTableView tag.


Thanks :)
Tags
Grid
Asked by
Zeyad
Top achievements
Rank 1
Answers by
Zeyad
Top achievements
Rank 1
Share this question
or