I have problem with localization headertext in gridview. I do it this way:
Protected Sub gridview1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs)
If (e.Row.RowType = DataControlRowType.Header) Then
e.Row.Cells(1).Text = Localization.GetString("BoundFieldResource1.HeaderText", LocalResourceFile)
End If
End sub
And headerText containt text but gridView can't sorting and I have AllowSorting = True. When I give headerText into definition columns then gridview can sorting.
Member
1 Points
17 Posts
Localization headertext in gridview
Mar 19, 2009 03:05 AM|Nestee|LINK
Hello,
I have problem with localization headertext in gridview. I do it this way:
Protected Sub gridview1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs)
If (e.Row.RowType = DataControlRowType.Header) Then
e.Row.Cells(1).Text = Localization.GetString("BoundFieldResource1.HeaderText", LocalResourceFile)
End If
End sub
And headerText containt text but gridView can't sorting and I have AllowSorting = True. When I give headerText into definition columns then gridview can sorting.
Please help.
Star
10925 Points
2218 Posts
Re: Localization headertext in gridview
Mar 19, 2009 08:00 AM|Steelymar|LINK
Convert your fields to templates and add header tag:
<HeaderTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="Sort" CommandArgument ="MY_Column_Name"
Text="<%$ Resources:BoundFieldResource1.HeaderText %>"></asp:LinkButton>
</HeaderTemplate>