Click here to Skip to main content
15,914,322 members
Home / Discussions / C#
   

C#

 
AnswerRe: How To Create My Own File Encryption Algorithm Pin
Manas Bhardwaj7-Jan-10 9:02
professionalManas Bhardwaj7-Jan-10 9:02 
AnswerRe: How To Create My Own File Encryption Algorithm Pin
Paladin20007-Jan-10 9:11
Paladin20007-Jan-10 9:11 
AnswerRe: How To Create My Own File Encryption Algorithm Pin
harold aptroot7-Jan-10 9:20
harold aptroot7-Jan-10 9:20 
GeneralRe: How To Create My Own File Encryption Algorithm Pin
Sokka937-Jan-10 18:47
Sokka937-Jan-10 18:47 
GeneralRe: How To Create My Own File Encryption Algorithm Pin
harold aptroot8-Jan-10 1:26
harold aptroot8-Jan-10 1:26 
GeneralRe: How To Create My Own File Encryption Algorithm Pin
Sokka938-Jan-10 5:42
Sokka938-Jan-10 5:42 
GeneralRe: How To Create My Own File Encryption Algorithm Pin
harold aptroot8-Jan-10 7:11
harold aptroot8-Jan-10 7:11 
QuestionGridview1_rowdatabound event Pin
Andrew Woodward7-Jan-10 6:47
Andrew Woodward7-Jan-10 6:47 
Hi
I am struggling with a c# event in my asp.net project.

The code I have is:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
switch (e.Row.RowType)
{
case DataControlRowType.DataRow:
DataRowView myDataRowView = (DataRowView)e.Row.DataItem;
if (Convert.ToSingle(myDataRowView["Difference"]<2.5))
{
((Image)e.row.FindControl("ImageRating")).ImageUrl == "~/Images/Bad.png";
}
if (Convert.ToSingle(myDataRowView["Difference"]=2.5))
{
((Image)e.row.FindControl("ImageRating")).ImageUrl == "~/Images/Average.png";
}
else
((Image)e.row.FindControl("ImageRating")).ImageUrl == "~/Images/Good.png";
break;
}
}  


I get errors:
Operator '<' cannot be applied to operands of type 'object' and 'double'

'System.Web.UI.WebControls.GridViewRowEventArgs' does not contain a definition for 'row' and no extension method 'row' accepting a first argument of type 'System.Web.UI.WebControls.GridViewRowEventArgs' could be found (are you missing a using directive or an assembly reference?)

Any ideas?

The datatype for difference is float in the database

Basically what I need is, If the value in column "Difference" is less than 2.5, display the image Bad.png in the rating column.
If the value of "Difference" is equal to 2.5, display the image Average.png in the rating column.
If the value of "Difference" is greater than 2.5, display the image Good.png in the rating column.

Andy
AnswerRe: Gridview1_rowdatabound event Pin
Saksida Bojan7-Jan-10 8:25
Saksida Bojan7-Jan-10 8:25 
AnswerRe: Gridview1_rowdatabound event Pin
OriginalGriff7-Jan-10 8:25
mveOriginalGriff7-Jan-10 8:25 
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 
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 

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.