DayRenderEventArgs.Cell プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DayRenderEventArgs.Cell プロパティの意味・解説 

DayRenderEventArgs.Cell プロパティ

Calendar コントロール表示されるセルを表す TableCell オブジェクト取得します

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Dim instance As DayRenderEventArgs
Dim value As TableCell

value = instance.Cell
public TableCell Cell { get; }
public:
property TableCell^ Cell {
    TableCell^ get ();
}
/** @property */
public TableCell get_Cell ()

プロパティ
Calendar表示するセルを表す TableCell

解説解説
使用例使用例

Cell プロパティ使用して表示された月の日付背景色プログラムにより黄色に変更するコード例次に示しますCell プロパティControl.Controls コレクションSystem.Web.UI.LiteralControl コントロール追加してセル内容カスタマイズする方法示します

<%@ Page Language="VB" AutoEventWireup="True"
 %>

<html>
<head>

   <script language="VB" runat="server">
    Sub DayRender(source As Object,
 e As DayRenderEventArgs)
        
        ' Change the background color of the days in the month
        ' to yellow.
        If Not e.Day.IsOtherMonth And
 Not e.Day.IsWeekend Then
            e.Cell.BackColor = System.Drawing.Color.Yellow
        End If 
        ' Add custom text to cell in the Calendar control.
        If e.Day.Date.Day = 18 Then
            e.Cell.Controls.Add(New LiteralControl("<br>"
 & "Birthday"))
        End If 
    End Sub 'DayRender
  </script>
 
</head>
 
<body>
 
   <form runat="server">

      <h3>DayRender Event Example</h3>
 
      <asp:Calendar id="calendar1" 
                    OnDayRender="DayRender"
                    runat="server">

         <WeekendDayStyle BackColor="gray">
         </WeekendDayStyle>

      </asp:Calendar>
                   
   </form>
          
</body>
</html>
   
<%@ Page Language="C#" AutoEventWireup="True" %>

<html>
<head>

   <script language="C#" runat="server">
   
      void DayRender(Object source, DayRenderEventArgs e) 
      {

         // Change the background color of the days in the month
         // to yellow.
         if (!e.Day.IsOtherMonth && !e.Day.IsWeekend)
            e.Cell.BackColor=System.Drawing.Color.Yellow;

         // Add custom text to cell in the Calendar control.
         if (e.Day.Date.Day == 18)
            e.Cell.Controls.Add(new LiteralControl("<br>Birthday"));

      }

   </script>
 
</head>
 
<body>
 
   <form runat="server">

      <h3>DayRender Event Example</h3>
 
      <asp:Calendar id="calendar1" 
                    OnDayRender="DayRender"
                    runat="server">

         <WeekendDayStyle BackColor="gray">
         </WeekendDayStyle>

      </asp:Calendar>
                   
   </form>
          
</body>
</html>
   
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DayRenderEventArgs クラス
DayRenderEventArgs メンバ
System.Web.UI.WebControls 名前空間
TableCell
CalendarDay クラス
Calendar クラス
Day
SelectUrl
Calendar.DayRender イベント


このページでは「.NET Framework クラス ライブラリ リファレンス」からDayRenderEventArgs.Cell プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からDayRenderEventArgs.Cell プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からDayRenderEventArgs.Cell プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DayRenderEventArgs.Cell プロパティ」の関連用語

DayRenderEventArgs.Cell プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DayRenderEventArgs.Cell プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS