سؤال

I nedd to insert a text in resource file with html in the attribute HeaderText of a TemplateField.. I cant use an HeaderTemplate because the sorting does not work... Neither with this solution (the datasource result in null).

So im trying a solution like this:

HeaderText="<span><%$ Resources:ForumResources, DATA_CREAZIONE %></span><img src="..." />"

But it is rendered like this:

<span><!-- Resources:ForumResources, DATA_CREAZIONE --></span>
<img src="..." />"

Like a comment, why? How can i solve this?

Thanx

هل كانت مفيدة؟

المحلول

I think you should be using like this

gridview1.Columns[ColumnIndex].HeaderText = "Header text";

gridview1.Columns[ColumnIndex].HeaderText =
                                    Resources:ForumResources, DATA_CREAZIONE;

نصائح أخرى

Call A function that retur string like u want....

DO THIS just AFTER binding ur gridview

gridview1.Columns[ColumnIndex].HeaderText =getstring();

        public string getstring()
        {
        string str="<span>"+yourcontent in the form of string+"</span><img src="..." />";
        return str;
        }
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top