I have a DBGrid which displays the following example columns:
Assignment,Department,Teacher
Which displays in the grid for example:
1,Science,J Jones
2,Science,A Bones
3,Technology,N Harvey
However I want it to display in the DBGrid as depending on the Department in use as:
Sci-000001,Science,J Jones
Sci-000002,Science,A Bones
Tech-000003,Technology,N Harvey
The backend database looks like this:
I have a table called ASSIGNMENTS which contains the fields
Assignid integer (auto increment with new record)
DeptId integer
Teacher nvarchar(50)
I have a table called DEPT which contains the fields, the DisplayFormat is what is used to format the column depending on the department
DeptID integer
DeptName nvarchar(50)
DisplayFormat nvarchar(20)
These are two example records for Department
DeptName: Technology
DisplayFormat: Tech-%.6d
DeptName: Science
DisplayFormat: Sci-%.6d
I tried using OnGetText, which works fine when the column is set to only one format, thats no problem. What I cannot figure out is how to use multiple formats depending on the Department in use?
Thanks for any help on this
Assignment,Department,Teacher
Which displays in the grid for example:
1,Science,J Jones
2,Science,A Bones
3,Technology,N Harvey
However I want it to display in the DBGrid as depending on the Department in use as:
Sci-000001,Science,J Jones
Sci-000002,Science,A Bones
Tech-000003,Technology,N Harvey
The backend database looks like this:
I have a table called ASSIGNMENTS which contains the fields
Assignid integer (auto increment with new record)
DeptId integer
Teacher nvarchar(50)
I have a table called DEPT which contains the fields, the DisplayFormat is what is used to format the column depending on the department
DeptID integer
DeptName nvarchar(50)
DisplayFormat nvarchar(20)
These are two example records for Department
DeptName: Technology
DisplayFormat: Tech-%.6d
DeptName: Science
DisplayFormat: Sci-%.6d
I tried using OnGetText, which works fine when the column is set to only one format, thats no problem. What I cannot figure out is how to use multiple formats depending on the Department in use?
Thanks for any help on this