チェンジセット 1605 (default)


以下の違いを無視:
日時:
2023/09/08 4:13:14 (13ヵ月前)
更新者:
hizuya@…
ログメッセージ:
  • GridView の TemplateField 内に配置した HyperLink などで使用する BoundParameter で、TemplateField に対してバインドされたデータを参照出来るようにする仕組みを追加。
場所:
framework/trunk
ファイル:
5個の追加
3個の更新

凡例:

未変更
追加
削除
  • framework/trunk/WebApplication/WebApplication.csproj

    r1604 r1605  
    6565    <Content Include="UI\Database\SqlErrorPage.aspx" /> 
    6666    <Content Include="UI\WebControls\FormViewPage.aspx" /> 
     67    <Content Include="UI\WebControls\TemplateFieldPage.aspx" /> 
    6768    <Content Include="UI\WebControls\ObjectDataSourceGridViewPage.aspx" /> 
    6869    <Content Include="UI\WebControls\FormViewBindPage.aspx" /> 
     
    294295    <Compile Include="UI\Parameter\ParameterMemberPage.aspx.designer.cs"> 
    295296      <DependentUpon>ParameterMemberPage.aspx</DependentUpon> 
     297    </Compile> 
     298    <Compile Include="UI\WebControls\TemplateFieldPage.aspx.cs"> 
     299      <DependentUpon>TemplateFieldPage.aspx</DependentUpon> 
     300      <SubType>ASPXCodeBehind</SubType> 
     301    </Compile> 
     302    <Compile Include="UI\WebControls\TemplateFieldPage.aspx.designer.cs"> 
     303      <DependentUpon>TemplateFieldPage.aspx</DependentUpon> 
    296304    </Compile> 
    297305    <Compile Include="UI\WebControls\JQueryImageButtonFieldPage.aspx.cs"> 
  • framework/trunk/WebLibrary/Sources/UI/WebControls/BoundParameter.cs

    r864 r1605  
    3636    /// </summary> 
    3737    /// <remarks> 
     38    /// <para> 
    3839    /// このパラメータはバウンドコントロール内でのみ使用できます。 
     40    /// </para> 
     41    /// <para> 
     42    /// <see cref="DataBindingContextHolder"/> に対応しています。 
     43    /// </para> 
    3944    /// </remarks> 
    4045    [DefaultProperty("DataField")] 
     
    5358        /// データフィールドデスクリプタ。 
    5459        /// </summary> 
    55         private PropertyDescriptor dataFieldDesc;  
     60        private PropertyDescriptor dataFieldDesc; 
    5661 
    5762 
     
    167172        } 
    168173 
    169  
    170174        /// <summary> 
    171175        /// <see cref="BoundParameter"/> オブジェクトの値を更新して返します。 
     
    187191        protected override object Evaluate(HttpContext context, Control control) 
    188192        { 
     193            // ReSharper disable once ConditionIsAlwaysTrueOrFalse 
    189194            if (context == null || context.Request == null) 
    190195            { 
     
    198203            } 
    199204 
    200             object dataItem = DataBinder.GetDataItem(control); 
     205            object dataItem = DataBinder.GetDataItem(control) ?? DataBindingContextHolder.GetDataItem(control); 
    201206            if (dataItem == null) 
    202207            { 
    203                 throw new HttpException(Resources.Http_DataItemNotFound);  
     208                throw new HttpException(Resources.Http_DataItemNotFound); 
    204209            } 
    205210 
  • framework/trunk/WebLibrary/WebLibrary.csproj

    r1603 r1605  
    144144    <Compile Include="Sources\UI\WebControls\BoundFieldUtility.cs" /> 
    145145    <Compile Include="Sources\UI\WebControls\Confirm.cs" /> 
     146    <Compile Include="Sources\UI\WebControls\DataBindingContextHolder.cs" /> 
    146147    <Compile Include="Sources\UI\WebControls\DateBox.cs" /> 
    147148    <Compile Include="Sources\UI\WebControls\DateBoxValidator.cs" /> 
詳しい使い方は TracChangeset を参照してください。