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. Cursor re-positioning

Cursor re-positioning

Scheduled Pinned Locked Moved ASP.NET
questionhelp
11 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 MacIntyre

    AS in my last question the tabing is working great for the first row. the last object in the row is an event button, that causes the fields to be added to a total field on the row. The problem is when it comes back from the Command Event it is starting the cursor at the top of the page and not at the next row in the datalist. Is there a way to solve the cursor positioning problem? If so, could you supply a suggestion.. Thanks...

    H Offline
    H Offline
    Hemant_ec48
    wrote on last edited by
    #2

    for this u have to set focus property of the control in second row....

    M 1 Reply Last reply
    0
    • H Hemant_ec48

      for this u have to set focus property of the control in second row....

      M Offline
      M Offline
      MacIntyre
      wrote on last edited by
      #3

      How do I do that?

      C 1 Reply Last reply
      0
      • M MacIntyre

        How do I do that?

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #4

        Write javascript that gets a reference to the row you want, and calls focus on it. This involves making sure your rows have id attributes that you can use to select them with document.getElementById

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        M 1 Reply Last reply
        0
        • C Christian Graus

          Write javascript that gets a reference to the row you want, and calls focus on it. This involves making sure your rows have id attributes that you can use to select them with document.getElementById

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          M Offline
          M Offline
          MacIntyre
          wrote on last edited by
          #5

          This sounds like a really cool way to accomplish this except I don't have a clue about how to create unique id attributes or each row. I acutally have a sample of seting the cursor on an object in Javascript is that is not a problem. the problem now is "How to create these ID's for each row?" Code sample please... thanks...

          C 1 Reply Last reply
          0
          • M MacIntyre

            This sounds like a really cool way to accomplish this except I don't have a clue about how to create unique id attributes or each row. I acutally have a sample of seting the cursor on an object in Javascript is that is not a problem. the problem now is "How to create these ID's for each row?" Code sample please... thanks...

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #6

            I am actually not sure, if you're using a datagrid or gridview. I've done it in the past using a repeater, which gave me complete freedom over the HTML that was generated. You may be able to get the actual row tag in an itemdatabound event and modify it from there, that seems the most likely way to do it.

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            M 2 Replies Last reply
            0
            • C Christian Graus

              I am actually not sure, if you're using a datagrid or gridview. I've done it in the past using a repeater, which gave me complete freedom over the HTML that was generated. You may be able to get the actual row tag in an itemdatabound event and modify it from there, that seems the most likely way to do it.

              Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

              M Offline
              M Offline
              MacIntyre
              wrote on last edited by
              #7

              I am using vb.net with this datalist, as the code behind. I have found in the past that datalist, dataGrid and repeater are simular, if you could show me what you do with repeater maybe I can figure out what to do for the datalist... I do all sorts of modifications of attributes in the itemdatabound event, lsts add another. Thanks...

              C 1 Reply Last reply
              0
              • M MacIntyre

                I am using vb.net with this datalist, as the code behind. I have found in the past that datalist, dataGrid and repeater are simular, if you could show me what you do with repeater maybe I can figure out what to do for the datalist... I do all sorts of modifications of attributes in the itemdatabound event, lsts add another. Thanks...

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #8

                The point is that with a repeater, you write out the HTML that is emitted verbatim, so you can build a table and set the td/tr tags to contain ids if you want. I don't think the datalist will let you, I think the itemdatabound event is your best bet

                Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                1 Reply Last reply
                0
                • C Christian Graus

                  I am actually not sure, if you're using a datagrid or gridview. I've done it in the past using a repeater, which gave me complete freedom over the HTML that was generated. You may be able to get the actual row tag in an itemdatabound event and modify it from there, that seems the most likely way to do it.

                  Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                  M Offline
                  M Offline
                  MacIntyre
                  wrote on last edited by
                  #9

                  The problem is I don't know what you mean by a row tag, is that like the index of the row. Because the ItemCommand event gives me the e.item.index of the row that I am on, me.datalist1.Items(e.item.index) at this point there is something called UniqueID is that what I want. How do I pass it to the javascript. There is also a .Focus() method here how does that work? Thanks for all your assistance... Chuck...

                  C 1 Reply Last reply
                  0
                  • M MacIntyre

                    The problem is I don't know what you mean by a row tag, is that like the index of the row. Because the ItemCommand event gives me the e.item.index of the row that I am on, me.datalist1.Items(e.item.index) at this point there is something called UniqueID is that what I want. How do I pass it to the javascript. There is also a .Focus() method here how does that work? Thanks for all your assistance... Chuck...

                    C Offline
                    C Offline
                    Christian Graus
                    wrote on last edited by
                    #10

                    If you look at the source code of your actual page, those controls are all building an HTML table. You want to focus on a row, so you need to be able to select that row. The tr or td tag in question. If it has an id, the ClientID is the property you want. Then you can emit some js that passes the ClientID ( which you generate on the server ), to a method which takes that id, and selects the object and focuses on it

                    Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                    M 1 Reply Last reply
                    0
                    • C Christian Graus

                      If you look at the source code of your actual page, those controls are all building an HTML table. You want to focus on a row, so you need to be able to select that row. The tr or td tag in question. If it has an id, the ClientID is the property you want. Then you can emit some js that passes the ClientID ( which you generate on the server ), to a method which takes that id, and selects the object and focuses on it

                      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                      M Offline
                      M Offline
                      MacIntyre
                      wrote on last edited by
                      #11

                      I think you have helped me a great deal more than you may know. I found an example of some microsoft stuff that might work. I'll get back to you later and let you know the results.. Thanks for all your help.. Chuck

                      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