calendar control

Discussion in 'ASP .Net' started by =?Utf-8?B?TWFubnkgQ2hvaGFu?=, Nov 8, 2004.

  1. i guys,
    i am adding table to cells in the day render event if condition is true.
    However it increases the height of the cell and that row and there is lot of
    empty space in the cell which makes me believe that it should not increase
    the height unlesss it runs out of space in the cell. Is there any way i can
    control this?

    Here is my code:

    foreach (DataRowView drv in dv)
    {
    year = drv["StartDate"].ToString().Substring(0,4).ToString();
    month = drv["StartDate"].ToString().Substring(5,2).ToString();
    day = drv["StartDate"].ToString().Substring(8,2).ToString();
    DateTime e_date=Convert.ToDateTime(month+"/"+day+"/"+year);



    if (e.Day.Date.ToString().Equals(e_date.ToString()))
    {

    temp.Append("<div align=left>");
    temp.Append("<table cellpadding=1 cellspacing=0 border=0
    style=\"border-top:1px solid #C1CDD8\" bgcolor=#ffffff>");
    temp.Append("<tr>");
    temp.Append("<td bgcolor='#ffffff' width=2></td>");
    temp.Append("<td width=100%>");
    temp.Append(drv["Subject"].ToString());
    temp.Append("</td></tr>");
    temp.Append("</table></div>");
    e.Cell.Controls.Add(new LiteralControl(temp.ToString()));
    temp.Remove(0,temp.Length);
    bit=1;
    }



    }

    if (bit==1)
    {
    temp.Append("<table cellpadding=1 cellspacing=0 border=0
    style=\"border-top:1px solid #C1CDD8\" bgcolor=#ffffff>");
    temp.Append("<tr>");
    temp.Append("<td bgcolor='#ffffff' width=2></td>");
    temp.Append("<td width=100%> </td></tr></table>");
    e.Cell.Controls.Add(new LiteralControl(temp.ToString()));
    }


    //Response.Write(dv.Count);




    Thanks

    manny
     
    =?Utf-8?B?TWFubnkgQ2hvaGFu?=, Nov 8, 2004
    #1
    1. Advertising

  2. Never Mind

    "Manny Chohan" wrote:

    > i guys,
    > i am adding table to cells in the day render event if condition is true.
    > However it increases the height of the cell and that row and there is lot of
    > empty space in the cell which makes me believe that it should not increase
    > the height unlesss it runs out of space in the cell. Is there any way i can
    > control this?
    >
    > Here is my code:
    >
    > foreach (DataRowView drv in dv)
    > {
    > year = drv["StartDate"].ToString().Substring(0,4).ToString();
    > month = drv["StartDate"].ToString().Substring(5,2).ToString();
    > day = drv["StartDate"].ToString().Substring(8,2).ToString();
    > DateTime e_date=Convert.ToDateTime(month+"/"+day+"/"+year);
    >
    >
    >
    > if (e.Day.Date.ToString().Equals(e_date.ToString()))
    > {
    >
    > temp.Append("<div align=left>");
    > temp.Append("<table cellpadding=1 cellspacing=0 border=0
    > style=\"border-top:1px solid #C1CDD8\" bgcolor=#ffffff>");
    > temp.Append("<tr>");
    > temp.Append("<td bgcolor='#ffffff' width=2></td>");
    > temp.Append("<td width=100%>");
    > temp.Append(drv["Subject"].ToString());
    > temp.Append("</td></tr>");
    > temp.Append("</table></div>");
    > e.Cell.Controls.Add(new LiteralControl(temp.ToString()));
    > temp.Remove(0,temp.Length);
    > bit=1;
    > }
    >
    >
    >
    > }
    >
    > if (bit==1)
    > {
    > temp.Append("<table cellpadding=1 cellspacing=0 border=0
    > style=\"border-top:1px solid #C1CDD8\" bgcolor=#ffffff>");
    > temp.Append("<tr>");
    > temp.Append("<td bgcolor='#ffffff' width=2></td>");
    > temp.Append("<td width=100%> </td></tr></table>");
    > e.Cell.Controls.Add(new LiteralControl(temp.ToString()));
    > }
    >
    >
    > //Response.Write(dv.Count);
    >
    >
    >
    >
    > Thanks
    >
    > manny
     
    =?Utf-8?B?TWFubnkgQ2hvaGFu?=, Nov 8, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Natty Gur
    Replies:
    0
    Views:
    856
    Natty Gur
    Nov 10, 2003
  2. Trint Smith
    Replies:
    2
    Views:
    457
    Trint Smith
    Feb 26, 2004
  3. Shevek
    Replies:
    3
    Views:
    6,052
    Shevek
    Jun 23, 2004
  4. Shevek
    Replies:
    0
    Views:
    395
    Shevek
    Jun 23, 2004
  5. Parthiv Joshi
    Replies:
    1
    Views:
    709
    Samuel L Matzen
    Jul 6, 2004
Loading...

Share This Page