Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/17/11 15:54:20 (13 years ago)
Author:
msammer
Message:

#1446 rebuild the shown table. Now it is possible to make a right 'details'-call via an action within the MVC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/WebApplication/MVC2/HLWebOKBQueryPlugin/Views/Query/RunCollectionTable.ascx

    r6076 r6226  
    11<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
     2<%@ Import Namespace="HLWebOKBQueryPlugin.Helpers" %>
     3<%@ Import Namespace="System.Reflection" %>
    24
    35<div id="RunCollectionTable" style="overflow: auto; width: 100%">
    4     <form id="frmRunCollectionTable" runat="server" method="post">
     6    <table>
     7        <thead>
     8            <tr>
     9                <th>&nbsp;</th>
     10                <% foreach (PropertyInfo pi in typeof(RunCollectionData).GetProperties()) { %>
     11                <th><%= pi.Name %></th>
     12                <% } %>
     13            </tr>
     14        </thead>
     15        <tbody>
     16            <% IList<RunCollectionData> data = (IList<RunCollectionData>) Session["QueryRuns"];
     17               foreach (RunCollectionData rcd in data) {
     18                   RouteValueDictionary rvd = new RouteValueDictionary();
     19                   rvd.Add("controller", "Query");
     20                   rvd.Add("id", rcd.Id);
     21                   %>
     22                <tr>
     23                    <td><%: Html.ActionLink("details", "Details", rvd) %></td>
    524
    6         <asp:GridView ID="GridRunCollection" runat="server" DataSourceID="dsQueryRuns">
    7             <SelectedRowStyle BackColor="Aqua" />
    8             <Columns>
    9                 <asp:BoundField />
    10                 <asp:CommandField ShowSelectButton="true" SelectText="Details" />
    11             </Columns>
    12         </asp:GridView>
    13         <asp:ObjectDataSource ID="dsQueryRuns" runat="server"
    14                     SelectMethod="getTestRuns"
    15                     TypeName="HLWebPluginHost.Models.QueryModel">
    16         </asp:ObjectDataSource>
     25                    <% foreach (PropertyInfo pi in typeof(RunCollectionData).GetProperties()) {
     26                           try { %>
     27                    <td><%= pi.GetValue(rcd, null).ToString()%></td>
     28                    <%     } catch (Exception e) { %>
     29                        &nbsp;</td>
     30                    <%     }
     31                       } %>
     32                </tr>
     33               <% } %>
     34        </tbody>
     35    </table>
    1736
    18     </form>
    1937</div>
Note: See TracChangeset for help on using the changeset viewer.