Here is the code to fill the gridview:
01.
DateTime today = db.GetServerDate();
02.
var query = from p
in
_dbRahat.Projects
03.
where p.ProjectType_Id == Convert.ToInt32(cmbProjectTypes.SelectedValue)
04.
orderby p.Code
05.
select
new
06.
{
07.
p.Id,
08.
p.Title,
09.
p.Code,
10.
StartDate = GetPastDays(p.StartDate, today),
11.
};
12.
13.
grid.DataSource = query;
14.
15.
if
(grid.Rows.Any())
16.
{
17.
grid.Select();
18.
grid.Rows.Last().IsCurrent =
true
;
19.
grid.TableElement.ScrollToRow(grid.Rows.First());
20.
}
How can I solve the issue?