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

Grid EditForm error in OnItemCommand

3 Answers 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 2
Dan asked on 10 May 2010, 03:29 PM
I have an Edit FormTemplate in my Grid that is bound to an OleDb dataset (Access).  On submission of the edit form, control goes to my OnItemCommand routine.  The statement:

GridEditableItem grdSelected = (GridEditableItem)e.Item;
Results in the error:
{"The current EditFormType does not support the requested editing capabilities."}

and I am unable to retrieve the form's data values from their controls.
This same code works fine with a SQL dataset.  Here is my OleDb code that populates the grid:

 

OleDbConnection accConn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=//webservice/C$/temp/fcData.mdb");  
OleDbCommand accCommand = new OleDbCommand("select mmw_drug_disp.descdisplay,strength,strengthunit,ddid,dosechekunit, strength+' '+strengthunit as dispdose, mmw_drug_name.descdisplay as drugname, "  
   + "'' as freq, '' as route, '' as comments, null as startdate, null as stopdate, null as dcdate, '' as therapy "  
   + "from mmw_drug_disp "  
   + "inner join mmw_drug_name on  mmw_drug_disp.pnid = mmw_drug_name.pnid "  
   + "where mmw_drug_disp.haspackdrugind=1 and mmw_drug_disp.descsearch like '" + searchtext + "%' order by mmw_drug_disp.descdisplay", accConn);  
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(accCommand);  
accConn.Open();  
DataSet myDataSet = new DataSet();  
myDataAdapter.Fill(myDataSet, "Names");  
 
RadGrid1.DataSource = myDataSet;  
RadGrid1.DataMember = "Names";  
this.DataBind(); 
Thanks for asny suggestions.  Dan

3 Answers, 1 is accepted

Sort by
0
Dan
Top achievements
Rank 2
answered on 10 May 2010, 04:33 PM
Dh-oh!  Found my problem.  The OleDb dataset was being rebound in PageLoad before getting to the OnItemCommand routine.  My mistake.
Dan
0
Dan
Top achievements
Rank 2
answered on 10 May 2010, 05:49 PM
Clarification.  My problem is fixed in that I can now retrive the data values from the submitted form.
However, in OnItemCommand, grdSelected.EditManager is still throwing the exception:
{"The current EditFormType does not support the requested editing capabilities."}

It is just that this "problem" is not preventing me from using the page.

Dan
0
Mira
Telerik team
answered on 13 May 2010, 10:35 AM
Hello Dan,

EditManagers and GridColumnEditors are only used for auto-generated edit forms when you have InPlace or EditForms edit mode.
When you define custom user control or Form Template for your edit form, then to access a control from it you can use the FindControl() method. For additional information, please take a look at this help topic.

Regards,
Mira
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Dan
Top achievements
Rank 2
Answers by
Dan
Top achievements
Rank 2
Mira
Telerik team
Share this question
or