i have following data table queried from database:
id MIN MAX USERID fk_id
-------------------------------------
1 1 21 1 1
2 22 30 1 1
3 31 60 2 1
4 1 90 2 2
I would like the fk_id column to identify the row value, rather than foreign key id,
as well as display this value in a grid view. In addition I would like a column of check boxes and an EDIT link. And finally I would like the min and max values to be displayed in a single column rather than two. For example if MIN is 22 and MAX is 30. it should print in one column in gridview as 22 to 30.
I want to show range(min, max), user name from userid(other table) and those tow above specified column.
Plz help
Loading
Datta KharadPosted Feb 7, 2012, 2:25 AM
You can write below code....
<%#CheckNull(DataBinder.Eval(Container.DataItem,"MAX"))%>
//In Code File..
protected string CheckNull(object objGrid)
{
if (object.ReferenceEquals(objGrid, DBNull.Value))
{
return "+";
}
else
{
return "To "+objGrid.ToString();
}
}
//Output:-
Range
5 To 10
10 To 20
20 +
//For more detail refer below link..
http://www.csharpaspnetarticles.com/2009/08/handle-gridview-eval-null-itemtemplate.html