.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Applying conditional formatting to the 'AssignedTo' column does not work in a data view using Shar

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :SharePoint
This one is throwing me for a loop.  I've joined two lists using "Linked Sources" in SharePoint Designer.  On a new ASPX page I added a data view and added 3 columns (Title, Priority and AssignedTo) as a multi-Item view.   I can select a row and apply conditional formatting to the Title field (changing the background color if @title = 'Parent 1') and the changes are displayed in the design pane.   The only oddity there is that I have to go back and edit the condition in advanced mode, changing the XPath expression from ../../../Rows/Row/@Title = 'Parent 1' to @Title = 'Parent 1'  and then it seems to work just fine. Here's the problem.  I want the condition applied to the AssignedTo column (hide row if 'AssignedTo != 'John Doe')  If I create a condition to hide contents if the AssignedTo = 'John Doe' it creates the XPath expression ../../../Rows/Row/@AssignedTo = 'John Doe'.  When I save it, the row is still visible.  If I edit the XPath expression, changing it to @AssignedTo = 'John Doe' and save it the row is still visible.  The same is true if I simply try to change the background color, conditionally formatted  against the AssignedTo column. Does anyone have any ideas here?              

View Complete Post

More Related Resource Links

How to pass page column value to data view parameters

Hi All, I have a page library with custom column, lets call it "FormCourseId". On that page I have data view which retrieves data from custom list filtered by page column "FormCourseId". In parameter wizard creates the following tag <ParameterBinding Name="ListCourseId" Location="Form(FormCourseId)" DefaultValue=""/> Then I try to use that parameter in XSLT of data view as a filter creteria.  <xsl:param name="CourseId"></xsl:param> It does not work for me. If I change data view parameter source from Form to Query String and pass parameter as url one it works fine. What is wrong with page column parameter binding? May be if FormCourseId column is not presented in form layout as a field(I do not need to show that field in user form of the page) it could not be treated as form parameter?

Conditional formatting on a joined subview using SharePoint Designer 2007 does not work

I have 2 SharePoint lists, one is a parent task list and the other a child task lists.  In SharePoint Designer 2007 I have created a combined datasource from these 2 lists.  From there I created a new ASPX page inserting the parent list as a dataview and the child as a subview.  So far so good, all is functioning as you would expect.    Now I need to apply conditional formatting to cells and rows in both the parent and child lists.  I can create a very simple condition on a row or cell of the parent list such as "If ID Equals '2988' format the background color as green" but no conditional formatting appears for the row where ID = 2988.  Incidentally, if I change the condition to "not equals 2988" the background changes to green. The line in the code view of Designer appears as follows:  <xsl:if test="../../../Rows/Row/@ID = '2988'">background-color: #00FF00;</xsl:if> I've seen this question asked here and in blogs but never answered.  If anyone has a solution, I would love to know what it is. Thanks; Dave  UPDATE:  it doesn't seem to matter if you add the additional fields as a joined subview or not.  If I add 2 data views, both using the linked data source which is configured to JOIN the contents of the data sources the conditional formatt

Need help on Select button column in Data Grid to populate fields in Form View


 When I have a select a row in a Data Grid that when I click on it I want it to show the info for the person I selected in a form view on the same page as the Data Grid. Here are the columns for the Data Grid that I have set up, the column is highlighted:

<asp:DataGrid ID="MHGrid" AutoGenerateColumns="False"  
        DataSourceID="MHFoundation" DataKeyField="POPULATION_LIST_ID" 
        AllowPaging="True" AllowSorting="True" BorderStyle="Solid" 
        BorderColor="#999999" BorderWidth="3px" CellPadding="4" PageSize="4" 
        CellSpacing="2" runat="server" BackColor="Gray" Font-Bold="False" 
        Font-Italic="False" Font-Overline="False" Font-Strikeout="False" 
        <SelectedItemStyle BackColor="#FF9900" Font-Bold="False" Font-Italic="False" 
            Font-Overline="False" Font-Strikeout="False" Font-Underline="False" />
            <asp:ButtonColumn CommandName="Select"  Text="Select"></asp:ButtonColumn>
            <asp:BoundColumn D

How to Disable Specific Column in Data Grid View and write something in Cell and load data in anothe


Hello All  ,

i have data grid view and i want to disable specific column from writing in it and in another column 

i want to write something like item code and load the item name automatically in the corresponding cell in the disabled column 

i hope that i write my problem correctly and you can understand what i want :)

thanks in advance ,

Kareem Naguib

Sharepoint Designer - Conditional Formattting with column not in view


I'm trying to apply conditional formatting to a view and it works, but only if all the columns the conditional criteria are based on.  

This sort of defeats the purpose since I want to just highlight an the Title of the list item if a column within the list item that is not currently visible meet my criteria. I'm trying to save screen real estate space by displaying fewer columns and also to try to increase page rendering time. However, I doubt I'd really be decreasing page load times if I'm still requiring even data that is not displayed to be read.  

Anyone know of a workaround?  

Refresh data source view gets 'column' argument cannot be null

When I try to refresh a data source view in SQL Server 2008 BIDS, I get the error: System.Data   'column' argument cannot be null.  Parameter name: column.   How to resolve this?  The underlying tables have no data yet.

Apply conditional formatting to TD instead of to the actual data?


I am trying to assign conditional formatting to a table cell, just like what happens in Excel's conditional formatting.

