Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Anyway to make a DataGrid display only 1 record? 1

Status
Not open for further replies.

bigfoot

Programmer
May 4, 1999
1,779
US
I drag in a datagrid in my VS environment, and it always takes up 5 rows. It's only a header showing 1 customer record reminding the user what customer he is editing the call information for.

When it runs, it shows 1 record and 5 lines of white space on the page. My controls won't move up under it.
 
Are you using flowlayout or Gridlayout?

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
There's a checkbox in the properties window of a datagrid that specifies something to the effect of whether it should auto display or not. (really sorry...not in front of my home development machine right now)

Anyway, I know if you leave it checked, these ghost rows/columns will appear. However, if you uncheck it, they disapear. It could be thats all thats the issue (its checked by default)

hth

D'Arcy
 
If your in Gridlayout then all of your controls will be stuck where you position them. This is because they are positioned on the page using abosolute positioning. If your grid expands beyond a certain size your controls will overlap each other.
For the most part I have found GridLayout to be much more trouble than it is worth. I prefer to work in FlowLayout mode and use a table to postion my controls.

In Flowlayout the controls flow around each other. If one gets to big it pushes the others down or over to make room.

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
If you can find it, please let me know. I juse looked thru all of the properties in VS2003, and Can't find it. But that's what I need.

Thanks
 
right click the datagrid and select properties (if that doesn't open a dialog box then you may have to select the Columns property of the datagrid).

The first thing you should see is a listing of available columns that you can add, and a listing of existing columns. Above that there should be a checkbox. Uncheck it.

That should do it.

D'Arcy
 
That box is Create columns at run time, and it's unchecked.
 
ok, scratch that then.

Try setting the height of the datagrid to an extremely small setting. It could be that its outputting one row, but because the height of the datagrid is set to 300 or something, it takes up that much room.

D
 
Just tried it. Nope. I set the page size to 1. That did nothing also.

There has to be a way. ;-)
 
Right click on the datagrid and choose property builder. On the paging tab choose allow paging and select 1 for the page size.
 
YES! YES! YES! YES! YES! YES! YES! YES! YES!

Thank you for the help. That did it just fine.

Then uncheck Show Navigation Buttons to turn off all the paging footer information.

That did it just fine! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top