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

[Solved] 'GridEditFormInsertItem' is a type and cannot be used as an expression

5 Answers 502 Views
Grid
This is a migrated thread and some comments may be shown as answers.
daniel coppee
Top achievements
Rank 1
daniel coppee asked on 21 Apr 2008, 09:25 AM
When I try to use the following code for a pop-up edit template I get the above error.

<tr>
Line 462:                                <td align="right" colspan="2">
Line 463:                                    <asp:Button ID="Button3" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
Line 464:                                        runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
Line 465:                                    </asp:Button>&nbsp;


I took this code from the pop-up example

regards

Daniel

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 21 Apr 2008, 10:52 AM
Hello daniel,

If this is VB.NET you can check this example:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/DataEditing/PopUpEditForm/DefaultVB.aspx

All the best,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
daniel coppee
Top achievements
Rank 1
answered on 21 Apr 2008, 11:04 AM
Hi Vlad,

Yes I know. I took the code straight from this example and still got the error.

The (atleast mine but it's a copy of yours) pop-up does not works with this code

Daniel

 
0
Vlad
Telerik team
answered on 21 Apr 2008, 11:06 AM
Hi daniel,

You missed the VB.NET version of the binding expression:

Iif (TypeOf Container is GridEditFormInsertItem, "Insert", "Update")

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jim
Top achievements
Rank 2
answered on 21 Aug 2009, 05:00 PM

Hello Vlad,

This does not work either. In the sample code, it is posted as Danial had it, not this way. NEITHER WAY works, and I get the following errors:

Error 34 Expression expected. C:\Users\jhoell\AppData\Local\Temp\VWDWebCache\csg-ns1_PolicyTracTEST\AddUploadDocsNF.aspx 225 

Error 50 'GridEditFormInsertItem' is a type and cannot be used as an expression. C:\Users\jhoell\AppData\Local\Temp\VWDWebCache\csg-ns1_PolicyTracTEST\AddUploadDocsNF.aspx 1 1 http://csg-ns1/PolicyTracTEST/

Error 51 The '?' character cannot be used here. C:\Users\jhoell\AppData\Local\Temp\VWDWebCache\csg-ns1_PolicyTracTEST\AddUploadDocsNF.aspx 1 1 http://csg-ns1/PolicyTracTEST/

--------------------------------------------------------------------------------------------------------------------------------------

Posted on Apr 21, 2008

Hi daniel,

You missed the VB.NET version of the binding expression:

Iif (TypeOf Container is GridEditFormInsertItem, "Insert", "Update")

Kind regards,
Vlad
the Telerik team

0
Sebastian
Telerik team
answered on 24 Aug 2009, 01:25 PM

Hello Jim,

You can find the C# and VB.NET version of the example in your local RadControls for ASP.NET AJAX installation at the following default location:

C:\Program Files\telerik\RadControls for ASP.NET AJAX Q2 2009\Live Demos\Grid\Examples\DataEditing\PopUpEditForm

Review and test the code from there and let us know if you have further questions.

Best regards,

Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
daniel coppee
Top achievements
Rank 1
Answers by
Vlad
Telerik team
daniel coppee
Top achievements
Rank 1
Jim
Top achievements
Rank 2
Sebastian
Telerik team
Share this question
or