Click here to Skip to main content
15,664,823 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have a datagridview and have bounded my datasource.
When the gridview is loaded, the column name follows the table attributes name.

catID desc catName

I want to rename the column to Cat ID, Description, Category Name

How do I do that?

Please help me.

Thanks in Advance.
Updated 9-Jun-11 21:46pm
Dalek Dave 10-Jun-11 3:47am    
Edited for Grammar and Readability.
Ragi Gopi 10-Jun-11 3:53am    
ok sure..

Here is One Solution For That...

Use Alias Name for each Column Name
Inside Query that U R going to execute

Like This..

Select catID as Cat ID, desc as Description, catName as Category Name from UrTable
Share this answer
RakeshMeena 10-Jun-11 3:08am    
My 5! Best solution, but if you don't want to modify your query then see my answer.
Dalek Dave 10-Jun-11 3:47am    
Good Answer.
parmar_punit 11-Jun-11 8:46am    
good ans, my 5
Though I would prefer Prasad's solution but if you don't want to touch your query, you can try below solution:
Handle "ColumnAdded" event and based on the
property you can set
Share this answer
Ragi Gopi 10-Jun-11 3:28am    
thank u., i will try this too...
Dalek Dave 10-Jun-11 3:47am    
Good Call.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900