Hi,
In VS2010 how do I add a whole directory of existing items?
When I right click on project and Add ExistingItem I seem to be able to load only one file at a time?
I have being using jquery autocomplete. By default it is showing 10 items in the dropdown, i want to increase its number to 20 or customise it according to requirement. i have tried many ways of cache length but none of them is working. pls suggest a way.
I am using VS 2010 and SL 4.And I came up with strange behaviour of the listbox that it don't have keyboard navigation(the one which is present in wpf :( ).So is there a way or any idea or suggestion how can i do it.. I know the long way thats shown up here ,
link text
But anything simpler then this or shortes then this will be nice.. :)
Pressing up/down keys will navigate through items present in the silverlight listbox
How can I add shortcut keys to my menu items. I notice that many applications have:
New ctrl+N
Open ctrl+O
Do I write the endings (like ctrl+N) myself and handle WM_KEYDOWN or is there a magical way to do it with resources?
Thanks
I have a column called "menu_order" which has no default value. When I select the contents of this column using the following select statement:
SELECT * FROM categories ORDER BY menu_order ASC
It lists the category items that have nothing as their menu order first and then the one's that have 1's and 2's and 3's. Is there any way to prevent SQL from take nothing to come before numbers when I am trying to list things in order?
So for example, if I have:
cat_name | menu_order
----------------------
Lunch | 1
Dinner |
And I perform my query, the output should be:
Lunch Dinner
Not:
Dinner Lunch
I'm trying to see if a particular item in a checkedlistbox is checked or not.
I assumed referencing the item would be:
var checkBox = CheckBoxCheckedListBox1.Items[0];
But that returns an object. Casting to a CheckBox throws an exeption.
Thanks!
I have a list of items sorted alphabetically:
list = [a,b,c,d,e,f,g,h,i,j]
I'm able to output the list in an html table horizonally like so:
| a , b , c , d |
| e , f , g , h |
| i , j , , |
What's the algorithm to create the table vertically like this:
| a , d , g , j |
| b , e , h , |
| c , f , i , |
I'm using python, but your answer can be in any language or even pseudocode.
Thanks
Hi,
Can any body provide me sample code or sample applications to retrieve list of items and list of objects from web service and to parse it.
Thanks in advance
Regards,
Malleswar
Hi all
I am invoking camera from my application. i want to remove few menu items that is provided by the camera application. how to do that.
Thanks alot
Is there a simple way to invert a WPF GridView so that items are bound to columns instead of rows? Or would it be necessary to write a custom view mode?
I am trying to use checkboxes to select the items in a Listview. I have added a checkbox control in the , and they are displayed properly.
The problem is that Checked property never changes when I click on them. Why does this happen? And is there a workaround?
hi,
I'm using a Repeater object in Flex. Would be possible to stop the repeater after 50 iterations.. even if my dataProvider is bigger ?
I want to display only the first 50 items. I'm using MXML to implement the repeater.
thanks
In CSharp its as simple as writting :
listBox1.Items.Add("Hello");
listBox1.Items.Add("There");
foreach (string item in listBox1.Items )
{
MessageBox.Show(item.ToString());
}
and i can easily add different objects to a list box and then retrieve them using foreach.
I tried the same approach in Qt 4.8.2 but it seems they are different.though they look very similar at first.I found that Qt supports foreach so i went on and tried
something like :
foreach(QListWidgetItem& item,ui->listWidget->items())
{
item.setTextColor(QColor::blue());
}
which failed clearly.It says the items() needs a parameter which confuses me.I am trying to iterate through the ListBox itself, so what does this mean?
I tried passing the ListBox object as the parameter itself this again failed too:
foreach(QListWidgetItem& item,ui->listWidget->items(ui->listWidget))
{
item.setTextColor(QColor::blue());
}
So here are my questions:
How can I iterate through a QListWidget items in Qt?
Can i store objects as items in QListWidgets like C#?
How can i convert an object in QListWidgets to string(C#s ToString counter part in Qt) ?
(suppose i want to use a QMessagBox instead of that setTextColor and want to print out all string items in the QlistWidget.)
So I have a custom ListView object. The list items have two textviews stacked on top of each other, plus a horizontal progress bar that I want to remain hidden until I actually do something. To the far right is a checkbox that I only want to display when the user needs to download updates to their database(s). When I disable the checkbox by setting the visibility to Visibility.GONE, I am able to click on the list items. When the checkbox is visible, I am unable to click on anything in the list except the checkboxes. I've done some searching but haven't found anything relevant to my current situation. I found this question but I'm using an overridden ArrayAdapter since I'm using ArrayLists to contain the list of databases internally. Do I just need to get the LinearLayout view and add an onClickListener like Tom did? I'm not sure.
Here's the listview row layout XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:padding="6dip">
<LinearLayout
android:orientation="vertical"
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="fill_parent">
<TextView
android:id="@+id/UpdateNameText"
android:layout_width="wrap_content"
android:layout_height="0dip"
android:layout_weight="1"
android:textSize="18sp"
android:gravity="center_vertical"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1"
android:id="@+id/UpdateStatusText"
android:singleLine="true"
android:ellipsize="marquee"
/>
<ProgressBar android:id="@+id/UpdateProgress"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:indeterminateOnly="false"
android:progressDrawable="@android:drawable/progress_horizontal"
android:indeterminateDrawable="@android:drawable/progress_indeterminate_horizontal"
android:minHeight="10dip"
android:maxHeight="10dip"
/>
</LinearLayout>
<CheckBox android:text=""
android:id="@+id/UpdateCheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
And here's the class that extends the ListActivity. Obviously it's still in development so forgive the things that are missing or might be left laying around:
import java.util.List;
import android.app.ListActivity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.xxxx.android.R;
import com.xxxx.android.DAO.AccountManager;
import com.xxxx.android.model.UpdateItem;
public class UpdateActivity extends ListActivity {
AccountManager lookupDb;
boolean allSelected;
UpdateListAdapter list;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
lookupDb = new AccountManager(this);
lookupDb.loadUpdates();
setContentView(R.layout.update);
allSelected = false;
list = new UpdateListAdapter(this, R.layout.update_row, lookupDb.getUpdateItems());
setListAdapter(list);
I've see this question asked a couple of other times, and I followed this after I tried things on my own with the MS music store demo to no avail, but I still can't get this to work. I've also noticed when I look at my MultiSelectList object in the viewmodel, it has the correct items in the selected items property, but if I expand the results view, it doesn't have any listboxitem with the selected value. What am I missing here? I feel like I'm taking crazy pills! Thanks in advance.
model:
public class Article
{
public int ArticleID { get; set; }
public DateTime? DatePurchased { get; set; }
public DateTime? LastWorn { get; set; }
public string ThumbnailImg { get; set; }
public string LargeImg { get; set; }
public virtual List<Outfit> Outfits { get; set; }
public virtual List<Tag> Tags { get; set; }
}
viewmodel:
public class ArticleViewModel
{
public int ArticleID { get; set; }
public List<Tag> Tags { get; set; }
public MultiSelectList mslTags { get; set; }
public virtual Article Article { get; set; }
public ArticleViewModel(int ArticleID)
{
using (ctContext db = new ctContext())
{
this.Article = db.Articles.Find(ArticleID);
this.Tags = db.Tags.ToList();
this.mslTags = new MultiSelectList(this.Tags, "TagID", "Name", this.Article.Tags);
}
}
}
controller:
public ActionResult Index()
{
ArticleIndexViewModel vm = new ArticleIndexViewModel(db);
return View(vm);
}
view:
@model ClosetTracker.ArticleViewModel
@using (Html.BeginForm())
{
<img id="bigImg" src="@Model.Article.ThumbnailImg" alt="img" />
@Html.HiddenFor(m => m.ArticleID);
@Html.LabelFor(m => m.Article.Tags)
@* @Html.ListBoxFor(m => m.Article.Tags, Model.Tags.Select(t => new SelectListItem { Text = t.Name, Value = t.TagID.ToString() }), new { Multiple = "multiple" })
*@
@Html.ListBoxFor(m => m.Article.Tags, Model.mslTags);
@Html.LabelFor(m => m.Article.LastWorn)
@Html.TextBoxFor(m => m.Article.LastWorn, new { @class = "datepicker" })
@Html.LabelFor(m => m.Article.DatePurchased)
@Html.TextBoxFor(m => m.Article.DatePurchased, new { @class = "datepicker" })
<p>
<input type="submit" value="Save" />
</p>
}
EDITED
Ok, I changed around the constructor of the MultiSelectList to have a list of TagID in the selected value arg instead of a list of Tag objects. This shows the correct tags as selected in the results view when I watch the mslTags object in debug mode. However, it still isn't rendering correctly to the page.
public class ArticleViewModel
{
public int ArticleID { get; set; }
public List<Tag> Tags { get; set; }
public MultiSelectList mslTags { get; set; }
public virtual Article Article { get; set; }
public ArticleViewModel(int ArticleID)
{
using (ctContext db = new ctContext())
{
this.Article = db.Articles.Find(ArticleID);
this.Tags = db.Tags.ToList();
this.mslTags = new MultiSelectList(this.Tags, "TagID", "Name", this.Article.Tags.Select(t => t.TagID).ToList());
}
}
}
Hi everyone,
I have some problems with sizing row's height in QTreeWidget. I use QStyledItemDelegate with QPlainTextEdit. During editing text in QPlainTextEdit i check for changes with a help of:
rect = self.blockBoundingRect(self.firstVisibleBlock())
and if text it's height changes i need row in QTreeWidget also resizing. But i don't know how to inform TreeWidget or a Delegate about changes, i even tried to initialize editor with index, that i could use in a future, but it suddenly changes:
class MyEditor(QPlainTextEdit):
def __init__(self, index = None, parent=None):
super(MyEditor, self).__init__(parent)
self.index = index
self.connect(self, SIGNAL("textChanged()"), self.setHeight)
def setHeight(self):
if self.index:
rect = self.blockBoundingRect(self.firstVisibleBlock())
self.resize(rect.width(), rect.height())
self.emit(SIGNAL("set_height"), QSize(rect.width(), rect.height()), self.index)
How can i bound editor's size changes with TreeWidget?
And one more thing, by default all items (cells) in TreeWidget have -1 or some big value as default width. I need whole text in cell to be visible, so how can i limit it only by visible range and expand it in height?
Thank you in advance,
Serge
I have a schedule table I'm using jQuiry Sortable for editing.
Each day is a UL, and each event is an LI.
My jQuery is:
$("#colSun, #colMon, #colTue, #colWed, #colThu").sortable({
connectWith: '.timePieces',
items: 'li:not(.lith)'
}).disableSelection();
To make all LI's sortable except those with class "lith" (day names).
User can drag an event from day to day, or add new events by clicking a button, which appends a new dragable event (LI) to the fist UL (Sunday).
I want to make each day accept only up to 10 events.
How do I do this?
Thanks in advance!
I have been trying to use nanoc for generating a static website. I need to organize a complex arrangement pages I want to keep my content DRY.
How does the concept of includes or merges work within the nanoc system? I have read the docs but I can't seem to find what I want.
For example: how can I take two partial content items and merge them together into a new content item.
In staticmatic you can do some like the following inside your page.
= partial('partials/shared/navigation')
How would a similar convention work within nanoc?
I have a ListView that is sandwiched between two buttons. The entire screen is in a ScrollView
<Button
android:text="Take a Picture"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/btnPicture"
android:layout_marginRight="3dp"
android:layout_marginLeft="3dp"
android:layout_marginTop="5dp"
android:textSize="25dp"/>
<ListView
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/lstPhotos"
android:visibility="gone" />
<Button
android:text="Location Type"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/btnLocationType"
android:layout_marginRight="3dp"
android:layout_marginLeft="3dp"
android:layout_marginTop="5dp"
android:textSize="25dp" />
As I add items to the listview in code, how can I get the listview to take up enough space to be visible. It does expand to show 1 item but after I add the second item it doesn't expand any more.
You can see here after I added a second picture row to the listview, it's not visible.
I'm developing a site that requires some duplication of links within the menu:
Section A
-- Introduction
-- Testimonials
Section B
-- Introduction
-- Testimonials
Testimonials
-- Section A
-- Section B
So 'Section A Testimonials' and 'Testimonials Section A' point to the same node. But regardless of which menu link people use, I want the person to be in Section A.
The problem is that D6 doesn't like duplicate menu items, and it assigns the active and active-trail classes rather unpredictably.
So my thought was to create a placeholder node for each item in the Testimonials menu, and then set the URL to something like "testimonials/redirect/section-a", and then use mod_rewrite to redirect over to "section-a/testimonials".
With this solution, I will have no duplicate paths in the menu. I'm just hoping this doesn't somehow hurt my SEO.
Does anyone know a better solution?
Hello, I have a problem with sorting items in table in PHP. Here is what I want to achieve :
Item Item Item
Item Item Item
Item Item Item
Item Item Item
Item Item Item
How I mean to achieve this, well since I have a for each loop I can insert counter, and say after 5th item is listed write to another column, the thing is I'm not good with tables, I've tried something like :
for(...)
$counter++;
if(($counter%5) == 0){
echo "";
}
Not happening .. I hope you understood what I meant .. tnx
I have defined a collection in Hibernate like this:
...
public class Item {
...
@ElementCollection
List<Object> relatedObjects;
}
It creates a mapping table with colums item_id and object_id.
The problem is that object_id seems to be unique. In other words I can not have two different items being related to the same object. But that is what I want.
I would like the combination of item_id and object_id to be unique. How do I do that?