Click here to Skip to main content
15,900,973 members
Home / Discussions / C#
   

C#

 
GeneralRe: Gridview1_rowdatabound event Pin
Andrew Woodward7-Jan-10 9:26
Andrew Woodward7-Jan-10 9:26 
GeneralRe: Gridview1_rowdatabound event Pin
OriginalGriff7-Jan-10 9:47
mveOriginalGriff7-Jan-10 9:47 
GeneralRe: Gridview1_rowdatabound event Pin
Andrew Woodward7-Jan-10 9:57
Andrew Woodward7-Jan-10 9:57 
GeneralRe: Gridview1_rowdatabound event Pin
OriginalGriff7-Jan-10 10:14
mveOriginalGriff7-Jan-10 10:14 
GeneralRe: Gridview1_rowdatabound event Pin
Andrew Woodward7-Jan-10 10:26
Andrew Woodward7-Jan-10 10:26 
GeneralRe: Gridview1_rowdatabound event Pin
OriginalGriff7-Jan-10 10:33
mveOriginalGriff7-Jan-10 10:33 
GeneralRe: Gridview1_rowdatabound event Pin
Andrew Woodward7-Jan-10 10:39
Andrew Woodward7-Jan-10 10:39 
GeneralRe: Gridview1_rowdatabound event Pin
OriginalGriff7-Jan-10 10:50
mveOriginalGriff7-Jan-10 10:50 
I told you you would kick yourself!
I would also consider re-writing your routine along the lines of:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
    DataRowView myDataRowView = (DataRowView)e.Row.DataItem;
    Single difference = Convert.ToSingle(myDataRowView["Difference"]);
    Image image = e.Row.FindControl("ImageRating") as Image;
    if (image != null)
        {
        if (e.Row.RowType == DataControlRowType.DataRow)
            {
            if (difference > 2.5)
                {
                image.ImageUrl = "~/Images/Bad.png";
                }
            if (difference == 2.5)
                {
                image.ImageUrl = "~/Images/Average.png";
                }
            else
                {
                image.ImageUrl = "~/Images/Good.png";
                }
            }
        }
    }
You may have to tweak it a bit since yours is an ASP.NET project - I don't have one loaded so my Image object doesn't have an ImageUrl property. It should make no real difference to execution speed (as the comiler will optimse it for the release version) but it does improve readability.

All those who believe in psycho kinesis, raise my hand.

QuestionAre there anyone who know how to process cube via .net c# Pin
ImTheKiN7-Jan-10 6:37
ImTheKiN7-Jan-10 6:37 
AnswerRe: Are there anyone who know how to process cube via .net c# Pin
Alan Balkany8-Jan-10 4:44
Alan Balkany8-Jan-10 4:44 
QuestionInteractive 2D openGL Pin
Paul Harsent7-Jan-10 6:27
Paul Harsent7-Jan-10 6:27 
QuestionApp.config with custom section and custom elements collection inside Pin
xkrja7-Jan-10 4:30
xkrja7-Jan-10 4:30 
Questionfind week num of first week in year [modified] Pin
Maddie from Dartford7-Jan-10 4:09
Maddie from Dartford7-Jan-10 4:09 
AnswerRe: find week num of first week in year Pin
dan!sh 7-Jan-10 4:21
professional dan!sh 7-Jan-10 4:21 
GeneralRe: find week num of first week in year Pin
Maddie from Dartford7-Jan-10 4:30
Maddie from Dartford7-Jan-10 4:30 
GeneralRe: find week num of first week in year Pin
dan!sh 7-Jan-10 4:36
professional dan!sh 7-Jan-10 4:36 
GeneralRe: find week num of first week in year Pin
Maddie from Dartford7-Jan-10 4:47
Maddie from Dartford7-Jan-10 4:47 
GeneralRe: find week num of first week in year Pin
dan!sh 7-Jan-10 4:53
professional dan!sh 7-Jan-10 4:53 
GeneralRe: find week num of first week in year [modified] Pin
dojohansen8-Jan-10 1:15
dojohansen8-Jan-10 1:15 
GeneralRe: find week num of first week in year Pin
OriginalGriff7-Jan-10 8:32
mveOriginalGriff7-Jan-10 8:32 
GeneralRe: find week num of first week in year Pin
dojohansen8-Jan-10 1:21
dojohansen8-Jan-10 1:21 
AnswerRe: find week num of first week in year Pin
Richard MacCutchan7-Jan-10 4:44
mveRichard MacCutchan7-Jan-10 4:44 
GeneralRe: find week num of first week in year Pin
Maddie from Dartford7-Jan-10 4:59
Maddie from Dartford7-Jan-10 4:59 
GeneralRe: find week num of first week in year Pin
Richard MacCutchan7-Jan-10 5:42
mveRichard MacCutchan7-Jan-10 5:42 
GeneralRe: find week num of first week in year Pin
Maddie from Dartford7-Jan-10 6:03
Maddie from Dartford7-Jan-10 6:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.