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. Splitting rows in dataGrid

Splitting rows in dataGrid

Scheduled Pinned Locked Moved ASP.NET
question
6 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.
  • N Offline
    N Offline
    nour123
    wrote on last edited by
    #1

    Dear all... I have a dataGrid control, can I split a specific row into many rows ? Regards...

    Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

    A 1 Reply Last reply
    0
    • N nour123

      Dear all... I have a dataGrid control, can I split a specific row into many rows ? Regards...

      Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      Yes why not. Just place controls into datagrid and eval the split value using ItemDataBound event. Use DataBinder.Eval("YourColumn").Split(" ") Is this what you want? I think using Repeater will be better in this case. ;)

      Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


      My Latest Articles-->** Simplify Code Using NDepend
      Basics of Bing Search API using .NET
      Microsoft Bing MAP using Javascript

      N 1 Reply Last reply
      0
      • A Abhishek Sur

        Yes why not. Just place controls into datagrid and eval the split value using ItemDataBound event. Use DataBinder.Eval("YourColumn").Split(" ") Is this what you want? I think using Repeater will be better in this case. ;)

        Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


        My Latest Articles-->** Simplify Code Using NDepend
        Basics of Bing Search API using .NET
        Microsoft Bing MAP using Javascript

        N Offline
        N Offline
        nour123
        wrote on last edited by
        #3

        thanks dear 4 your reply, I put this line of code but it does not work well regards

        Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

        A 1 Reply Last reply
        0
        • N nour123

          thanks dear 4 your reply, I put this line of code but it does not work well regards

          Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

          A Offline
          A Offline
          Abhishek Sur
          wrote on last edited by
          #4

          Where did you put? I think you need to put it under DataBound Event handler. Might be by this way :

          private void GridView_RowDataBound(Object sender, GridViewRowEventArgs e)

          if(e.Row.RowType == DataControlRowType.DataRow)
          {
            
            e.Row.Cells(1).Text = "_" + DataBinder.Eval(e.Row.DataItem, "colname").ToString().Split(" ") + "_";
          
          }
          

          }

          The split logic should be placed according to what you require. Also adjust the code according to what you need. ;)

          Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


          My Latest Articles-->** Simplify Code Using NDepend
          Basics of Bing Search API using .NET
          Microsoft Bing MAP using Javascript

          N 1 Reply Last reply
          0
          • A Abhishek Sur

            Where did you put? I think you need to put it under DataBound Event handler. Might be by this way :

            private void GridView_RowDataBound(Object sender, GridViewRowEventArgs e)

            if(e.Row.RowType == DataControlRowType.DataRow)
            {
              
              e.Row.Cells(1).Text = "_" + DataBinder.Eval(e.Row.DataItem, "colname").ToString().Split(" ") + "_";
            
            }
            

            }

            The split logic should be placed according to what you require. Also adjust the code according to what you need. ;)

            Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


            My Latest Articles-->** Simplify Code Using NDepend
            Basics of Bing Search API using .NET
            Microsoft Bing MAP using Javascript

            N Offline
            N Offline
            nour123
            wrote on last edited by
            #5

            thanks alot it works

            Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

            S 1 Reply Last reply
            0
            • N nour123

              thanks alot it works

              Nour Abdel-Salam... A Trainer and a Web Developer in Jedda Int'l Computer Center(JICC)

              S Offline
              S Offline
              sashidhar
              wrote on last edited by
              #6

              nour123 wrote:

              thanks alot

              Glad to hear tht..! But You Shuld mark it as answer..!

              LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.

              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