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 String Binding problem

DataGrid String Binding problem

Scheduled Pinned Locked Moved ASP.NET
wpfwcfhelptutorial
5 Posts 4 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.
  • P Offline
    P Offline
    param thaker
    wrote on last edited by
    #1

    Hi Friends I want to bind the String with the DataGrid , in such a way that i have one string say "125:test" . I want this string to be bound with the datagrid , so that , each and every character , means 1 2 5 : t e s t , will store individually ,in the individual cell of the datagrid. Please , guide me. Thanking you, Param

    param

    C E 3 Replies Last reply
    0
    • P param thaker

      Hi Friends I want to bind the String with the DataGrid , in such a way that i have one string say "125:test" . I want this string to be bound with the datagrid , so that , each and every character , means 1 2 5 : t e s t , will store individually ,in the individual cell of the datagrid. Please , guide me. Thanking you, Param

      param

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

      Hi, You can create rows and cells using a loop where in you parse a given string and put 1 character in the cells text property. But please note that there will be problems if your strings are not of same length. If that is the case, you will have to enter the blank values in cells where there are less number of characters. Hope I am clear enough and the solution can be implemented :)


      "A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder


      coolestCoder

      1 Reply Last reply
      0
      • P param thaker

        Hi Friends I want to bind the String with the DataGrid , in such a way that i have one string say "125:test" . I want this string to be bound with the datagrid , so that , each and every character , means 1 2 5 : t e s t , will store individually ,in the individual cell of the datagrid. Please , guide me. Thanking you, Param

        param

        E Offline
        E Offline
        ednrgc
        wrote on last edited by
        #3

        store the characters in a table (1 char per column), then databind it.

        1 Reply Last reply
        0
        • P param thaker

          Hi Friends I want to bind the String with the DataGrid , in such a way that i have one string say "125:test" . I want this string to be bound with the datagrid , so that , each and every character , means 1 2 5 : t e s t , will store individually ,in the individual cell of the datagrid. Please , guide me. Thanking you, Param

          param

          C Offline
          C Offline
          coolestCoder
          wrote on last edited by
          #4

          Hi, I dont remeber but you can directly attach a string as a data source to a data grid as -- value = "123:test" dataGrid1.datasource=value here value is declared to be a string variable. I read it somewhere on the other forums here on CP (not able to remember the exact link) But i dont think that this will work in case if multiple rows are needed. Dont know ! i havent checked it myself !


          "A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder


          coolestCoder

          R 1 Reply Last reply
          0
          • C coolestCoder

            Hi, I dont remeber but you can directly attach a string as a data source to a data grid as -- value = "123:test" dataGrid1.datasource=value here value is declared to be a string variable. I read it somewhere on the other forums here on CP (not able to remember the exact link) But i dont think that this will work in case if multiple rows are needed. Dont know ! i havent checked it myself !


            "A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder


            coolestCoder

            R Offline
            R Offline
            ravikiranreddydharmannagari
            wrote on last edited by
            #5

            hai its working out,i checked string value1="123 test"; DataGrid1.DataSource=value1; DataGrid1.DataBind(); with regards

            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