When you say "rename", do you really mean you want to change the Name property? If so, select the grid in the form designer, then go into the property sheet. Open the drop-down list at the top, and select Column1. Then go to the Name property and type the new name.
If in fact you want to change the caption, then the process is similar. In that case, you choose the Header1 rather than Column1, then change the Caption property.
Repeat the process for each column.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
I am sorry, what I meant to say is to change the header caption for the columns.
What I have is a cursor which has the departments in our company. The cursor includes the Department ID, a Week ID, and the available working hours per week.
Department ID Week ID Hours
AAAAAA 20060101 100
BBBBBB 20060101 200
AAAAAA 20060108 300
BBBBBB 20060108 400
AAAAAA 20060115 500
BBBBBB 20060115 600
Within the cursor I am fetching the records so tha it will populate the records as folows.
Department ID Week 1 Week2 Week 3
AAAAAA 100 300 500
BBBBBB 200 400 600
What I want to do is change the header's caption to the Week Id instead of Week 1 Week 2..... As I have it.
I have the captions as week 1, week 2....... already. What I need to do is change that caption to the week ID data field. In other words, instead of week 1, week 2, etc, I want to change it to 20060101, 20060108, and 20060115.
Now what is still confusing you? Just because a cursor has a field name week1, the caption can also be "20060101". The grid only by default sets all column header captions to field names.
I assume you use the Cross-Tab wizard to transform the data from the form with the weekID fiedl to the form displayed with several week1, week2 etc. fields.
And your real problem may be that you don't know what weekID results to some week1, week2 etc. column. As pure numbers are not allowed as field names, a solution may be to compute field names as "_"+transform(weekID) instead of "week"+alltrim(str) or something. then you could simply remove the "_" from the field name to compute the caption. Another solution would be creating some cursor where you store which weekID is transformed to which field name and then replace the caption accordingly, after you set the controlsource of the grid to the displayed cursor.
I'm stuggling to understand what the problem is. We've told you what you need to know about changing captions in a grid. It now looks like you're asking how to convert a string in the formn "Week N" to a sting in the form "YYYYMMDDD".
I suggest you sit down and think carefully about exactly what question you are asking. If -- as I now suspect -- it is concerned with converting date formats, and nothing to do with captions or grids, you should re-post the question as a new thread with a suitable title (in the appropriate forum, which is probably General Coding Issues).
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.