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

Anyway to enable use of Option Strict?

3 Answers 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lenny_shp
Top achievements
Rank 2
Lenny_shp asked on 14 Sep 2011, 09:01 PM
 Private Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound

e.Item.DataItem("Option").ToString

Option Strict On disallows late binding.

3 Answers, 1 is accepted

Sort by
0
Dan Lehmann
Top achievements
Rank 1
answered on 14 Sep 2011, 10:53 PM
look in web.config for a line like:
        <compilation debug="true" strict="false" explicit="true" targetFramework="4.0">

Dan
0
Lenny_shp
Top achievements
Rank 2
answered on 15 Sep 2011, 04:04 PM
I know how to turn Strict on.
It's the runtime error with Grid code that's having the problem.

Option Strict On disallows late binding.
0
Daniel
Telerik team
answered on 21 Sep 2011, 09:58 AM
Hello Lenny,

e.Item.DataItem returns object. I'm not sure that I fully understand what your code actually is supposed to do.
If you want to get the value of the Option field through the data item, I would recommend that you use the DataBinder.Eval method.

Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Lenny_shp
Top achievements
Rank 2
Answers by
Dan Lehmann
Top achievements
Rank 1
Lenny_shp
Top achievements
Rank 2
Daniel
Telerik team
Share this question
or