How to create sample data collection from my own class in expression blend 4? - silverlight-4.0

Can anyone help me? it seems no way to do this in blend 4

With Blend 4 open, go to Data tab.. hit the second icon from right("Create sample data").. select "Create sample data from class.." and select your class. This will generate sample data source. You can bind your controls to this data source to see the controls filled with sample in Blend designer. HTH.

The method I'm using now - although really less than perfect - is by creating a dummy class which contains a list of items of the original class. I.e.:
class We_Want_Items_Of {}
class Dummy_Class { List<We_Want_Items_Of> Test {get;set;}}
Then you can create a sample datum for the Dummy_Class, which will contain a list of We_Want_Items_Of's. You can then use that list as a data source for, for instance, a ListBox.

Related

How to create a range picker for a variable in Qlik?

I'm new to Qliksense and I would like to select and visualise all datapoints in my table based on the value of a variable called NoOfPersons, similar to the date-range picker. How can I do this? I have attached a sample image below:
Under the Custom Objects the Qlik Dashboard bundle select the variable input object
Then under the variable options select the slider option
I don't know how to make it look like your example but it will provide the functionality you want

How do I pre-select rows in a DataTable based on the value in a column?

Situation:
I have a pandas dataframe which I convert into an html table via df.to_html(). I then add the DataTables class to the table. This DataTables-table has the following columns:
ID | X | Y | Val |...More columns...| Selection_Criteria |...More columns...
The values in Selection_Criteria can be either 1 or 0. I know that with:
$('#ProductList').DataTable( {
...
"fnInitComplete": function(oSettings, json) { $('#ProductList tbody tr:eq(0)').click(); }
});
(Source: http://code.datatables.net/forums/discussion/38171/automatic-select-of-the-first-row-on-reload)
..it is theoretically possible to select the first row. (In reality, I have not been able to simulate a click for the first row.)
But my question goes more towards: How do I automatically pre-select ALL rows where the value is 1 in Selection_Criteria? What is the best approach? Should this be done client/server side?
In pandas the term "select"(ing) means to screen out that which was not selected for. I know that in a table on a web page, selected can mean being highlighted to stand out from the others. There are a couple of ways you can do this on the server side. You could display two tables, one for each state of Selection_Criteria. This would save you the hassle of trying to select individual rows out of a table in the first place (which would be done with Javascript, not Pandas). While pandas has the ability to add a class to the resulting html, the class is applied to the element.
If you are using jquery you are going to use these pieces. as you haven't put example data I can't be exact.
replace x in the next line with the number of columns the Selection_Criteria=1 is across the table
$( "tr td:nth-child(x):contains('1')" ).addClass('selected');
There are solutions on the backend using beautifulsoup and css selectors, or lxml.etree with xpath selectors. But jquery is going to be the most concise with this problem.
#Aliester. Thank you for the pointer!
This helped me find the solution to my own question. What I did:
1.) Identify row index that I want to select when the table loads.
2.) Pass the index to js.
3.) Loop over the indices and apply the following command to each index entry:
table.row(':eq('+hit_index_row+')').select();
So I am using the API to select each individual row. This works for me and hopefully could be helpful to others as well. It may be a bit hacky, so more elegant suggestions are welcome!
You can do this by providing a function for the "rowCallback" option when initializing the DataTable. https://datatables.net/reference/option/rowCallback
Also it is generally better to use the API methods to select rows instead of just changing the class. I found that the DataTable + Select libraries keep an internal collection of selected row indexes (just current page if serverside processing is on) instead of using the class to resolve selected items.
So while the display will look right, if you just change the class, if you rely on any of the API methods to get selected items later on there will be issues. Additionally just changing the class on the row will not fire any of the "select" events on the table so you can't rely on those either.

Reporting Services - aligning Layout direction Tablix dynamic

Deal All,
Is there a way to have same report show in both layout direction based on parameter?
I have two data set one for label and one for data based on specific parameter show the labels
needed and the data needed but i am unable to switch the lay out direction it keeps LTR.
I need if anyone have an idea to change the layout direction from parameter.
I am having 50 reports and i don't like to have 150 reports because i am having 3 language.
I don't need to change the design of reports if there a new adding columns or changing columns.
I did it in data base by sending paramater name of the report and then get the dataset for it and then use the parameter of language to get label and data.
thanks in advance
I dont know if this helps, because I have no experience with RTL, however if you select a TextBox and open the properties via F4, you can select for the text direction not only LTR or RTL but also an expression. Maybe this gives you the flexibility, you are looking for?
Please right click on the report and choose view code or press F7 and insert below code for the field:
<Style>
<FontFamily />
<TextAlign>Right</TextAlign>
</Style>
and
<Direction>RTL</Direction>

How to create dropdownlist with static and dynamic values in Asp.net MVC with a divider between them

I want to create a dropdownlist which have three static values: Select All, Text Only, Numeric only. After that I like to add a line with some padding (just to separate these options) and then add some dynamic options.
I am not sure how to do this, Can some body please help?
So far I have created a List<SelectListItem> in my view model, and populated the static values from BLL. But I am not sure how to add a divider line in the middle now, and append some dynamic options after that.
Thanks
The normal select tag will not work like that, you will have to create custom dropdown using spans or divs.
See some examples here:
http://tympanus.net/codrops/2012/10/04/custom-drop-down-list-styling/

Does mvc 4 application need another model to return aggregate data on an existing table and model

I have a table (and model) with the following properties in an asp.net MVC 4 application:
TV Table
height
width
depth
type
brand
cost
When the user answes a question about the space that they have for the TV I then do an ajax call to determine which types are possible to fit into the space they have specified. Which type of TV type they want is the following question, so some options may need to be disabled. The SQL for what types fit in the space is "select distinct type from TV where height < #height and width < #width and depth < #depth".
Should I:
1. create a new model that I call from the TV controller just to return the distinct types
2. add a method to the TV model that I call from the TV controller that just returns a list of string with the types that fit
Depends on what you want to display to the user based on her selection' e. g.
If you want to display TV name + its description then returning a list of TV model will make sense.
If you are just going to display a list of TV names in combo box, then returning a list of string will suffice.
Calling a new action make sense in both cases IMHO.
EDIT:
For 2 - I want to return a list of string - should I create a new data model for this, or add a method in the existing TV data model that returns a list of string?
To expand on above query, since its not clear (at least I do not visualize it) from your question i will assume few things.
Case 1: You are displaying a view say "TVSelection" to the user that does not contain list of TVModels. In this view you are expecting user to enter three values i.e. Width, Height, Depth. Now when user enter these values, she can submit the form or you can fetch the TV Brand name list on Lost Focus event as well. In any case, the question would be are you updating existing view by populating the combo box or you are displaying a new view. I am assuming you are updating existing "TVSelection" view by the means of making an AJAX call. In that case you can just call a method on your controller (which displayed the "TVSelection" view) that returns a list of TV Brand names.
Case 2: You are displaying "TVSelection" view that already has a list of TVModel objects and you update it dynamically on selection of required field (filtering). In this case you can add a method in the TVModel itself to filter names only that matches the user selection.
I found these links relevant 1 & 2.
Hope that make sense.
Please add more details to your question if this does not answer your question.