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

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

Conditionally formating a row

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :Sql Server
On the 1st row and column of data on the lay out I have 'Fields!Works_Order_Number.Value', which is sorted based on the data.  I would like to conditional format the row so that if the Fields!Works_Order_Number.Value in the row above is the same value then colour it grey if not leave transparant

View Complete Post

More Related Resource Links

How To Conditionally Show ListViewByQuery On Custom Page


I would like to only show a ListViewByQuery control on a custom page if the query contains some data. Currently if the query returns no data it is still rendered on the page with the comment "There are no items to show in this view".

The following code is my query code:

querySM.ViewFields = "<FieldRef Name='AssignedTo'/>" +
                  "<FieldRef Name='RequestSMReviewerComments' />" +
                  "<FieldRef Name='WorkflowOutcome' />";

        sQueryStr = "<Where>" +
                 "<And>" +
                  "<IsNotNull>" +
                   "<FieldRef Name='RequestSMReviewerComments' />" +
                  "</IsNotNull>" +
                  "<Eq>" +
                   "<FieldRef Name='WorkflowInstanceID' />" +

How do I conditionally hide 2 LinkButtons in a Grigview?


Hello Forum,

I'm trying to conditionally hide 2 link buttons within a Gridview(gvPosts), ModifyButton and DeleteButton.  I want the two buttons to hide in every row where the currently logged on Username is not the same as the Username in gvPosts' lbEmpID, a LinkButton control in the same row.  Unfortunately the code is hiding the buttons in every row, including the one where lbEmpID.text = Profile.Username.  My code is below, what am I doing wrong?

Thank you


        Dim lbtn As LinkButton
        For Each rowItem As GridViewRow In gvPosts.Rows
            lbtn = DirectCast(rowItem.Cells(0).FindControl("lbEmpID"), LinkButton)

            If lbtn.Text <> Profile.UserName Then
                Dim Modify As LinkButton
                Dim Remove As LinkButton

                For Each rowItem1 As GridViewRow In gvPosts.Rows


Why does text and page formating changes randomly?

Hallo there, First of all I don't know if I am posting in the right forum, so let me know if there is another forum for this issue. My form text and entire page formating changes once a while and I don't know why. e.g. font color, background color of certain paragraphs or table look changes, it seems randomly, I think it has something to do with the style but I don't know how to avoid this repeated text formating loses. In details: U am using Visual Studio 2010 Professional and is set for Visual Web Development. I create a new form e.g. default.aspx link it to a master page and the master page is linked to a css file (style sheet file) that contains only general and basic formatings and I hardly change any thing in this css file. I format my default.aspx. and later the formating chanegs by it self and I have to change it back manualy. Most of the time I have to create a new form. link it to the master page and copy the text, tables and so on from the original page to the new page and then delete the original page. but even the new page chnages later. and so on. I don't know how to avoid that! Any idea's? Thanks in advance  Michael Najar wishes you great day

Formating Text using Regex

Hello Everyone,   I have extracted some text from HTML pages & writing it to a Text file. Text is scrambled everywhere in the file after saving.   in the output text there some new line , tabs etc ... is there any way to remove them ? using Regex ?? text i am getting after extraction :- ( checked using Debug ) Pradeep \r\n\t\t\t\t\t\t\t    \r\n\t\t\t\t\t\t      G\r\n                               \r\n                                 \r\n                                \r\n                                State College \r\n                                 \r\n 

Images to conditionally appear in Gridview

Howdy all!- I've got this gridview with a column labeled "Client Comment" that displays a clickable little icon when there is a client comment in the database.  The problem is the icon is appearing whether or not there is data in the DB  (except I don' t think it does when the DB value is null.)   How can I make it so the icon only appears if there is a comment in that database field?  With code behind (if so VB) or in the tag?    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="clientID"> <Columns> <asp:BoundField DataField="clientFirstName" HeaderText="First Name" /> <asp:BoundField DataField="clientLastName" HeaderText="Last Name" /> <asp:HyperLinkField HeaderText="Client Comment" DataNavigateUrlFields="clientID" DataNavigateUrlFormatString="~/ClientInfo.aspx?ID={0}" DataTextField="clientComments" Da

Converting Date to String and Formating it Linq to SQL

Hello I have problem in converting date to string I am using cstr(p.tripstart) , which is returning Date as 12 Aug 2010 12:AM   I need to make formating   This is my code : Dim db As New TripsLinqDataContext Dim listtrips = (From p In db.Trips _ Group Join c In db.Countries On p.TripCountryID Equals c.TripCountryID Into countrylist = Group _ Select New With {.Tripdetails = p.TripDescription + " - " + p.TripCityList + " - " + CStr(p.tripstart) + " - " + CStr(p.TripDays), _ .Tripid = p.TripID}).ToList tripboxlist.DataSource = listtrips tripboxlist.DataTextField = "Tripdetails" tripboxlist.DataValueField = "Tripid" tripboxlist.DataBind()     Regards  

How to create HTML from XSLT with actual formating

