fetching the value of a datafield into a textbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nitin005
    New Member
    • Nov 2007
    • 4

    fetching the value of a datafield into a textbox

    hi,

    after fetching the data into the datagridview, how to display the value of a particular field of a selected row, in a textbox. it is a windows application in c#
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Can you kindly post what you have tried so far .

    Comment

    • dip_developer
      Recognized Expert Contributor
      • Aug 2006
      • 648

      #3
      Originally posted by nitin005
      hi,

      after fetching the data into the datagridview, how to display the value of a particular field of a selected row, in a textbox. it is a windows application in c#
      say your DataGridView is "dgv", your Column you want data from is
      "ID" and it's an Int32 value,then:

      [CODE=css]Int32 col_id = (Int32) dgv.SelectedRow s[0].Cells["ID"].Value;
      [/CODE]

      Comment

      Working...