all groups > asp.net webcontrols > may 2007 >
You're in the

asp.net webcontrols

group:

gridview objectDataSet BusinessLayer



gridview objectDataSet BusinessLayer Richard Roche
5/31/2007 11:44:01 PM
asp.net webcontrols: My business object populates the gridview, but i'm having difficulty
programatically drilling in and changing the headertext at runtime (I need to
change the language of the column heading based on the client). In the
gridview object the column collection is empty, count = 0. Why? Do i need
to drill into the control object? What is the best approach?

Any help appreciated.
--
RE: gridview objectDataSet BusinessLayer Manish Bafna
6/1/2007 3:30:00 AM
Hi,
you can write a code behind function of the page:
<Columns>
<asp:BoundField HeaderText="<%# GetHeaderText() %>"
DataField="ProductName" SortExpression="ProductName">
</asp:BoundField>
</Columns>

and in the code behind file of your page define a custom function
GetHeaderText() where you define the logic for displaying/manipulating the
header text:

public string GetHeaderText()
{
return "Header Text";
}
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.



[quoted text, click to view]
RE: gridview objectDataSet BusinessLayer Manish Bafna
6/1/2007 3:36:00 AM
Hi,
please ignore my previous post.It should be like below:
you can write a code behind function of the page:
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:Label ID="Label1" runat="server" Text="<%# GetHeaderText()
%>"</asp:Label>
</HeaderTemplate>
</asp:TemplateField>
</Columns>
and in the code behind file of your page define a custom function
GetHeaderText() where you define the logic for displaying/manipulating the
header text:

public string GetHeaderText()
{
return "Header Text";
}
for more details refer
link:http://www.eggheadcafe.com/community/aspnet/2/10020486/change-the-header-text-in.aspx
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.



[quoted text, click to view]
RE: gridview objectDataSet BusinessLayer Richard Roche
6/1/2007 5:24:02 AM
Thanks for the reply. Is there no way to iterate thru the collection? This
was available with the datagrid in framework 1.1. There are nearly 50
columns and it would be very easy to write a procedure to change the header
in logic.
--
Richard


[quoted text, click to view]
RE: gridview objectDataSet BusinessLayer Manish Bafna
6/1/2007 6:40:07 AM
Hi,
Below link solves your query:
http://forums.asp.net/p/1116572/1732569.aspx
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.



[quoted text, click to view]
RE: gridview objectDataSet BusinessLayer Richard Roche
6/1/2007 8:05:00 AM
Thanks for taking time to help, that is what i wanted.
--
Richard


[quoted text, click to view]
AddThis Social Bookmark Button