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

EditFormType does not support editing

3 Answers 282 Views
Grid
This is a migrated thread and some comments may be shown as answers.
david
Top achievements
Rank 1
david asked on 21 Jan 2009, 02:46 PM
Hi,

In my editform (itemDatabound) I am trying to populate a dropdownlist thusly:

if

 

(e.Item is GridEditFormItem && e.Item.IsInEditMode)

 

{

 

GridEditFormItem item = (GridEditFormItem)e.Item;

 

 

GridEditableItem editedItem = e.Item as GridEditableItem;

 

 

GridEditManager editMan = editedItem.EditManager;

 

 

GridDropDownListColumnEditor editor = editMan.GetColumnEditor("NumericGrade") as GridDropDownListColumnEditor;

 

 

DropDownList ddlist = editor.DropDownListControl;

 


here is the error, I'm not sure what to do?

The current EditFormType does not support the requested editing capabilities.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Telerik.Web.UI.GridBindingException: The current EditFormType does not support the requested editing capabilities.

Source Error:

Line 103:
Line 104:            GridEditableItem editedItem = e.Item as GridEditableItem;
Line 105: GridEditManager editMan = editedItem.EditManager;

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 22 Jan 2009, 08:05 AM
Hi David,

I was able to replicate this issue when I set the  EditFormType property of the Grid to Template/WebUserControl. Try setting it to AutoGenerated and see whether the exception is comming.

ASPX:
 <EditFormSettings EditFormType="AutoGenerated" > 
                    </EditFormSettings> 


Regards
Shinu
0
Stacy
Top achievements
Rank 1
answered on 17 Jan 2011, 02:36 PM
Is there a way for this to work without having "AutoGenerated"?  I am using this line "<EditFormSettings EditFormType="Template" >" and i get the error mentioned above.  It does work if i use "AutoGenerated" however I lose my formatting of columns.  They are just listed in a stack and this does not look very good.  ANy ideas?  Thanks.
0
Princy
Top achievements
Rank 2
answered on 18 Jan 2011, 10:57 AM
Hello Stacy,

When EditFormType is "Template", you can supply a template(custom edit form) that the table view uses to generate the edit form. That means you cannot access the control in built- in edit form. One option is you can set EditFormType as "Template" and use controls similar to that in built-in edit form( Eg: Use DropDownList in custom edit form for the GridDropDownColumn in Radgrid).

ASPX:
<FormTemplate>
     <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1"
        DataTextField="Name" DataValueField="Name">
     </asp:DropDownList>
</FormTemplate>

And from code behind access the DropDownList using FindControl method.
C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
   {
       if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
       {
           GridEditFormItem item = (GridEditFormItem)e.Item;
           DropDownList drlist = (DropDownList)item.FindControl("DropDownList1");
       }
   }

Thanks,
Princy.
Tags
Grid
Asked by
david
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Stacy
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or