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. General Programming
  3. C#
  4. Format BoundColumn Text

Format BoundColumn Text

Scheduled Pinned Locked Moved C#
question
4 Posts 3 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.
  • M Offline
    M Offline
    Member 4267867
    wrote on last edited by
    #1

    I know of ways to format text in a BoundColumn to decimals, numbers, etc but what I am after is a way of passing the text in a cell to a method I have created. Is there a way of doing this? Many thanks.

    C 1 Reply Last reply
    0
    • M Member 4267867

      I know of ways to format text in a BoundColumn to decimals, numbers, etc but what I am after is a way of passing the text in a cell to a method I have created. Is there a way of doing this? Many thanks.

      C Offline
      C Offline
      C1AllenS
      wrote on last edited by
      #2

      Hello, Could you explain your requirement on how and when you wish to pass the value to your method. Is there any specific action after you wish to pass the data. The normal procedure to pass the data could be in either of the given forms. For example: private void button1_Click(object sender, EventArgs e) { //mymethod(this.dataGridView1.CurrentCell.Value); int row, col; row = 3; col = 2; mymethod(this.dataGridView1[col, row].Value); } public void mymethod(Object obj) { MessageBox.Show(obj.ToString()); } I hope this helps. Regards, Allen

      Allen Smith ComponentOne LLC www.componentone.com

      M 1 Reply Last reply
      0
      • C C1AllenS

        Hello, Could you explain your requirement on how and when you wish to pass the value to your method. Is there any specific action after you wish to pass the data. The normal procedure to pass the data could be in either of the given forms. For example: private void button1_Click(object sender, EventArgs e) { //mymethod(this.dataGridView1.CurrentCell.Value); int row, col; row = 3; col = 2; mymethod(this.dataGridView1[col, row].Value); } public void mymethod(Object obj) { MessageBox.Show(obj.ToString()); } I hope this helps. Regards, Allen

        Allen Smith ComponentOne LLC www.componentone.com

        M Offline
        M Offline
        Member 4267867
        wrote on last edited by
        #3

        What I wish for is a method to be called each time a row is created that will take the text in a specific column and convert it. Table: Row Name Id 1 Ric 123 2 Lou 456 3 Matt 789 As a row is created a method takes the Id, runs it through a custom method I have (for converting ID's into Usernames) and then displays the username instead. I am using a SPGridView (SharePoint Grid View).

        L 1 Reply Last reply
        0
        • M Member 4267867

          What I wish for is a method to be called each time a row is created that will take the text in a specific column and convert it. Table: Row Name Id 1 Ric 123 2 Lou 456 3 Matt 789 As a row is created a method takes the Id, runs it through a custom method I have (for converting ID's into Usernames) and then displays the username instead. I am using a SPGridView (SharePoint Grid View).

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          I think there is an event called OnItemDatabound that gets called for every row as they are populated.

          xacc.ide - now with TabsToSpaces support
          IronScheme - 1.0 alpha 4a out now (29 May 2008)

          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