Hi
Can you manipulate data being displayed by a formview control just before its displayed? ie changing it to Upper case?
Text='<%#Bind("Alphabet") %>' to whatever you want?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Feb 18, 2010, 6:52 AM
Method 1
-------------
Method 2
----------
Suppose Nameof Label Which Diplay Alphabet in FormView1 is NameLabel then you can code in FormView1's DataBound Event lIke Below
protected void FormView1_DataBound(object sender, EventArgs e)
{
((Label)FormView1.FindControl("NameLabel")).Text = ((Label)FormView1.FindControl("NameLabel")).Text.ToUpper();
}
Amit ChoudharyPosted Feb 18, 2010, 6:37 AM
you can create a server side function returning string...
like<%# Manipulate((string)Eval("Alphabet"))%> and manipulate the string as you want.
if you are using some special formats like numbers, Currency, Date..etc. you can use String.Format() function directly.
'<%#String.Format("Hello this is {0}", Eval("Alphabet"))%>'
Don't forget to mark the answer if it helps you.