How to find if all items in a list containing the selected color
Hi
I'm using the code below to check what color the user has selected. This is only working when my item got one color. Now I would like to change my code so each item can have one or more colors (seperated by semicolon). I guess
I have to use string.IndexOf but I don't know how to use it in the .Where scentence below to return all the items that got the selected color.
Thanks, Sigurd F
var sampleDataGroups = await SampleDataSource.GetGroupsAsync();
sampleDataGroups = sampleDataGroups.Where<SampleDataGroup>(Item => Item.Color == KeywordColorList.SelectedValue.ToString()).ToList();
If the Color property of the SampleDataGroup class contains a string with different colours separated by a semicolon you could use the following code to determine whether the KeywordColorList.SelectedValue property is amont these colours:
var sampleDataGroups = await SampleDataSource.GetGroupsAsync();
sampleDataGroups = sampleDataGroups.Where<SampleDataGroup>(Item => Item.Color.Split(';').Contains(KeywordColorList.SelectedValue.ToString())).ToList();
Compilable sample code:
var sampleDataGroups = new List<SampleDataGroup>
new SampleDataGroup { Color = "blue"},
new SampleDataGroup { Color = "blue;red;green"},
new SampleDataGroup { Color = "red;green"},
string selectedValue = "blue";
sampleDataGroups = sampleDataGroups.Where<SampleDataGroup>(Item => Item.Color.Split(';').Contains(selectedValue)).ToList();
Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.
Similar Messages
-
Hi Team,
I Have one requirement,In SSRS Reporsitory 3000 reports are available.
My end user requirement All 3000 reports are used Table names & columns list of each wise to display single table or single result set.
I find out all 3000 reports details are diplayed single results set like
Report Id,Path,Dataset,Source Query Text,Datasource
In Source Query Text column level All reports Queries are available but I want Each Report wise Table name & columns List.If any solution Please share me.
Regards
RamaHi Ramakoteswara,
According your description, you want to show used tables and columns of each report, and display is into a single result set. Right?
In this scenario, we don't know where to find a column contains the Source Query Text. With my understanding, in Reporting Services, we have Catalog table in ReportServer DataBase, it has a column called Content stores the report code (.xml). In the
code we can find the Query and Fields. Then you need to use VB/C# code to parse each .xml code of each report and fetch out the table name and columns. We do not support writing any queries against SSRS DataBase or parsing data records in any
table.
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
How to trigger a refresh of a dropdown list when the selection is changed
Hi,
This is a general ExtendScript question, but since I'm working with FM, I'll ask here first. I have a bit of a paradox here and I'm not sure of the best way to handle it.
I have a dialog box with a dropdown list, where I want to refresh certain controls when the user changes the selection in the list (dropdownList.onChange). This includes refreshing the contents of the list itself. However, the problem is, as soon as I try to refresh the list contents, it triggers onChange again. So, if I put the call to refresh the box within the onChange handler, it results in an endless loop, because my refresher function triggers onChange when it refreshes the list.
Does anyone know a better methodology, where I can safely trigger a refresh of a dropdown list within the list's own onChange event handler? I really wish that onChange was reserved for a user action only, or there was at least some property to that effect.
RussHi Russ,
you can stop that with "stopPropagation()"
You can find this in "Javascript Tools Guide" on page 150.
I'm not able at the moment to send you an example 'cause I'm in a hospital for a while.
Happy New Year! -
How to find which all instances are not listed in groups?
Hi
We have 68 servers, 150 instances are there. I need to write a query to fetch from OEM repository, all the instances group by GROUP NAME.
If any one knows how to get this information, which views/tables of sysman we need to touch please let me know ....
Thanks in advance.
RKSELECT group_name,targeT_name FROM MGMT$GROUP_MEMBERS WHERE target_type='oracle_database'
ORDER BY group_name
SELECT group_name,SUM(1) FROM mgmt$group_members WHERE target_type='oracle_database'
GROUP BY group_name -
how to find invoice open item.
Hi,
You can get the open items from BSIS.
To get the details of open items you need to do as below :
1. Get all the document numbers from BSIS table based on year(GJAHR) and period (MONAT).
2. Once you get all the open items from BSIS, go to BSAS with the document number retreived from BSIS.
Now you will have two internal tables, one with open items and one with closed items. Now you need to segregate the open items and closed items from BSIS.
loop at it_bsis.
read table it_bsas with key bukrs = it_bsis-bukrs
hkont = it_bsis-hkont
gjhar = it_bsis-gjahr
monat = it_bsis-monat.
if sy-subrc eq 0.
delete it_bsis.
clear it_bsis.
endif.
endloop.
Now you are left with only open item only.
Thanks,
Sriram Ponna. -
How to find out all user exits edited
Hi All,
Would you know how to find out all user exits have been ever edited?
Can we find out those user exit by some tcode or table?
Thank you very much
Best Regards,
Calvin
Edited by: Sam Sum on Mar 2, 2009 5:09 AMHi,
Just try this in your system.
Go to SE38 and give ZX* and press F4.
Have a look at table MODATTR to find the active projects in your system.
Regards
Edited by: Rajvansh Ravi on Mar 2, 2009 5:17 AM -
How to Find what all GL assigned to Particular account group ???
Hi !!! anybody can help me in this issue ... How to Find what all GL assigned to Particular account group ???
Hi,
Go to SE16
Give table name SKA1.
Give COA
Give account group and execute.
All the GL accounts that were assigned to this group are listed.
Reward points.
Sarma -
How to find and modify item in a nested array collection?
Hi,
would anybody know how to find and modify item in a nested
array collection:
private var ac:ArrayCollection = new ArrayCollection([
{id:1,name:"A",children:[{id:4,name:"AA",children:[{id:8,name:"AAA"}]},{id:5,name:"AB"}]} ,
{id:2,name:"B",children:[{id:6,name:"BA"},{id:7,name:"BB"}]},
{id:3,name:"C"}
Let's say I've got object {id:8, name:"X"} , how could I find
item in a collection with the correspoding id property, get handle
on it and update the name property of that object?
I'm trying to use this as a dataprovider for a tree populated
via CF and remoting....
Thanks a lot for help!Thanks a lot for your help!
In the meantime I've come up with a recursive version of the
code.
This works and replaces the item on any level deep:
private function findInAC(ac:ArrayCollection):void{
var iMatchValue:uint=8;
for(var i:uint=0; i<ac.length; i++){
if(ac
.id == iMatchValue){
ac.name = "NEW NAME";
break;
if(ac
.children !=undefined){
findInAC( new ArrayCollection(ac.children));
However, if I use the array collection as a dataprovider for
a tree and change it, the tree doesn't update, unless I collapse
and reopen it.
Any ideas how to fix it ? -
after several years of taking photos(thousands) I seem to have many duplicate photos in iPhoto. How do find them all without going through 10,000 photos? they are mostly scanned photos that I have reused over the years not ones that I have recently uploaded from my camera.
Thanks whoever can helpWhere are you seeing these duplicates? In the iPhoto window or in the Finder?
OT -
How to find out all active instances in a syste
How to find out all active instances in a system
Go to your basis team and ask them, as far as i know there is no other way then suggested in the other answer, but that is not a complete picture, And that is as designed, why should one want to be able to find out, the basis consultant will tell you!
-
How can I delete all items on the "Done" list in Reminer-App? There are meanwhile hundreds of items (shopping, appoitments, ...) and I don't want to spend hours deleting them.
You can't remove the built-in root certificates, but you can remove their trust bits via the Edit button to prevent Firefox from using them as a trusted root certificate.
Intermediate certificates that Firefox has stored when visiting websites that show as "Software Security Device" should never has trust bits set.
Note that it is the responsibility of a server to send all required intermediate certificates to make it possible to build a certificate chain that ends with a built-in root certificate. -
I purchased an iPad air and chose a backup from my iPhone 5s. The only issue is only 30 of my photos downloaded to my iPad and none of the music. How can I get all items on the iPad?
you are using I tunes as the middle man for this back up, right?
When you plug in the pad to i tunes, give it a unique name, like my pad. I tune may be thinking it is talking to your phone. It will keep track of what you what on each device. Then plug your phone back in, and make sure your photos are uploaded to the computer - in i photo if you are using a mac, or in whatever photo program you are using on a windows device. You also want to make sure you have uploaded to the computer all of your music.
Once you get all that stuff there, plug the pad back in, and go through each of the tabs - selecting the music, photos etal that you want on the pad, then resync. -
How to sum all items in a list in applescript?
Hey guys,
I wanted to sum all items of a list full of numbers and divide the number by the count all items of a list, is there a easy way to do this?
Thank you so much in advanceYou didn't say which is the source of the list.
Assuming that the list isn't extractyed from a Numbers table Niel's answer is OK.
If you installed the free OSAX Satimage
http://www.satimage.fr/software/en/downloads/downloads_companion_osaxen.html
you may study its arrays functions.
For this tool, a list is a simple array so you may apply the function statsrecord
Yvan KOENIG (VALLAURIS, France) samedi 4 février 2012
iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
My Box account is : http://www.box.com/s/00qnssoyeq2xvc22ra4k -
Retrieve all items in a list by caml query then write it to a word file page by page
Dears,
Greetings
I have some code which will retrieve all items of a list with caml query.
Now i want to generate a word file with all these retrieved data. I am using foreach here to get all the items in a SPListItemCollection. Now my question is how i can write all the retrieved items inside the word file?
see the below code which is writing only the last row item of the SPListItemCollection inside word file. I want to write all the retrieved rows inside this word file.
SPQuery qry = new SPQuery();
qry.Query = "<Where><Eq><FieldRef Name='Department' /><Value Type='Text'>HR DEPARTMENT</Value></Eq></Where>";
SPListItemCollection listItems = KPILIst.GetItems(qry);
foreach (SPListItem item in listItems)
lblBadgeNo.Text = item["Badge No"].ToString();
lblName.Text = item["Name"].ToString();
lblPosition.Text = item["Position"].ToString();
lblDept.Text = item["Department"].ToString();
lblHireDate.Text = item["Hire Date"].ToString();
lblGrade.Text = item["Grade"].ToString();
lblCurStatus.Text = item["Status"].ToString();
string FinalOut = "";
FinalOut = "<table cellpadding=0 cellspacing=0><tr><td style='height:30px;'></td></tr><tr><td style='height:22px;'></td></tr>";
FinalOut = FinalOut + "<tr><td style='text-align:justify;font-size:22px;'>" + lblBadgeNo.Text + "</td></tr>";
FinalOut = FinalOut + "<tr><td style='text-align:justify;font-size:22px;'>" + lblName.Text + "</td></tr>";
FinalOut = FinalOut + "<tr><td style='text-align:justify;font-size:22px;'>" + lblDept.Text + "</td></tr>";
FinalOut = FinalOut + "<tr><td style='text-align:justify;font-size:22px;'>" + lblHireDate.Text + "</td></tr>";
FinalOut = FinalOut + "</table>";
System.Text.StringBuilder strBody = new System.Text.StringBuilder("");
strBody.Append("<html " + "xmlns:o='urn:schemas-microsoft-com:office:office' " + "xmlns:w='urn:schemas-microsoft-com:office:word'" + "xmlns='http://www.w3.org/TR/REC-html40'>" + "<head><title>EPCCO : HR Comapny Letter</title>");
strBody.Append("<!--[if gte mso 9]>" + "<xml>" + "<w:WordDocument>" + "<w:View>Print</w:View>" + "<w:Zoom>90</w:Zoom>" + "<w:DoNotOptimizeForBrowser/>" + "</w:WordDocument>" + "</xml>" + "<![endif]-->");
strBody.Append("<style>" + "<!-- /* Style Definitions */" + "@page Section1" + " {size:8.5in 11.0in; " + " margin:1.0in 1.25in 1.0in 1.25in ; " + " mso-header-margin:.5in; " + " mso-footer-margin:.5in; mso-paper-source:0;}" + " div.Section1" + " {page:Section1;}" + "-->" + "</style></head>");
strBody.Append("<body dir=rtl lang=EN-US style='tab-interval:.15in'>" + "<div class=Section1>" + FinalOut.ToString() + "</div></body></html>");
Response.AppendHeader("Content-Type", "application/msword");
Response.AppendHeader("Content-disposition", "attachment; filename=Eval_" + lblBadgeNo.Text + ".doc");
Response.Write(strBody);
Regards
Shaji
I am new to SharePointHello,
you can try with OpenXML SDK to create word file. I found one link for your reference:
http://sharepointplace.blogspot.in/2009/12/programmatically-creating-word.html
Another way is , use Microsoft Word Object Library.
http://social.msdn.microsoft.com/Forums/vstudio/en-US/5b82c0b5-ecaf-40f2-a68a-c7c17c85414f/create-word-documents-by-c?forum=csharpgeneral
Hope it could help
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
Programmatically select all items in a list
Hi, I've been looking through the online docs trying to find
a way to programmatically select all items in a list. I have a
checkbox that when checked should select all items in a list. I
found a method to clear all selections but not one to select all.
Did I just miss it? Thanks!I don't know of any built-in functions to select all list
items, but here is an example function to select all items in a
list:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
xmlns="*" layout="absolute">
<mx:Script>
<![CDATA[
[Bindable] private var people_xml:XML =
<people>
<person>Jen</person>
<person>Brian</person>
<person>Scot</person>
</people>;
private function select_all():void {
var indices:Array = new Array();
for (var i:uint = 0; i<people_xml.children().length();
i++) {
indices.push(i);
peopleList.selectedIndices = indices;
]]>
</mx:Script>
<mx:Button x="125" y="10" label="Select All"
click="select_all()"/>
<mx:List x="10" y="10" allowMultipleSelection="true"
dataProvider="{people_xml.person}" id="peopleList"
labelField="person" width="107"></mx:List>
</mx:Application>
Vygo
Maybe you are looking for
-
Just Downloaded the New Version and Cannot Move it to the Applications Folder from the Desktop
I have just downloaded the latest version of firefox to my iMac running on OS 10.5.8. The download comes in, but pops up on my desktop and when I go to move it to the applications folder - all that will move is an alias - the application remains on m
-
Use hardware to generate a certain number of pulses using PXI-5652
Is it possible to generate a certain number of periods (turn on the output for a predetermined amount of time using hardware with micro-second resolution) using the PXI-5652.
-
I need to filter the Service Id
Hi All, Here with i copied one query that returns some resultset based on Organise Id. But I need only one service id. Pls suggest me... SELECT DISTINCT(A.SERVICE_ID), B.SERVICE_CODING_ID, C.RGS_ID, D.CODED_TIME_REF_DOMAIN_ID, E.ORGANISE_ID, F.RESOUR
-
Download_package can't be opened because Identity of developer cannot be confirmed
this is what i get when I try to download photoshop elements 12 on my mac whats the problem.
-
Music "not found" when trying to sync - New Iphone User
I just bought an Iphone and I'm trying to sync music from my computer. Half of my library is "not found" and not syncing. Any help would be appreciated. Thanks D