In SPD 2010, I can select the cells in a column by clicking within a single cell in a column (the white td tooltip pops up and all cells are highlighted) or I can select the actual data items by more carefully clicking on the data instead of the cell's white space (xsl:value-of tooltip pops up and only the data itself is highlighted--not the entire cells).

In the Conditional Formatting task pane, with either the tds or the data items selected, I can use the Create drop down and make a new Apply formatting... condition. The strange thing is the condition never gets added to Existing conditions in the Conditional Formatting task pane if I have the td selected. However, the condition does appear if I have the xsl:value-of selected.

Why can I apply conditional formatting to the values but not to tds?

Custom Display in Data View column in SharePoint



I am using SharePoint designer 2007 to create Data View web part where I want custom display text in one column depending upon condition. In designer there is way to implement custom display which allows to change style conditionally. Is there any way to change the text conditionally?

Just to underline the problem I want to change text in Data View column conditionally.



Column filter in Business Data List web part does not work for all fields


I have a BDC entity whose fields contain a variety of data – numbers, dates and strings.  When I use the business data list web part I find that some of the columns’ dynamic filtering (accessed from the list’s column header) doesn’t work.  For these problem fields, the filter values load correctly but when I select a value all records disappear.  Initially I thought this was limited to just string columns but there is one string column that does filter correctly.

Here are some things that may be useful to know:

1.       The datasource is a SQL view and all fields are varchar(255)


Can Report Builder mimic something like MS Word's "Column" formatting with a lot of table data?



I want to make a report that shows the sign-in of a list of people. There will be anywhere from 40-200 people signing in per day. I need to print this data. The columns in the row are small: [firstname, lastname, id number].

What I would like to do is have 2-3 mega-columns, which each "mega"-column contains [firstname, lastname, id number]. I'm using the phrase mega-column to distinguish from a normal column in the context of a table.

Is that possible with report builder? My production platform is IIS7.5 with ASP.NET 4 and MVC3. I am planning on generating PDFs for the user to print. However, right now it looks simpler to just format html with stylesheets and have that print.

Any help would be appreciated.



Using Conditional Split data Transfer in SSIS 2008

This article uses the Integration Services Conditional Split Data Transformation element to filter and transfer data from a set of flat text files to SQL Server database table. The concept can be easily extended to apply to any other source or destination such as Microsoft Excel. This scenario is useful in creating denormalized database tables in a reporting and analysis situation.

Rendering data with HTML tags in the DD Gridview for a selected column


I am having trouble finding out where and how to HTML Encode a cell's data on the Dynamic Data (v4.0) gridview of List.aspx.  As a simple case, suppose I have formatted cell data that is A<br/>B in the DB.    Obviously, I want A stacked on B in the cell.

It seems gridView1.HtmlEncode = true has gone away.

So maybe I'll try to catch it on the RowDataBound event:

protected void GridView1_RowDataBound(Object sender, GridViewRowEventArgs e)

            if (e.Row.RowType == DataControlRowType.DataRow)
                // Html Encode the cells


but this event never fires?

Has anyone figured out how to properly render HTML tags data in the List.aspx's GridView1? 

If I figure this out, then I can add a MetaAttribute called something like [EncodeAsHtml(true)] and be on my way.  Thanks!

Vista and Office: View Data Your Way With Our Managed Preview Handler Framework


Stephen Toub shows you how to write your own Preview handlers for Windows Vista and Outlook 2007.

Stephen Toub

MSDN Magazine January 2007

Data Points: Column Expressions, DataRelations, and Computations


This month John Papa fields some of his favorite questions regarding data manipulation with ADO.NET.

John Papa

MSDN Magazine January 2007

C++ at Work: Persisting View State Update, Using Managed Extensions in a DLL


This month marks the 11th anniversary of my column and the inauguration of a new title: C++ At Work. We're also adding a new bimonthly column, "Pure C++," by my pal Stan Lippman, one of the great C++ Masters.

Paul DiLascia

MSDN Magazine February 2005

Disable filtering on a Dynamic Data list view.


I have an entity set of NotificationTemplates, and each one of these has a collection of zero-many SmsTemplate entities. When editing or viewing a NotificationTemplate, I have a link to View SMS Templates. That link takes me to a List view for the SmsTemplates entity set, filtered for the NotificationTemplate I was viewing.

How can I prevent the user changing this filter to show SmsTemplates for another NotificationTemplate? That is, I want the filter, but it must be read only. The drop-down just mustn't drop down, it must just display the name of the NotificationTemplate that these SmsTemplates belong to. To view SmsTemplates for another NotificationTemplate, the user must click View SMS Templates from that other template.

This was originally asked by myself on SatckOverflow at: http://stackoverflow.com/questions/3514373/disable-filtering-on-a-dynamic-data-list-view

split one data column into many?


Hi, I've a database table contains survey questions and answers. But the problem is both 'question' and 'answer' are saved in the same column(like below).

SubmissionDate                                                          Submission

2010-02-15 14:53:59.657                     ***What's your pet's name?***  Lili ***Tell us about yourself*** I'm a teacher

2010-02-15 14:53:59.657                     ***What's your pet's name?***  Lucy ***Tell us about yourself*** I'm a five star cook

I'd like to use a simple datagrid to display the survey result, but I need to separate the submission column into multiple columns ('question' as column name, 'answer' as data)

the number of questions or questions being asked are different for each survey so they are not fixed. 

Is it even possible to get something like this below in a gridview? 


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend