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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Howto hange DataGrid/DataView Column Headers?

Status
Not open for further replies.

dabits

Programmer
Apr 28, 2000
18
US
Okay.. I have a simple question. How can I change the text of column headers in a datagrid and dataview from the field name of the data table? I'm trying to do this on a Windows Form. I've tried using .Caption ( i.e. myDataView.Table.Columns(0).Caption="Quantity")with no luck! The .CoumnHeadersVisible property is set to True on the dataview.

Thanks
 
In ASP.NET :
DataGrid1.Columns(i).HeaderText = &quot;<name header>&quot;
with i as an integer...

In HTML :
<asp:BoundColumn DataField=&quot;<name field in query/database>&quot; HeaderText=&quot;<name header>&quot;>
</asp:BoundColumn>

I hope this will help you.


 
Thanks .. but I'm working with these controls on a windows form (in a vb.net solution). Any ideas on this?



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top