Anyway to enable use of Option Strict?

4 posts, 0 answers
  1. Lenny_shp
    Lenny_shp avatar
    343 posts
    Member since:
    Jul 2006

    Posted 14 Sep 2011 Link to this post

     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.
  2. Dan Lehmann
    Dan Lehmann avatar
    103 posts
    Member since:
    May 2011

    Posted 14 Sep 2011 Link to this post

    look in web.config for a line like:
            <compilation debug="true" strict="false" explicit="true" targetFramework="4.0">

    Dan
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Lenny_shp
    Lenny_shp avatar
    343 posts
    Member since:
    Jul 2006

    Posted 15 Sep 2011 Link to this post

    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.
  5. Daniel
    Admin
    Daniel avatar
    4945 posts

    Posted 21 Sep 2011 Link to this post

    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
Back to Top