How do i create a simple grid control?
-
Hi all, this is the last part of my project before I start the write up, and I`m finding it a bit frustrating. All I want is control that acts like a grid. That is, I want a big square on my square which is divided up into columns and rows and holds UINT's. This control must be dynamic, i.e. when I click on the adjust IncCol/IncRow CSpin thingy (a problem Ravi helped me out on, see below), the number of columns/rows will increase *within* the square as necessary (the current fields will have to change size accordingly to accomodate the new row/column). Delphi has something called a TStringList, which is pretty much what I need, except it uses strings instead of UINT's. I have tried using many edit boxes, and then creating them/deleteing them as necessary, but the code is woefully complicated. I just want a nice simple solution (I don`t need it to change colour etc. etc.) to represent a resizable grid of integers, which can be read from and directly edited to much the same fields of a database. If anyone could help, or give me some ideas, I would well appreciate it, could I get this crappy project done and go out there and get a job.:-D Thanks All, Alan. P.S. I have had a look at Chris's grid control, and it is too heavy duty for what I need. From my understanding it seems to draw the grid manually, which would mean me spending a lot of time on this, which is exactly what I don`t want to do. "When I left you I was but the learner, now I am the Master" - Darth Vader:mad:
-
Hi all, this is the last part of my project before I start the write up, and I`m finding it a bit frustrating. All I want is control that acts like a grid. That is, I want a big square on my square which is divided up into columns and rows and holds UINT's. This control must be dynamic, i.e. when I click on the adjust IncCol/IncRow CSpin thingy (a problem Ravi helped me out on, see below), the number of columns/rows will increase *within* the square as necessary (the current fields will have to change size accordingly to accomodate the new row/column). Delphi has something called a TStringList, which is pretty much what I need, except it uses strings instead of UINT's. I have tried using many edit boxes, and then creating them/deleteing them as necessary, but the code is woefully complicated. I just want a nice simple solution (I don`t need it to change colour etc. etc.) to represent a resizable grid of integers, which can be read from and directly edited to much the same fields of a database. If anyone could help, or give me some ideas, I would well appreciate it, could I get this crappy project done and go out there and get a job.:-D Thanks All, Alan. P.S. I have had a look at Chris's grid control, and it is too heavy duty for what I need. From my understanding it seems to draw the grid manually, which would mean me spending a lot of time on this, which is exactly what I don`t want to do. "When I left you I was but the learner, now I am the Master" - Darth Vader:mad:
if u want a editable grid control, the proceed reading. if i have misunderstood ur problem, i am sorry. create an activex control, in which u place a normal grid control and have just only one edit box that is invicible. Then whenever a cell in grid contol gets focus then place the edit box in that place and make it visible so that user can type. then after is looses focus the hide the edit box. i think this not that tough, or get third party grid controls - simple Ganesh Ramaswamy
-
Hi all, this is the last part of my project before I start the write up, and I`m finding it a bit frustrating. All I want is control that acts like a grid. That is, I want a big square on my square which is divided up into columns and rows and holds UINT's. This control must be dynamic, i.e. when I click on the adjust IncCol/IncRow CSpin thingy (a problem Ravi helped me out on, see below), the number of columns/rows will increase *within* the square as necessary (the current fields will have to change size accordingly to accomodate the new row/column). Delphi has something called a TStringList, which is pretty much what I need, except it uses strings instead of UINT's. I have tried using many edit boxes, and then creating them/deleteing them as necessary, but the code is woefully complicated. I just want a nice simple solution (I don`t need it to change colour etc. etc.) to represent a resizable grid of integers, which can be read from and directly edited to much the same fields of a database. If anyone could help, or give me some ideas, I would well appreciate it, could I get this crappy project done and go out there and get a job.:-D Thanks All, Alan. P.S. I have had a look at Chris's grid control, and it is too heavy duty for what I need. From my understanding it seems to draw the grid manually, which would mean me spending a lot of time on this, which is exactly what I don`t want to do. "When I left you I was but the learner, now I am the Master" - Darth Vader:mad:
****Chambers wrote: P.S. I have had a look at Chris's grid control, and it is too heavy duty for what I need. From my understanding it seems to draw the grid manually, which would mean me spending a lot of time on this, which is exactly what I don`t want to do. You should really put some time into learning it. If you spent a solid couple of hours with it, you would learn it well enough to use it (and by extension, well enough to finish your project). It will do everything you're asking for; it's just a matter of learning what methods to call. But, then again, if a simpler solution presents itself, then by all means... :) Good luck, Jon Sagara "Ninety percent of baseball is mental, the other half is physical." -- Yogi Bera
-
****Chambers wrote: P.S. I have had a look at Chris's grid control, and it is too heavy duty for what I need. From my understanding it seems to draw the grid manually, which would mean me spending a lot of time on this, which is exactly what I don`t want to do. You should really put some time into learning it. If you spent a solid couple of hours with it, you would learn it well enough to use it (and by extension, well enough to finish your project). It will do everything you're asking for; it's just a matter of learning what methods to call. But, then again, if a simpler solution presents itself, then by all means... :) Good luck, Jon Sagara "Ninety percent of baseball is mental, the other half is physical." -- Yogi Bera
Hi again, you`ll be glad to know that I finally finished the damn programming, yay :-D . I used the CDualGridCtrl that was on this web-site (I forget the author, but whoever he/she is thanks - there will be a mention in the final project). I would have liked to use Chris's grid control, but as you said, it can accomodate all my needs with a few hours invested. I didn`t have a few hours to invest as I have to have some sort of draft ready by Monday, and I didn`t want to p*ss about on a part of the project which is insignificant, yet necessary. But thanks to all who helped, Speak soon, Alan. "When I left you I was but the learner, now I am the Master" - Darth Vader:mad: