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. WPF
  4. Unable to click or select TextBox in WPF? [SOLVED]

Unable to click or select TextBox in WPF? [SOLVED]

Scheduled Pinned Locked Moved WPF
csharpcsswpfjsonquestion
9 Posts 3 Posters 1 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.
  • A Offline
    A Offline
    Alisaunder
    wrote on last edited by
    #1

    This is driving me nuts guys. I'm displaying a grid with column and row layout information. Basically it's my data entry screen. Since I'm using a one window app I hide the grid or collapse it and make it visible when the user selects the data entry option. I have set focus to the first field or Text box in the grid, but if you try to click another Text box nothing happens it's almost like the entire grid is disabled and I can't click anything in it. So long as I have the first Text box selected I can tab through all the rest but I cannot click select a Text box. Anyone please give me some ideas I've been fighting this for weeks now. I have made sure the Grid, and Text boxes are focus-able. Here is my code showing the three Grids I make visible or collapse:

    S A 2 Replies Last reply
    0
    • A Alisaunder

      This is driving me nuts guys. I'm displaying a grid with column and row layout information. Basically it's my data entry screen. Since I'm using a one window app I hide the grid or collapse it and make it visible when the user selects the data entry option. I have set focus to the first field or Text box in the grid, but if you try to click another Text box nothing happens it's almost like the entire grid is disabled and I can't click anything in it. So long as I have the first Text box selected I can tab through all the rest but I cannot click select a Text box. Anyone please give me some ideas I've been fighting this for weeks now. I have made sure the Grid, and Text boxes are focus-able. Here is my code showing the three Grids I make visible or collapse:

      S Offline
      S Offline
      SledgeHammer01
      wrote on last edited by
      #2

      Doesn't compile for one thing. Nobody is going to hand look through 2000 lines of Xaml or try to get it to compile. Too many unresolved styles and references and namespaces. If you want someone to help you with something like this, I'd suggest posting a SMALL & COMPILEABLE project :).

      A 1 Reply Last reply
      0
      • S SledgeHammer01

        Doesn't compile for one thing. Nobody is going to hand look through 2000 lines of Xaml or try to get it to compile. Too many unresolved styles and references and namespaces. If you want someone to help you with something like this, I'd suggest posting a SMALL & COMPILEABLE project :).

        A Offline
        A Offline
        Alisaunder
        wrote on last edited by
        #3

        I didn't expect it to compile, I simply wanted you to see how I was setting up my XAML. I have one master Grid. One main grid showing general content. One Grid displays Contact information from my database, and the other Package information from my database. I collapse the main grid to make the other grids visible when I need them. I'm suspecting this is part of the reason I cannot click on the visible grid. If you have a suggestion on another technique to do the same thing I'm all ears.

        P S 2 Replies Last reply
        0
        • A Alisaunder

          I didn't expect it to compile, I simply wanted you to see how I was setting up my XAML. I have one master Grid. One main grid showing general content. One Grid displays Contact information from my database, and the other Package information from my database. I collapse the main grid to make the other grids visible when I need them. I'm suspecting this is part of the reason I cannot click on the visible grid. If you have a suggestion on another technique to do the same thing I'm all ears.

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          I'm not sure why you've taken this approach. Rather than do this, why don't you use the editable collection functionality that's built in? The good Dr WPF has a detailed explanation here[^], and I wrote code you can reuse here[^].

          Forgive your enemies - it messes with their heads

          "Mind bleach! Send me mind bleach!" - Nagy Vilmos

          My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

          A 1 Reply Last reply
          0
          • A Alisaunder

            I didn't expect it to compile, I simply wanted you to see how I was setting up my XAML. I have one master Grid. One main grid showing general content. One Grid displays Contact information from my database, and the other Package information from my database. I collapse the main grid to make the other grids visible when I need them. I'm suspecting this is part of the reason I cannot click on the visible grid. If you have a suggestion on another technique to do the same thing I'm all ears.

            S Offline
            S Offline
            SledgeHammer01
            wrote on last edited by
            #5

            So its something like the MS Word options dialog? Where you have some form of navigation on the left and the content on the right? I'd probably do a similiar thing... have each page on a grid that can be collapsed when its not visible. Like I said though, you have too much xaml there for anybody to make heads & tails of it. What you might want to do is repro it in a small app, just have the grids and maybe a button in each sub grid and make sure you can click on the buttons when the grid is visibile. Thats really all I can think of without a compilable app to debug :).

            A 1 Reply Last reply
            0
            • S SledgeHammer01

              So its something like the MS Word options dialog? Where you have some form of navigation on the left and the content on the right? I'd probably do a similiar thing... have each page on a grid that can be collapsed when its not visible. Like I said though, you have too much xaml there for anybody to make heads & tails of it. What you might want to do is repro it in a small app, just have the grids and maybe a button in each sub grid and make sure you can click on the buttons when the grid is visibile. Thats really all I can think of without a compilable app to debug :).

              A Offline
              A Offline
              Alisaunder
              wrote on last edited by
              #6

              I'll try that, and yes you are absolutely correct. I'm actually using an Actipro WPF Ribbon bar with buttons that select the functions.

              S 1 Reply Last reply
              0
              • P Pete OHanlon

                I'm not sure why you've taken this approach. Rather than do this, why don't you use the editable collection functionality that's built in? The good Dr WPF has a detailed explanation here[^], and I wrote code you can reuse here[^].

                Forgive your enemies - it messes with their heads

                "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                A Offline
                A Offline
                Alisaunder
                wrote on last edited by
                #7

                I thought about doing it your way but I'm already populating a Data Table and felt it might be even more confusing adding a collection when i can populate with data from the table directly.

                1 Reply Last reply
                0
                • A Alisaunder

                  I'll try that, and yes you are absolutely correct. I'm actually using an Actipro WPF Ribbon bar with buttons that select the functions.

                  S Offline
                  S Offline
                  SledgeHammer01
                  wrote on last edited by
                  #8

                  I use ActiPro Ribbon too... haven't had any problems with it. They are probably the most feature complete ribbon out there IMHO and they are really quick on support.

                  1 Reply Last reply
                  0
                  • A Alisaunder

                    This is driving me nuts guys. I'm displaying a grid with column and row layout information. Basically it's my data entry screen. Since I'm using a one window app I hide the grid or collapse it and make it visible when the user selects the data entry option. I have set focus to the first field or Text box in the grid, but if you try to click another Text box nothing happens it's almost like the entire grid is disabled and I can't click anything in it. So long as I have the first Text box selected I can tab through all the rest but I cannot click select a Text box. Anyone please give me some ideas I've been fighting this for weeks now. I have made sure the Grid, and Text boxes are focus-able. Here is my code showing the three Grids I make visible or collapse:

                    A Offline
                    A Offline
                    Alisaunder
                    wrote on last edited by
                    #9

                    Solved this, was the order in which I was collapsing and Viewing the grids that was blocking my mouse from selecting the textblocks.

                    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