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. Binding 'null' data to textbox in the datagrid

Binding 'null' data to textbox in the datagrid

Scheduled Pinned Locked Moved ASP.NET
wpfwcfhelp
3 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
    Sarvesvara BVKS Dasa
    wrote on last edited by
    #1

    Hi, I use the textbox in the datagrid in the 'TemplateColumn'. I bind the information to the textbox in the page_load by the following command curRejReason = (TextBox)dgTransaction.Items[i].FindControl("txtRejReason"); curRejReason.Text = dgTransaction.Items[i].Cells[14].Text.Trim().ToString(); It works fine, except for the 'empty / null' dataset information for the textbox field. The null information shows in the textbox as & nbsp; .Trim(), .ToString() and its combination doesnt work.... Any help appretiated There is nothing new under the sun,
    But there are lots of old things we don't know.

    - Ambrose Bierce

    J 1 Reply Last reply
    0
    • S Sarvesvara BVKS Dasa

      Hi, I use the textbox in the datagrid in the 'TemplateColumn'. I bind the information to the textbox in the page_load by the following command curRejReason = (TextBox)dgTransaction.Items[i].FindControl("txtRejReason"); curRejReason.Text = dgTransaction.Items[i].Cells[14].Text.Trim().ToString(); It works fine, except for the 'empty / null' dataset information for the textbox field. The null information shows in the textbox as & nbsp; .Trim(), .ToString() and its combination doesnt work.... Any help appretiated There is nothing new under the sun,
      But there are lots of old things we don't know.

      - Ambrose Bierce

      J Offline
      J Offline
      Juno EasyDotNet com
      wrote on last edited by
      #2

      Because the text of that cell is  . You can reference data source: DataRowView drview = (DataRowView)e.Item.DataItem curRejReason.Text = drview(yourfield) Juno MCSD.NET, MCDBA, MCSE ---------------------------------------------------------- Support Team of EasyDotNet, INC. http://www.EasyDotNet.com DataForm.NET - The most powerful data entry web server control for ASP.NET

      S 1 Reply Last reply
      0
      • J Juno EasyDotNet com

        Because the text of that cell is  . You can reference data source: DataRowView drview = (DataRowView)e.Item.DataItem curRejReason.Text = drview(yourfield) Juno MCSD.NET, MCDBA, MCSE ---------------------------------------------------------- Support Team of EasyDotNet, INC. http://www.EasyDotNet.com DataForm.NET - The most powerful data entry web server control for ASP.NET

        S Offline
        S Offline
        Sarvesvara BVKS Dasa
        wrote on last edited by
        #3

        Thanks, will give it a try!! :rose: There is nothing new under the sun,
        But there are lots of old things we don't know.

        - Ambrose Bierce

        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