Infragistics Web Data Control is not allowing me to put value of variable from the code behind instead of the header text mentioned in bold below. I in the aspx.cs file I have one string variable 'annType' which has some value. I want to display that value as the header text for the BoundDataField column below. I haver tried using <% %> but it is not working. Can anyone please suggest me a work around for this ?
<ig:WebDataGrid ID="wdgCaseSeriesDetails" runat="server" AutoGenerateColumns="false" EnableViewState="true" BorderWidth="1px" Width="99.8%" ShowFooter="True" HeaderCaptionCssClass="HeaderCaptionClass" EnableDataViewState="True"> <ClientEvents Initialize="WebDataGrid1_ContainerGrid_Initialize" /> <Columns>
<ig:BoundDataField DataFieldName="MEMO" Key="MEMO" Width="8%">
<Header Text="Case Update Category" />
</ig:BoundDataField>
</Columns></ig:WebDataGrid>
Hello Suhag Ajudia,
Thank you for posting in our forums!
The "<% %>" and "<%= %>" inline expressions cannot be used as control attribute values. The following Stack Overflow question provides some useful information on this.
http://stackoverflow.com/questions/370201/why-will-expressions-as-property-values-on-a-server-controls-lead-to-a-co* Please note this site is not owned or maintained by Infragistics.
Instead, I recommend setting the header's text in codebehind. The following code is an example of how you can accomplish this:
WebDataGrid1.Columns["MEMO"].Header.Text = annType;
If you have any further questions or concerns with this, please let me know.