Titles of DataGrid not showing

T

tshad

I have a Datagrid that has no rows in it, but I want the title to show, and
they aren't.

Is there a way to make them visible even if the Datagrid is empty?

Thanks,

Tom
 
T

tshad

tshad said:
I have a Datagrid that has no rows in it, but I want the title to show, and
they aren't.

Is there a way to make them visible even if the Datagrid is empty?

Actually, it normally is visible when Datagrid is empty. Not able to find
the anomaly at the moment.

However, I did find something that is just the type of thing that drives me
crazy.

If you don't put HeaderStyle-width in all your columns and the grid is
empty, it doesn't line up any more. This is because the DataGrid will not
put the Width in the header area (even if the table is empty). How stupid
is that? The table still needs to be the same size and the relations still
need to be the same.

The header lines up fine if there are any rows in the Datagrid. This took
me hours to find. I am sure it is documented in some obscure place, but it
shouldn't be.

Another one that I don't understand is that when you set the Border, it does
it twice or it will set one to 0 and one to 1.

Great fun !!!!

Tom
 
T

tshad

I figured out what was happening with the titles not showing in the
DataGrid. Another irritant.

If you have never bound to the DataGrid, you will get no titles. Once you
have - even if there are no rows - you will get the titles.

If you clear the grid of rows:

JobPromoGridBundles.DataSource=nothing
JobPromoGridBundles.Databind()

Again you will get no titles (headers).

Is there a way to fix this problem?

I actually have a row of TextBoxes below the DataGrid to get the Data to
input in my table and then I read the table to get the whole set.

The problem is that I have everything lined up to the columns of the
DataGrid. When I start up my program, the textboxes are there with not
titles. The only way around this is to do a fake Databind() just to get the
Headers in the DataGrid to appear.

Not sure how to clear the Datagrid, without losing the headers, however.

Anyone know how to solve this?

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top