I have the following line of code which evaluates whether the value is true or false, if its true it will show an image if its false it shows a different one.
<itemTemplate>
<img alt="" id="Img1"
src='<%# MyAdmin.GetCheckMark((bool)DataBinder.Eval(Container.DataItem, "ShowImg"))%>'
runat="server" /></ItemTemplate>
Can I customize the Eval part in the back end code in c# and then pass a different variable to it for example in C# I want to do
bool ImgFlag = false;
if(Entity.ShowImg == false && Entity.SomethingElse == true)
{
ImgFlag = true;
}
else if(Entity.ShowImg == false && Entity.SomethingElse == false)
{
ImaFlag = false;
}
else
{
ImgFlag = true;
}
And then I want to use ImgFlag instead of ShowImg in my GridView on each row, so ImgFlag will determine which flag to show..
Or is there a better way?
The issue is that that eval depends now on two things.. not one as before.
Thank you