|
-
Feb 2nd, 2000, 11:54 PM
#1
Thread Starter
Hyperactive Member
I'm using this but not binding it to anything. The reason I'm using it is because I'm using list boxes etc inside the cells. My problem is how do I add a row into the grid? Can I use this control like I do with a normal grid? I need to add rows everytime they modify a row. Basically, have 1 empty row in the begining. When they click and edit this row, a new blank one appears so that there is always a blank one there. Can I do this with this control?
If not, what grid control should I use that will allow me to insert other controls into the cells?
------------------
-------------------------
I'm really easy to get along with once you people learn to
worship me.
-------------------------
-
Feb 3rd, 2000, 03:05 AM
#2
Thread Starter
Hyperactive Member
I don't have that option. Is there any way I can do that using the Databound grid or the normal data grid? Other wise I'll have to try to do the same thing with a flex grid with code. And I don't really want to do that.
------------------
----------------------
I'm really easy to get along with once you people learn to
worship me.
----------------------
-
Feb 3rd, 2000, 04:43 AM
#3
Thread Starter
Hyperactive Member
Ok, I have the apex control. But I'm still not sure how to do what I need. I know with a normal grid I'd do this:
flexgrid1.rows = flexgrid1.rows +1
to add the new row. Well one how do I do that with the data grid? I can do what I want for the first row but if I click on a second one (unchecked Hide Empty rows) it says Data Access error. I don't want to bind it to any kind of data control.
Basically, I have 3 columns. I;m using it to build a query. The first column is a list box of Field names. Depending on the field selected, it will fill the second column iwth the correct operand types and the third column will either be a check box, a list box or a plain text box.
What I need to do everytime they click a line, either add an empty one below it incase they want to make another query OR have a series of empty ones that they can click and select.
But, the Apec control gives me that error so I can't do it. I'm missing a property or code or something. Can anyone help?
-
Feb 3rd, 2000, 11:54 AM
#4
New Member
I don't know if this is what you want but,
to add a line to an unbound DBGrid you can use the code below.
Private Sub DBGrid1_AfterColUpdate(ByVal ColIndex As Integer)
DBGrid1.Row = DBGrid1.Row + 1
To automatically add the row once you reach
a specified column use the code below. The code below well add the row once you tab
off column 3.
Private Sub DBGrid1_AfterColUpdate(ByVal ColIndex As Integer)
DBGrid1.Row= DBGrid1.Row + 1
DBGrid1.Col = DBGrid1.Col - 3
DBGrid1.SetFocus
===========================================
Originally posted by netSurfer:
I'm using this but not binding it to anything. The reason I'm using it is because I'm using list boxes etc inside the cells. My problem is how do I add a row into the grid? Can I use this control like I do with a normal grid? I need to add rows everytime they modify a row. Basically, have 1 empty row in the begining. When they click and edit this row, a new blank one appears so that there is always a blank one there. Can I do this with this control?
If not, what grid control should I use that will allow me to insert other controls into the cells?
-
Feb 3rd, 2000, 12:11 PM
#5
Frenzied Member
Buy Apex TrueDBGrid - www.apexsc.com - not only do you get a far far far superior grid control (better than DBGrid or FlexGrid) for connecting to databases but you can also use it in a special 'storage' mode via an XArray object (provided with the grid) which you can basically treat like a database.
This will enable you to add, edit, delete rows and columns etc without actually having to have a database to store the data.
------------------
Mark "Buzby" Beeton
VB Developer
[email protected]
-
Feb 3rd, 2000, 06:29 PM
#6
-
Feb 3rd, 2000, 09:43 PM
#7
Thread Starter
Hyperactive Member
Thanks Buzby, only have 1 question. when I place:
Dim MyData as New Xarray
in the Declarations section of the form, it says User Defined Type not defined and highlights it. I've never used my own types so I'm not sure what I'm supposed to do.
Etta: Thanks for the answer, but that doesn't work for this type of grid. Which sucks because that's what I'm used to doing too. Thanks though.
-
Feb 3rd, 2000, 10:23 PM
#8
-
Feb 3rd, 2000, 10:32 PM
#9
Thread Starter
Hyperactive Member
Buzby, that lets me run it but after I fill in one row and click on antoher one, it blanks the data. I'm not sure what it is I'm not doing. I haven't used the appex control (or any datagrid control) before so I'm not sure exactly what I'm supposed to do. Do I have to code to add a new row? I assume I'd have to Redim MyData again, what params do I use to keep the data already in it? Thanks for your help.
-
Feb 3rd, 2000, 10:40 PM
#10
-
Feb 3rd, 2000, 10:57 PM
#11
Thread Starter
Hyperactive Member
I'm still having problems. I'm sending the form to you right now. Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|