Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
|
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 4th, 2004, 08:12 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default header text in datagrid

Hi

How to display header text dynamically in datagrid means
based on condition i want to dispaly the headet text.
here giving the example.
Below cntname is variable having the actual header text.

<asp:datagrid id="grd" Runat="server"> <Columns>
        <asp:TemplateColumn ItemStyle-Width="4px" HeaderText=<%=cntname%> HeaderStyle-Font-Size="10px" ItemStyle-Font-Size="8">
    </asp:TemplateColumn>

when i do this its diplaying blank header eventhough variable cntname having value.

pl help me
thanks

 
Old March 4th, 2004, 01:56 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Look into using the ItemCreated event of the datagrid. Here you can check for the "Header" DataGridItem, and then manipulate the column header as needed.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagrid fixed header Swopna .NET Framework 1.x 1 March 22nd, 2008 11:06 AM
Text File Header rohan.c Intro Programming 0 August 19th, 2007 04:19 PM
datagrid header frezing Rama C# 1 March 2nd, 2006 05:15 PM
Clicking on a datagrid header badgolfer ASP.NET 1.0 and 1.1 Basics 1 November 5th, 2004 03:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.