Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. DataGrid Row returing DataRowView question

DataGrid Row returing DataRowView question

Scheduled Pinned Locked Moved ASP.NET
questiondocker
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    steven shingler
    wrote on last edited by
    #1

    Hi all. See this: <%# someFunction(Container.DataItem) %> and then this: protected string someFunction(object item) { DataRowView drv = (DataRowView)item; //then do stuff with drv to return a value you want return "value"; } Well isn't there a lot of overhead in passing objects around, then casting? Is there a way to pass in the DataRowView directly? Something similar to: <%# DataBinder.Eval(Container, "DataItem.name")%> ...would be great sort of: <%# DataBinder.Eval(Container, "DataItem.DataRowView")%> any ideas very gratefully received. cheers steven

    S 1 Reply Last reply
    0
    • S steven shingler

      Hi all. See this: <%# someFunction(Container.DataItem) %> and then this: protected string someFunction(object item) { DataRowView drv = (DataRowView)item; //then do stuff with drv to return a value you want return "value"; } Well isn't there a lot of overhead in passing objects around, then casting? Is there a way to pass in the DataRowView directly? Something similar to: <%# DataBinder.Eval(Container, "DataItem.name")%> ...would be great sort of: <%# DataBinder.Eval(Container, "DataItem.DataRowView")%> any ideas very gratefully received. cheers steven

      S Offline
      S Offline
      steven shingler
      wrote on last edited by
      #2

      sorry everyone - forgot about the tags check box :doh: here it is in full: Hi all. See this: <%# someFunction(Container.DataItem) %> and then this: protected string someFunction(object item) { DataRowView drv = (DataRowView)item; //then do stuff with drv to return a value you want return "value"; } Well isn't there a lot of overhead in passing objects around, then casting? Is there a way to pass in the DataRowView directly? Something similar to: <%# DataBinder.Eval(Container, "DataItem.name")%> ...would be great sort of: <%# DataBinder.Eval(Container, "DataItem.DataRowView")%> any ideas very gratefully received. cheers steven

      M 1 Reply Last reply
      0
      • S steven shingler

        sorry everyone - forgot about the tags check box :doh: here it is in full: Hi all. See this: <%# someFunction(Container.DataItem) %> and then this: protected string someFunction(object item) { DataRowView drv = (DataRowView)item; //then do stuff with drv to return a value you want return "value"; } Well isn't there a lot of overhead in passing objects around, then casting? Is there a way to pass in the DataRowView directly? Something similar to: <%# DataBinder.Eval(Container, "DataItem.name")%> ...would be great sort of: <%# DataBinder.Eval(Container, "DataItem.DataRowView")%> any ideas very gratefully received. cheers steven

        M Offline
        M Offline
        Marcie Jones
        wrote on last edited by
        #3

        Hi Steven, You could always cast it first: <%# someFunction((DataRowView)Container.DataItem) %> protected string someFunction(DataRowView drv) { //then do stuff with drv to return a value you want return "value"; } Marcie http://www.codeproject.com

        S 1 Reply Last reply
        0
        • M Marcie Jones

          Hi Steven, You could always cast it first: <%# someFunction((DataRowView)Container.DataItem) %> protected string someFunction(DataRowView drv) { //then do stuff with drv to return a value you want return "value"; } Marcie http://www.codeproject.com

          S Offline
          S Offline
          steven shingler
          wrote on last edited by
          #4

          mmm - nice one! thank you.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups