.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

SP 2010 Conditional Format, format selection

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :SharePoint

I have a list with the columns Title,  Rev, MyName1, MyName2. I am trying to apply a format selection conditional format for all of the cell values in each of the MyNameX columns where if NameX (either 1 or 2)(two conditional format statements) has a value less than the value in the row/column Rev, then highlight the cell background as Red.

When I enter this, I get all of the cells Red in the column regardless of the values. However if I change the condition to a static value (instead of pointing to the @Rev column) it works as predicted.

Field Name   Comparision   Value  

myname1    Not Equal       @rev

Under the advanced button the xPath formula appears like:

$thisNode/@name != @rev (this is what does not work)

However if I change it to

Field Name   Comparision   Value  

myname1    Not Equal       03

Under the advanced button the xPath formula appears like:

$thisNode /@name != '03' (this works as expected)

As a side note this used to work fine in SP2007 although the xPath formula was a bit different.



View Complete Post

More Related Resource Links

Sp 2010 Conditional format problem


Goal: compare two columns in a list and highlight the background (cell value) if the values do not match.

Example list

Title              Rev           Myname

my doc         01             00

So I select the "XSL value of" cell of Myname (in this case 00),

select conditional format, format selection,

under field name select MyName, comparison (not equal), Value (@Rev) (more fields, select column labeled Rev)

Set Style cell background value = Red

Results: All items are highlighted in the Myname column whether they match or not.

However, if I change the conditional format statement to:

under field name select MyName, comparison (not equal), Value "00" (or some static number)

Style  cell background value = Red

Results: Works as expected

Video: Converting Word Documents to PDF Format Using SharePoint Server 2010 and Word Services

Watch this visual how-to video as you learn how to programmatically convert Word documents to PDF format on the server by using Word Automation Services with SharePoint Server 2010. (Length: 6:15)

Need to convert query string(date - 09/15/2010) to a text format - yyyymmdd

I am fairly new to C # and need some assistance with a form page.  I have created a simple form that requires the user to select a beginning date and ending date.  I then pass the values to my code behind page via query strings.  I have them passing, but I need the format to be change to a different format.  Unfortunately the database does not use the standard date format.  It requires the date to be in a text format as YYYYMMDD.Form: <tr> <td> Beginning Date:</td> <td><asp:TextBox runat="server" ID="begDate"></asp:TextBox> <asp:Image ID="Image2" ImageUrl="~/images/calendar_schedulehs.png" runat="server" /></td> </tr> Code Behind: protected void createReport_Click(object sender, EventArgs e) { StringBuilder url = new StringBuilder("Report/TopCustomer.aspx?"); url.Append("BegDate=" + begDate.Text); url.Append("&EndDate=" + endDate.Text); url.Append("&Brnch=" + ddlLocation.SelectedValue); Response.Redirect(url.ToString()); Current URL: TopCustomer.aspx?BegDate=09/15/2010&EndDate=09/30/2010&Brnch=300I need to have the above URL change to:TopCustomer.aspx?BegDate=20100915&E

format-number issues with the Data View Web Part in SharePoint 2010

I have a number column named @Year_x0020_1_x0020_Revenue in the data view web part in SharePoint Designer 2010. In the Xpath expression builder - @Year_x0020_1_x0020_Revenue previews "500,000" If I use the format-number in the Xpath expression builder ==> format-number(@Year_x0020_1_x0020_Revenue, '$#,##0.00;-$#,##0.00'), it returns NaN. Is there any reason? 

converting date format from (Wed 1 Sep) to (2010-09-1)

Hi All,  I have a data in the excel file and I need to import the data into sqlserver. I can do this bit by importing data into a temporary table and then from that temp table to import/insert into my required table. its works fine. The problem I have, in the excel file I have a one column showing date's (format: e.g. Wed 1 Sep) and I am having a difficulty to import that column. The format of the date is bit different than the normal date. It works fine with the normal/standard date format. In my file i have a date format is  Wed 1 Sep and I need to convert this format to 2010-09-01. Although, year is missing but I can add this manually at the time of convert or just about before to convert.  Any suggestion are welcome or if you know any good way to import data from excel to sqlserver please share.  thanks for your help. Regards, Athar

Deploy infopath 2010 form template to MOSS (saved as Infopath2007 format)

I saw this post on another site and this happened to me as well.  I am trying to create a web form with controls, chose WebForms for Infopath2007 and changed the code to C# for Infopath 2007 and tried to deploy the form to the Infopath forms solution in Central Admin and was unable to do so.  any suggestions? 


I have an interesting issue while deploying a VSTO enabled form today. For

some odd reason while performing stsadm -o verifyformtemplate -filename

foobar.xsn, it returned a "FatalError : The form cannot be converted because

it was designed for a later version of InfoPath Forms Services.".

Has anyone else tried deploying a InfoPath 2010 form with managed code in a

MOSS environment?? I'd hate to go back to InfoPath 2007, I love the new

ribbon. :D


Strange "Input string was not in a correct format" after upgrading to .net 4.0 (VS 2010)


Hi guys, I am at a loss here.  I have a gridview that was displaying and handling postbacks correctly, that is, until I upgraded to .net 4.0 (vs 2010) from .net 3.5. Now I am getting the classic (and in this context meaningless) "Input string was not in a correct format" error upon postback. The postback is initiated by a command button and the row command event handles everything nicely.

The trace shows internal grid postback handling and nothing else:

[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +9594283
   System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119
   System.Convert.ToInt32(String value, IFormatProvider provider) +48
   System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +1047
   System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +210
   System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13

Infopath 2010 print in MS word format

I have a form library IP 2010 - I want to have the option for the user to print the IP document in a pre set formatted MS Word document - Is this possible via action from the Infopath form.  Thank you 

How to Assign "2010-12-28T06:00:00.000Z" (java datetime format) to C#.net datetime datatype variable



I am trying to consume java webservice in .net(Client).

Now, I have problem assigning this(2010-12-28T06:00:00.000Z) kind of datetime format into c#datetime variable.

The Java publisher webservice would accept only ISO-8601/standard xsd datetime(as shown above) format into the object which internally has datetime property.

I have a problem that c# datetime variable would only accept standard datetime format like 12/12/2010 12:00:00 AM and wouldnt accept the format publisher expected.

Any help would be appreciated.

Thanks in advance.




Automatic Format Selection in WCF RESTful service

In .NET framework 4.0, Automatic Format Selection feature is introduced by AutomaticFormatSelectionEnabled property of WebHttpBehavior class. The purpose is to dynamically find out and return the response in appropriate format for a service operation.

How To Set a Date Format In GridView Using ASP.NET 2.0

A very common desire is to set a column of a gridview to display just the month, day and year of a DateTime type. The problem is the by default, the HtmlEncode property of the boundfield attribute (
The problem is that if this field is enabled, you can not pass format information to the boundfield control. That is, if you try the following code, you will not get the desired result.

How to format and update GridView and DataGrid rows using JQuery

The behavior described in this question is as expected. When you set text of a cell in grid, it directly affects HTML that is going to be rendered. When you set text value of a cell, it means that you are setting innerText of the cell. The column that GridView creates for command fields (Edit, Delete and Select) are a (anchor) or button elements. So you can see what will happen if you set text value in that cell. It will wipe out those link or button controls and replace them with simple text string.

How to format datetime & date with century?

Execute the following Microsoft SQL Server T-SQL datetime, date and time formatting scripts in Management Studio Query Editor to demonstrate the usage of the multitude of temporal data formats available and the application of date / datetime functions.


Program for Format Conversion of An Image

.NET provides extensive support for image conversion. Any image can be processed from one format to another. Most common formats to which .NET have support for are .BMP, .EMF, .GIF, .ICO, .JPG, .PNG, .TIF and .WMF.

Get pixel format, raw format, property id list and property items image in VB.net - C#.net.

n this simple article you will learn that how we can get pixel format, raw format, property id list and property items image in VB and C#.net.

Get Pixel Format:

Image consists of pixels to get the format of the pixel we have a property named pixel format. This property returns an enumeration of pixel format. This enumeration tells the pixel format.

To demonstrate make a window application. Drag one button and a picture box on form.

Now write the following code on Button click event:

Format Generic List Bound to Gridview


I have a generic list of a custom type. The custom type has a string and double.

I'm binding the list to a gridview and it outputs everything fine.

I'm trying to format the double column into a currency format. It is in a template field as I'm calculating a running total. I pass the value to a function that returns a double and adds the current value to a running total which I will show in the footer.

The format is not changing to currency as expected when using String.Format("{0:c}", GetTotal(Convert.ToDouble(Eval("Amount"))))

Any ideas on what might be going on and how to fix this?


Export Dataset to excel sheet in a required format?



I know how to export a grid view to excel.

But here i have a Dataset which consists of data like below and also it need to display in a required format like below.

pno psubno pstate pdetailid pdetails

 12    1          CA         1           cbsdjcbdjc     

12     1          CA          2        cndcnjdcjcj

12     2           VA         4          xcndwkfcgygry

13     1            AL        1           ncdcnjdcndj

My excel sheet  should like this.

pid       pstate     

 12/1      CA             &nb

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