i use repeater in my project .. so when user add new document then i want to highlight new add documents same as gmail when we see new email in gmail account then email is in bold and then we able to see someone send email same as i want when new record added then how to highlight or identify in other ways? this is repeater code..
<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>
and this is the sp when user upload document
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')
ok when i upload new document and in table it shows me like this please check this pic table pic
and in .aspx i set like this
<tr class="<%# DataBinder.Eval(Container.DataItem, "ViewedID") == "1" ? "highlight" : string.Empty %>">
STORE PROCEDURE EDITED...
ALTER procedure [dbo].[UserIDDoc]
@UserID int
as
Select DISTINCT
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 ,
dbo.DocumentInfo.ViewedID
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.viwed on dbo.DocumentInfo.ViewedID=dbo.Viwed.ViewedType
inner join dbo.ApproveType on dbo.DocumentInfo.ApproveID=dbo.ApproveType.ApproveID
left JOIN dbo.Approval ON dbo.DocumentInfo.DocID = dbo.Approval.DocID
where UserID=@UserID
but when i view document then documents not in bold or highlight check this pic
in approvetype table it look like this in my db
ApproveID ApproveType
1 Approve
2 Reject
3 Pending