2014-02-05 57 views
0

如何突出或大膽的新紀錄我嘗試下面的HTML,SP新紀錄亮點或大膽Asp.Net,HTML

中繼器代碼

<table class="CSSTableGenerator" border="0" cellpadding="0" cellspacing="0" id="results"> 
    <asp:Repeater ID="Repeater2" OnItemCommand="Repeater2_ItemCommand" runat="server" 
     OnItemDataBound="Repeater2_ItemDataBound"> 
     <HeaderTemplate> 
      <tr> 
       <%-- <td> 
            DocumentID 
           </td>--%> 
       <td> 
        Document Name 
       </td> 
       <td> 
        File Name 
       </td> 
       <td> 
        Uploaded By 
       </td> 
       <td> 
        Uploaded Date 
       </td> 
       <td> 
        Email 
       </td> 
       <td> 
        Department 
       </td> 
       <td> 
        Status 
       </td> 
      </tr> 
     </HeaderTemplate> 
     <ItemTemplate> 
      <tr> 
       <asp:HiddenField ID="DocId" runat="server" Value='<%#DataBinder.Eval(Container.DataItem, "DocID")%>' /> 
       <%--<asp:Label Id="DocId" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "DocID")%>'></asp:Label>--%> 
       <td> 
        <asp:Label ID="DocName" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "DocumentName")%>'></asp:Label> 
       </td> 
       <td> 
        <asp:Label ID="Uploadfile" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "Uploadfile")%>'></asp:Label> 
       </td> 
       <td> 
        <asp:Label ID="Label1" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "UploadedBy")%>'></asp:Label> 
       </td> 
       <td> 
        <asp:Label ID="UploadedDate" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "UploadedDate")%>'></asp:Label> 
       </td> 
       <td> 
        <asp:Label ID="YourEamil" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "UserEmail")%>'></asp:Label> 
       </td> 
       <td> 
        <asp:Label ID="DepType" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "Department")%>'></asp:Label> 
       </td> 
       <td> 
        <asp:Label ID="lblCountry" runat="server" Text='<%# Eval("ApproveID") %>' Visible="false" /> 
        <asp:HiddenField ID="hfDepartmentId" runat="server" Value='<%# Eval("ApproveID") %>' /> 
        <asp:DropDownList ID="DropDownList4" runat="server" EnableViewState="true" class="vpb_dropdown1" 
         DataTextField="ApproveType" DataValueField="ApproveID" AutoPostBack="true" OnSelectedIndexChanged="DropDownList4_SelectedIndexChanged"> 
         <asp:ListItem Text="Pending" Selected="selected" Value="3"></asp:ListItem> 
         <asp:ListItem Text="Approve" Value="1"></asp:ListItem> 
         <asp:ListItem Text="Reject" Value="2"></asp:ListItem> 
        </asp:DropDownList> 
       </td> 
      </tr> 
     </ItemTemplate> 
    </asp:Repeater> 
</table> 

這是SP,當用戶上傳文檔

ALTER procedure [dbo].[fileupload] 
@DocDesciption nvarchar(50), 
@DocName nvarchar(50), 
@Uploadfile nvarchar(50), 
@DocTypeID int, 
@DepID int, 

@UploadedBy nvarchar(50), 
@UserID int 
as 
insert into DocumentInfo(DocDesciption,DocName,UploadedDate,Uploadfile,DocTypeID,DepID,UploadedBy,ApproveID,UserID,Viewed) 
values(@DocDesciption,@DocName,GETDATE(),@Uploadfile,@DocTypeID,@DepID,@UploadedBy,3,@UserID,'false') 

當我上傳新的文件,在表它顯示我這樣請該PIC表 table

在我的.aspx設置這樣

<tr class="<%# DataBinder.Eval(Container.DataItem, "Viewed") == "false" ? "highlight" : string.Empty %>"> 

存在的.aspx文件上傳形式的.aspx文件uplaod形式的用戶上傳文檔的其它視圖文檔表格填好並在他/她的文檔視圖。 ASPX視圖文檔形式

爲我用這個SP查看文檔

ALTER procedure [dbo].[UserIDDoc] 

@UserID int 
as 
Select DISTINCT dbo.DocumentInfo.Viewed, dbo.DocumentInfo.DocID as DocumentID, 
dbo.DocumentInfo.DocName as DocumentName, 
dbo.DocumentInfo.UploadedDate as UploadedDate, dbo.DocType.DocType as Document, 

dbo.Department.DepType as Department, dbo.DocumentInfo.Uploadfile as FileUploaded, 

dbo.ApproveType.ApproveType AS Status 

FROM dbo.DocumentInfo inner JOIN dbo.DocType ON dbo.DocumentInfo.DocTypeID=dbo.DocType.DocTypeID 
inner JOIN dbo.Department ON dbo.DocumentInfo.DepID=dbo.Department.DepID 

inner join dbo.ApproveType on dbo.DocumentInfo.ApproveID=dbo.ApproveType.ApproveID 
left JOIN dbo.Approval ON dbo.DocumentInfo.DocID = dbo.Approval.DocID 
where [email protected] 

但是當我查看文件,然後文件不以粗體或突出檢查此PIC

repeater pic

+0

我想大膽的整排 – user3265377

+0

然後在這裏分享你的中繼代碼... –

+0

檢查我的更新問題@joker – user3265377

回答

0

試試這個。

在表中添加樣式,style="font-weight:bold"。 e.g,

<table class="CSSTableGenerator" border="0" style="font-weight:bold" cellpadding="0" cellspacing="0" id="results" > 

,或者您也可以定義font-weight:bold風格融入您的CSSTableGenerator它會以同樣的爲您服務。

爲了突出顯示,您可以在DataGrid的RowDataBound事件中執行此操作。

例如,

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) 
{ 
    int noOfRows = ((DataTable)GridView1.DataSource).Rows.Count; 
    if (e.Row.RowType == DataControlRowType.DataRow) 
    { 
     if(e.Row.RowIndex == noOfRows -1) 
     { 
      e.Row.BackColor = System.Drawing.Color.Yellow; 
     } 
    } 
} 
+0

OK,然後當行用戶點擊的話,我想在正常手段現在的位置是不大膽,當用戶在中繼器中添加記錄,然後我想要大膽這個新記錄,當點擊行時,它會變成正常的位置.....與我們在Gmail郵件中看到的任何新電子郵件的相同時,它都是大膽的,當我們點擊電子郵件時變爲正常位置意味着不以粗體顯示 – user3265377

+0

這意味着您要突出顯示新記錄,並且當用戶單擊/查看它時,它將變得像現有記錄一樣正常。 –

+0

是的....所以幫助? – user3265377