Problems with UnBound DataGridView Location

alwaysinneed

New member
Joined
Dec 7, 2011
Messages
3
Programming Experience
3-5
so i hope this is an easy answer. i am using an unbound datagridview so i can dynamiclly add rows. all that is working fine. but the grid is not is the location i have coded.. i am using the defualt form as a base then coding the unbound stuff in.. should i just create a blank class file and do everything? the only problem i am having is the grid must bees in the correct location according to the pixel point that i have given it.

Right now it is placing the grid at point (0,0) no matter what point is entered on the line for location. so what am i missing??????
 
First up, you can dynamically add rows to a DataGridView whether it is bound or unbound. Whether or not the grid is bound should be dictated by the data and what you want to do with it.

As for the issue, are you adding this grid in the designer or in code? If it's in the designer, are you setting the Location in the designer? If it's in code, you might show us the code. Please provide a FULL and CLEAR description of the problem.
 
actually. well to be very specific i am programmatically adding the rows.. and THAT you cannot do with a bound datagridview. yes you are correct that dynamic rows can be added but with a bound one it is from the user input directly. plus i thought the only way to create an unbound datagridview is WITHOUT the designer. if there is something i am not informed of about that i am always up for more knowledge. i can bring the code up but i tried having the location on there and i even took it off and i got the same result. i just created a panel and have the control inside that.. but now i am am having poroblems with a drag and copy sub that i had.. it worked when the datagrid was bound and now it doesnt.. i am not at work atm but i will copy the code to here asap.. sorry about not being more detailed previously.. and well lol.. now .. but i will have more details for you when i get to work first thing in the morning
 
actually. well to be very specific i am programmatically adding the rows.. and THAT you cannot do with a bound datagridview.
Sure you can. A bound control simply displays the contents of its data source. If you want to add rows to a bound grid then you simply add items to the data source.
i thought the only way to create an unbound datagridview is WITHOUT the designer. if there is something i am not informed of about that i am always up for more knowledge.
Certainly not true. Why not try it now, with a new test project.
 
Back
Top