.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

Is it possible to not allow a listviewitem to not be selectable based on a state condition?

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :WPF
I have a listview that is binded to a collection. The listview contain items with different states and would like to know how to not allow an item with a specific state to not be selectable. Does anyone know how I can achieve that? I do know that I can add some kind of datatrigger, multitrigger in xaml but just don't know how to implement it. Any help is appreciated. Thanks in advance.

View Complete Post

More Related Resource Links

Execute SSIS Package PART based on Some Condition

Hello, Is it possible to execute part of the Package based some condition? (Like If var1 = true, then execute this block). If Yes, what control flow I should use. Please advse. I will have a Package Variable and if that variable is True then some part should execute. REst all should execute every time the package is called. Like if I will have "2 Sequence Container" in my control flow, the first one should execute every time, but 2nd one only if the variable value = True. Thanks, Prabhat

Receive/Delete Multiple FTP Files based on condition using SCRIPT(VB) TASK

I am trying to receive and delete multiple FTP files from a remote FTP server using Script task Below is the code   Dim FTPConnMgr As ConnectionManager FTPConnMgr = Dts.Connections("FTP Connection Manager") Dim FTPClientConn As FtpClientConnection = New FtpClientConnection(FTPConnMgr.AcquireConnection(Nothing)) Dim FileTimeStampNew As String = "20100913021807" Dim remoteFileNames(0) As String remoteFileNames(0) = Dts.Variables("FtpRemoteDirectory").Value & "*" & FileTimeStampNew & ".*" 'Below hardcoded FileName works good. But the problem is there are lots of file in the FTP folder that I dont want to receive 'remoteFileNames(0) = Dts.Variables("FtpRemoteDirectory").Value & "Company_alpha_Full_20100913021807.xml" Dim localPath As String = Dts.Variables("FtpLocalDirectory").Value FTPClientConn.Connect() FTPClientConn.ReceiveFiles(remoteFileNames, localPath, False, False) FTPClientConn.Close() Dts.TaskResult = ScriptResults.Success End Sub End Class If i specifically mention the RemotefileNames this works fine but, when I say *.* it executes succefully but doesn't receives the file. Please advice how to receive multiple file based on a variable BR, AWM

select distinct best row based on a condition

Hi all . The application I'm working on only allowed that one user had one usergroup. I create a User_UserGroup table to allow a user to have n usergroups. My problem now is the following: User 'ablanco' belongs to UserGroup 'comercial' and 'financeira' If i execute this commands i get the following results: SELECT * FROM [T_APP_ModulePermition] WHERE [UserGroup] = 'comercial' http://img26.imageshack.us/i/49234843.png ----------------------------------------------------------------------------------- SELECT * FROM [T_APP_ModulePermition] WHERE [UserGroup] = 'financeira' http://img259.imageshack.us/i/32526938.png ----------------------------------------------------------------------------------- I now need to get distinct rows that belong to ablanco's Usergroups but if on one group the module is Enable=0 and on the other the same module is Enable=1 it should return the ont that has Enable = 1 The attempt i made without taking in consideration this 'Enable' part was the following: SELECT MP.* FROM [T_APP_ModulePermition] MP     INNER JOIN T_APP_UserGroup_Detail UGD ON MP.UserGroup=UGD.UserGroup     INNER JOIN T_APP_User U ON UGD.UserId = U.UserId WHERE U.UserId='ablanco' But since i cant use DISTINCT.* i get all the 14 rows. If someone can help me on this i would be thankful.

Creating a workflow condition based on document type

Hello! I'm creating a workflow for a Document Library. I only want the action in the workflow to be executed on the condition that the document is of a certain document type. Any suggestions how I should do that? Thanks!

Excel 2007 Cubeset function - Retrieve subset of customers based on state


I am working on making a report dynamic by allowing a user to choose a State and have the cubeset function return that State's customers.

I have the following

Cell $P$5 =CUBESET("Connection", "[Order Ship to Code].[Order Ship To State].[All Order Ship to Geography].children", "Ship to State")

Cell P6-P32 = CUBERANKEDMEMBER("Connection",$P$5, ROW(A1*))           *A2, A3, etc.

Cell $A$2 = "CA" ("CA" is choosen in the list of states based on a validation list pointing to the CubeRankedMembers in P6-P32)

=CUBESET("Connection", "[Customer Dimension].[Customer Name].[All Customer Dimension].children", "Customers") returns all customers

I have not been able to write a CubeSet function that combines the two sets to retrieve, for example, California Customers

This two functions I have written that are not working correctly...

=CUBESET("Connection", "([Order Ship to Code].[Order Ship To State].[All Order Ship to Geography].["&$A$2&"],[Customer Dimension].[Customer Name].[All Customer Dimension].children)", A$2&" Customers")

