Hi,
I have a datasource which gets the sundays of a years.
Now I want to bind this datasource to webgrid in such a way that, for the year 2009 first sunday falls on Jan 5 2009 so in my grid 1 st row, 5 th column
is First sunday, so first row of Datattable should be binded to this cell , which iam unable to do.
I want to tally these two values, and if they are tallied i will change the cell colour.
Can anyone help me please!
-Durga
I have created a sample and uploaded. I hope it will help you.
Regards
I want to design a web grid as Leave Calender Control for whole year.
Columns with be of dates from 1-31, and rows will be of Month Names. I also want to show the week days below dates which should automatically change as year changes.
Now this grid should perform as a calender control,
on each employee data i want to show weekly off in the grid,
which should depict the weekly off, pulbic holidays, employee leaves as colours filled with different cells. I need code for this functionality.
.Now.Year);
public
List<string> getAllWeekDates(int Year)
{
List<string> strDates = new List<string>();
for (int month = 1; month <= 12; month++)
DateTime dt = new DateTime(Year, month, 1);
int firstSundayOfMonth = (int)dt.DayOfWeek;
if (firstSundayOfMonth != 0)
dt = dt.AddDays((6 - firstSundayOfMonth) + 1);
}
while (dt.Month == month)
strDates.Add(dt.ToString(
"dd/MMM/yyyy"));
dt = dt.AddDays(7);
return strDates;
This datasource provides the list of sundays which i need to bind it to my webgrid cells accordingly
Could you provide schema structure of your datasource table?
Also provide some sample rows. It would help for analysis.