Hi, I am creating HTML script using XSLT using an XML file. I am creating that input XML file from the database values. The database values are contains the data with some html formatting tags like <b>values</b> etc. for Ex:I have the table.EmployeeID CommentsEMP101   Some normal comment with <b>Value with bol</b> I required to create XML file with the fomatted comment, but when I create XML it contains &gt;&lt; etc., like <Employees><Emp id="EMP101"> <Comments>Some normal comment with &lt;b&gt;Value with bol&lt;/b&gt;<Comments></Emp></Employees> When I create HTML using XSLT, the values again contains the &gt;&lt; characters instead of the actual formating what the database stores. Please let me know how to solve this issue. I required the output HTML will be inthe same format what the database stored. Many Thanks,Kelvin.

How to conditionally Enable/Disable Button control using JavaScript ?

hi all... i have a Button control & a TextBox control on my web page. The Button control is initially Disabled. I want that while typing into TextBox, when the length of the contents of TextBox reaches to 12 (i.e. when i type 12th character), the Button Control should be Enabled & if the length again comes down to less than 12, the Button control should again be Disabled... How can i do this using JavaScript...?? Does anyone know how to do this...?? Please help. It's urgent... Thanx in advance to all posts !

conditionally hide a field in a custom form using SharePoint Designer

I'm able to hide a field based on a security group. but, how do you hide a field based on a value in another field? Custom form opens, if fieldTwo = "taco", hide fieldOne.    

Is there a way to conditionally enable/disable a custom action

I've created a custom action that kicks off a workflow on an item in a list.  I want the workflow to be initiated only once.  So, once it is kicked off the first time, I'd like the custom action to be disabled so others cannot start it again. Is there a way to do this in Sharepoint Designer?

SQL Formating

Hello all ! Here is my dilema! select counterdatetime, countervalue from counterdata; counterdatetime          countervalue ------------------------ ---------------------- 2010-09-13 21:28:12.359  0 2010-09-13 21:28:27.359  9.49375 2010-09-13 21:28:42.359  9.88472222222222 2010-09-13 21:28:57.375  12.5145833333333 I wish to be able to select the data in the following format: counterdatetime          countervalue ------------------------ ---------------------- 13-09-2010 21:28:12  0 13-09-2010 21:28:27  9.49 13-09-2010 21:28:42  9.88 13-09-2010 21:28:57  12.5 Please help, wanting to be able to graph this data so that the date + time are along the bottom and the counter up the vertical but need this format first

SSRS 2008 R2 Conditionally Hide Matrix Group


With SSRS 2005 we were able to conditionally hide and show row matrix groups in a report.  Now that we have upgraded to SQL 2008 R2 when we set a child row group Hidden property to true conditionally or manually no rows appear on the report.  Has anyone seen this before and is there a work around or a hot fix for this. 

Any insight will be greatly appreciated. 


datetime formating with string.format


I have a table in my SQL DB that is a DateTime table, what I want to do is take the numeric datetime it stores and convert it to a long date (i.e. 12/12/2012 conversts to December 12, 2012). Seaching the forums it looks like the string.format is the way to go and searching for info on that I found http://www.csharp-examples.net/string-format-datetime/ which lists all the different formats but they do not list a formating string to convert to the format I want to use. Does anyone know what format string I would use to convert a numeric date to a long date like I want? And can you show it in a code example because I am not 100% sure I understand the code examples shown on that site.

Formating Querystrings

On the SentItems.aspx
public enum Mode
   InboxPage = 1,
   DeletedPage = 2,
   SentPage =3

Protect void SentGrid_RowDataBound(object sender, GridViewRowEventArgs e)
   Gridview gv = (Gridview) sender;
   GridviewRow gvRow = e.Row;

   if(gvRow.RowIndex >= 0)
      string.Format("ViewMessage.aspx?Mode={0}", Mode.Sent);
      ///Other stuff

on the ViewMessage.aspx

// here's where I'm have trouble

private void GetMode(int messageMode)
   if(Request["mode"] != null)
       what is next thing to do???

How do I get my string??? 

Create validation formating


I want to create a sort of validation formatting (like regex).  It doesn't have to actual validate; just make it easier for the user to enter the correct number of character needed.  I want something like domain: [xxx].[xxx].[xxx] (so it only allows 9 numbers, 2 periods).

So for instance when the user moves to the field they would be presented with one field with ability to enter 3 numbers.3 numbers.3 numbers

Any Ideas?  Thanks,


How to input line breaks and formating in textbox with multilines ?


I have a web form in which anyone can fill out the information and i recieve the information.

<asp:TextBox ID="Body" runat="server" Columns="55" Height="101px" Rows="30" TextMode="MultiLine"

The problem is while entering the information in this text box, if anyone used enter line or different line or any kind of formatting, as a result i don't get the formatted page or with lines. I see only a paragraph which is very difficult to read and understand.

How to make my textbox compatible with all kind of formatting options so that even if someone paste information from word etc in the text box , i should get the formatter information just like the user pasted the information in the text box...

incorect date value and formating on display form


On the list display form i have start date field which shows date in the folloving format : 2010-07-06T22:00:00Z

First it shows the wrong date since in edit from i see 7/7/2001

secondly the format is wrong since i choosen date only field so i don't want to see time and zone.

Does anybody knows why this happens and how to fix it?

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