=CUBESET("Connection","[Order Ship to Code].[Order Ship To State].[All Order Ship to Geogra

How can we insert csv file data into Sql server table based on some condition ?


Hello All experts there,


I need to insert some csv file data into sql server 2008. but there are multiple tables created in sql server and I need to check some conditions before data insertion and based on the condition value, sql script should insert the data in to specific table. in other words I need to insert data from one csv file to different tables based on some condition.

is it possible? if yes then can anyone please give me an idea on how can we do that?


Thanks in advance


Nipendra Garg

How to create a condition and policy to deny access based on host name



With SQL Server 2008 Enterprise, can I prevent an Active Directory Account Login ( domain\user ) from connecting if its coming from a host_name?

What I really need to do is this:  


On SQL1, login mydomain\user1 is only allowed to login from servers APP2, APP3, and APP4.


If mydomain\user1, though it has a login on SQL1 attempts to connection any other hostname besides APP2, APP3 or APP4 I want to deny it access to SQL1.


Can anyone point me in the right direction for the correct condition(s) for a policy that would work?



Erik A. Grob, MCITP, MCDBA

SQL searches based on user selectable fields


This is the second time I've searched on this and came up not fully understanding why this isn't possible. Say you have one text box, but you want to be able for a user to search by "company name,"  "job number," or "Order No," So you put one text box and a drop down list where the user can select what field to search.

Here is what I would like to do  Select [order_no], [job_no], [company_name] From [order_tbl] WHERE @var1 Like '*@var2*'  (maybe not totally correct syntax, but you get the picture....and @var1 is set from the selection of the dropdownlist and @var2 is set from the text box).

What I do now is three separate SQL statements. If DropDownlist1.SelectedValue = 1 then do, if it = 2 then do, etc.

But when you have a large select statement with table joins, you have to make any changes three times, and it seems easy to make a mistake...not to mention if you have more than three choices, you have an SQL statement for each choice.

Am I misunderstanding that it isn't possible to do a variable field name so I can have one select statement to work with?  And if it isn't possible, I just wish I could wrap my head around why, because it seems such a simple thing to do.


How to retrive Data from SharePoint List to Data Grid View in Visual WebParts based on the Condition

Hi Friends... 
Here i write this Code for Retrieving Data Form SharePoint List to Data Grid view (st_attendance) in Visual Web parts....  But it doesn't work Properly....

SPWeb web = SPContext.Current.Web;
            SPList list = web.Lists["Student Profile"];
                string caml = string.Format(@"<Where><Eq><FieldRef Name='Academic Year' /><Value Type='Text'>{0}</Value></Eq></Where>",DropDownList2.Text );
                SPQuery query = new SPQuery(list.DefaultView);
                query.Query = caml;
                SPListItemCollection items = list.GetItems(query);
                st_attendence.DataSource = items;
                Controls.Add(st_attendence );

How to retrive Data from SharePoint List to Data Grid View in Visual WebParts based on the Condition

Hello Friends,

I am Srinivas, I want to know the How to retrive the Data from SharePoint List to Data Grid View in Visual WebParts based on the Condition.

Example: I want to retrive Students information from Lists to Grid View based on the Condition(based on 'Academic year' or 'Class' and 'Section'). In Student Status Page Grid view should be show the Student Details in their Status.

please any body help me



How to retrive Data from SharePoint List to Data Grid View in Visual WebParts based on the Condition


Hello Friends,

     I am Ali, I want to know How to retrive the Data from SharePoint List to Data Grid View in Visual WebParts based on the Condition.

Example: I want to retrive Students information from Lists to Grid View based on the Condition(based on 'Academic year' or 'Class' and 'Section').         In Student Status Page Grid view should be show the Student Details in their Status.

please any body help me



SQL Statement that returns result set based Max or Min Condition


I would like to return a result set that has mutliple rows containing Date and Time stamps and a value but I only want the record set returned if one of the records has a Minimum value in it of 50.  How would this be constructed so all the rows are returned and not just the Value=50 row?  I know GroupBy is probably used but am a sql novice.


Hide a calculated member output based on condition


Hello:  New to SSAS.   Is it easy to alter this caluculated MDX to HIDE or not make visibile the output(Average_Response) if Respondents are < 10? 

However, I only want to Hide the value.   It still needs to be used for aggregate calculations.

Thank you!

CREATE MEMBER CURRENTCUBE.[Measures].Average_Response


AS [Measures].[ResponseGiven]/[Measures].[Respondents],


removing validation based on condition in INFOPATH



i am having 2 controls, one is dropdown with values:-Monthly,Weekly,Quaterly,Not Applicable

second control is RichTextBox,this 2 controls are mandatory fields but when dropdown value is "Not Applicable" RichTextbox must not be Mandatory


Send Mail based on data count condition


Hi, I have question regarding send mail task in SSIS.

I am trying to have SSIS to send alert email based on number product customer purchase, and I am not sure if this is possible with SSIS.

Our department managers wants to get alerted on items customer purchase, and if certain item sold more than 150 times (throughout whole time), they want to get alerted via email with item information (Item number and name). 

Initially, I was going to just send email report on items with 150 transaction or more but problem is managers want alert, not report. They only want to get alerted when item pass 150 transaction. Once transaction goes over 150 times, they don't want to get alerted again and again for same time.

This is what I did so far and stuck...

1. Populate table with Item Number, Item Name and Sold Qty - Since I only have read-only access to transaction database, I created SSIS data flow package to dump all item transaction information to other database.  I also created a tabl

Truly Understanding View State

This article provides a detailed understanding of the ViewState.

5 GridView Themes Based on Google's Personalized Homepage (igoogle)

One of the silly features I have found that I like about igoogle is how the pages color palette changes depending upon the time of day. So as the day progresses from morning to afternoon to evening the colors on the page change as well. Like I said, I know this is a silly feature, but I like it. And I have asked around a little bit and seems like other people like it to. To get a better idea of how the colors change, here are the background images from a few of the HTML elements.
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