try this:-
you need to bind you data according to condition so in that case you have to write the data bind into the gridrowdatabound event i.e.,
private void [gridName]_RowDataBound(Object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lblIncome=(Label)e.Row.FindControl("lblIncome");
Label lblExpense=(Label)e.Row.FindControl("lblExpense");
HiddenField hdnType=(HiddenField)e.Row.FindControl("hdnType");
if(hdnType.Value=="1")
{
lblIncome.Text=[Data fetched from database for income]
}
else if(hdnType.Value=="1")
{
lblExpense.Text=[Data fetched from database for expense]
}
}
}
Bind the type field to hidden field as:-
<asp:hiddenfield id="hdnType" runat="Server" value="<%#Eval("Type") %>" xmlns:asp="#unknown" />
Please don't forget to mark this as your answer if it helps you out.