Microsoft Content Management Server - Channel Render when in Edit mode, display the Posting Status

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > February 2004 > Channel Render when in Edit mode, display the Posting Status





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Channel Render when in Edit mode, display the Posting Status
George Leithead

2004-02-26, 11:36 am

Hi all,

I have a generic channel render, that uses a datagrid to display a postings collection:

<asp:datagrid runat="server" id="displayGrid" autogeneratecolumns="False" allowpaging="True" pagesize="10" cellpadding="3"
cellspacing="3" borderwidth="0" pagerstyle-nextpagetext="Next 10" pagerstyle-prevpagetext="Previous 10" showheader="False">
<columns>
<asp:templatecolumn>
<itemtemplate>
<h4><a href="<%#DataBinder.Eval(Container, "DataItem.URL")%>"><%#DataBinder.Eval(Container.DataItem,
"DisplayName")%></a></h4>
<p>
<%#DataBinder.Eval(Container.DataItem, "PlaceHolders['PostingSummary'].Html")%><br />
<sup>(<b>Created</b>: <%#DataBinder.Eval(Container, "DataItem.StartDate")%> )</sup>
</p>
</itemtemplate>
</asp:templatecolumn>
</columns>
</asp:datagrid>

When the user is in presentation mode, this is fine. However, when the user switched to Edit mode, I want to display the posting
status/state.

As you can appreciate, the list of published postings can be very different from the work in progress postings.

Basically, what I want is something like below:

[When in Published Mode]
==============
Posting Title (Status: Published)
First Posting (Status Published)

[When in Edit mode]
==============
Posting Title (Status: Published)
Another Posting Title (Status: Saved)
Yet Another Posting Title (Status: Waiting For Editor Approval)
First Posting (Status Published)

Does anyone have an idea of how I can achieve this?


Stefan [MSFT]

2004-02-26, 12:36 pm

Hi George,

add the following to your datagrid to display the current state:

(<b>State</b>: <%#DataBinder.Eval(Container, "DataItem.State")%> )

The complete grid (I just tested it) looks like this:

<asp:datagrid runat="server" id="displayGrid"
autogeneratecolumns="False" allowpaging="True" pagesize="10" cellpadding="3"
cellspacing="3" borderwidth="0" pagerstyle-nextpagetext="Next 10"
pagerstyle-prevpagetext="Previous 10" showheader="False">
<columns>
<asp:templatecolumn>
<itemtemplate>
<h4><a href="<%#DataBinder.Eval(Container,
"DataItem.URL")%>"><%#DataBinder.Eval(Container.DataItem,
"DisplayName")%></a></h4>
<p>
<%#DataBinder.Eval(Container.DataItem,
"PlaceHolders['PostingSummary'].Html")%><br />
<sup>(<b>Created</b>: <%#DataBinder.Eval(Container,
"DataItem.StartDate")%> )</sup><br>
(<b>State</b>: <%#DataBinder.Eval(Container, "DataItem.State")%> )
</p>
</itemtemplate>
</asp:templatecolumn>
</columns>
</asp:datagrid>

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights.


"George Leithead" <george.leithead@NaeSphamMeh.DavisLangdon-uk.com> wrote in
message news:403e17cd$0$10335$ed9e5944@reading.news.pipex.net...
> Hi all,
>
> I have a generic channel render, that uses a datagrid to display a

postings collection:
>
> <asp:datagrid runat="server" id="displayGrid"

autogeneratecolumns="False" allowpaging="True" pagesize="10" cellpadding="3"
> cellspacing="3" borderwidth="0" pagerstyle-nextpagetext="Next 10"

pagerstyle-prevpagetext="Previous 10" showheader="False">
> <columns>
> <asp:templatecolumn>
> <itemtemplate>
> <h4><a href="<%#DataBinder.Eval(Container,

"DataItem.URL")%>"><%#DataBinder.Eval(Container.DataItem,
> "DisplayName")%></a></h4>
> <p>
> <%#DataBinder.Eval(Container.DataItem,

"PlaceHolders['PostingSummary'].Html")%><br />
> <sup>(<b>Created</b>: <%#DataBinder.Eval(Container,

"DataItem.StartDate")%> )</sup>
> </p>
> </itemtemplate>
> </asp:templatecolumn>
> </columns>
> </asp:datagrid>
>
> When the user is in presentation mode, this is fine. However, when the

user switched to Edit mode, I want to display the posting
> status/state.
>
> As you can appreciate, the list of published postings can be very

different from the work in progress postings.
>
> Basically, what I want is something like below:
>
> [When in Published Mode]
> ==============
> Posting Title (Status: Published)
> First Posting (Status Published)
>
> [When in Edit mode]
> ==============
> Posting Title (Status: Published)
> Another Posting Title (Status: Saved)
> Yet Another Posting Title (Status: Waiting For Editor Approval)
> First Posting (Status Published)
>
> Does anyone have an idea of how I can achieve this?
>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com