• RELEVANCY SCORE 4.18

    DB:4.18:How Can I Handle Button Click Event Inside The Listbox Itemtemplate In Xaml C# Windows Phone? z7




    Hi,
    I have a button which is placed inside the ListBox control and i want to access that button and some other controls inside that button's click event.
    So how can i access those controls?
    Thanks in advance.

    DB:4.18:How Can I Handle Button Click Event Inside The Listbox Itemtemplate In Xaml C# Windows Phone? z7

    Hi NM9,
    According to your description, it seems that first you want to handle the button click event inside the ListBox ItemTemplate, then I have created the following example, please try to check it:

    In the MainPage.xaml:
    ListBox Name=MyListBox
    ListBox.ItemTemplate
    DataTemplate
    StackPanel Orientation=Horizontal
    Button Name=MyButton Content={Binding id} Click=mybutton_Click/Button
    TextBlock Name=TextBlock Text={Binding name} /
    /StackPanel
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox

    In the MainPage.xaml.cs:

    namespace PhoneAppTest
    {
    public class Test
    {
    public string id { get; set; }
    public string name { get; set; }
    }
    public partial class MainPage : PhoneApplicationPage
    {
    public MainPage()
    {
    InitializeComponent();
    ListTest TestList = new ListTest();
    TestList.Add(new Test() { id = aa, name = bb });
    TestList.Add(new Test() { id = bb, name = cc });
    MyListBox.ItemsSource = TestList;

    }

    private void mybutton_Click(object sender, RoutedEventArgs e)
    {
    Test test = (sender as Button).DataContext as Test;
    MessageBox.Show(TextBlock_Content=test.name);
    }


    }
    }
    Then for the question about accessing the control that is placed inside the ListBox control during the button click, please try to check the these articles:
    Getting the control inside aDataTemplate in the Listbox with Button Click.
    How to access a Control placed inside ListBox ItemTemplate.

    Best Regards,
    Amy Peng
    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore,
    Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you
    completely understand the risk before retrieving any software from the Internet.

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click
    HERE to participate the survey.

  • RELEVANCY SCORE 3.97

    DB:3.97:How To Access Item Names Property Of Listbox Inside Of Cluster? ax





    In LabVIEW 2010 I have a Cluster of Controls on the Front Panel. In that Cluster I have a ListBox. How do I access the Item Names Property of the ListBox in my Block Diagram.

    From the Cluster, I can get the ListBox, but that returns an I32 value, probably the index of the selected Item.

    In the Block Diagram, how can I get the Item Name Property of the ListBox from a Reference to the Cluster?

    THANKS.







    Solved!
    Go to Solution.

    DB:3.97:How To Access Item Names Property Of Listbox Inside Of Cluster? ax


    From the original question, I gather that the OP does not know the label name of the listbox item. The following code will get the labels of all items inside the cluster.




    - tbobInventor of the WORM Global

  • RELEVANCY SCORE 3.72

    DB:3.72:How To Access Childcontrols Value On Selectionchanged Event Of Listbox ? c8




    H! Friendsi got a query with respect to Lsitbox.i have a Listbox in which i have a Textblock and Image controls as a ListboxItem.Now what i want is when i select an item in Listbox i want to access the values of Textblock and Image in the SelectionChange Event of Listbox.Can anybody tell me how can i do that ? How can i access values of texblock and Image on Selectionchange event of Listbox.?Please do reply friendsThank You RegardsVijay Gaur

    DB:3.72:How To Access Childcontrols Value On Selectionchanged Event Of Listbox ? c8

    hi, jst go through this links,......... http://dotnetslackers.com/articles/wpf/morewpfanimations.aspx http://msdn.microsoft.com/en-us/library/ms747393.aspx http://dotnetslackers.com/articles/silverlight/SilverlightFirstStepsAnalogClock.aspx Nagarjuna Dilip

  • RELEVANCY SCORE 3.49

    DB:3.49:Lineheight In Listbox aa


    I have embedded an Image and a TextBlock inside a ListBox where you can see the TextBlock next to the Image on each row in the ListBox.
    The problem is that when I set all controls height to 22, both the image and TextBlock is half down in the ListBox as if the Row has a very big lineheight. I have tried to set the lineheight in the ListBox without any difference either.

    How can the Image and TextBlock be seen completely using the height of 22 wich normallyis the default of a lineheight ?
    ListBox
    x:Name=FolderBrowseListBox2
    Width=247 Height=22

    ListBox.ItemTemplate

    DataTemplate

    StackPanel Orientation=Horizontal
    Height=22

    Image x:Name=BrowseImage
    Width=10 Height=22
    Stretch=Fill
    Source={Binding
    Image}/

    TextBlock x:Name=BrowseText
    Margin=5 FontSize=11
    LineHeight=1 Height=22
    Text={Binding
    Text}/

    /StackPanel

    /DataTemplate
    /ListBox.ItemTemplate

    /ListBox

    DB:3.49:Lineheight In Listbox aa

    Hi.
    We feel a little strange, why did you set the set all controls height to 22?
    Based on your above code, you set the TextBlock is height is 22, and the image's height is 22, and you also set their parent stackpanel's height is 22, how can you make hte Textblock and image display completely?
    Why did you need todo like this? Can you give some desctiption aboutyour requirement? maybe thereis another choice to get what you are achieving.

  • RELEVANCY SCORE 3.48

    DB:3.48:Report Listbox a8



    how to inter values in the listbox .

    DB:3.48:Report Listbox a8


    hi praveen,

    use the FM VRM_SET_VALUES

    check this thread...

    https://forums.sdn.sap.com/click.jspa?searchID=1235922messageID=2951115

    do reward if it helps,

    priya.

  • RELEVANCY SCORE 3.43

    DB:3.43:Programatically Cause Listbox/Multicolumn Listbox To Scroll p9


    How?






    Solved!
    Go to Solution.

    DB:3.43:Programatically Cause Listbox/Multicolumn Listbox To Scroll p9


    This is how to do it with a multicolumn listbox:

    TheMListBox displays a maximum of 10 rows. If the MListBox containsmore than 10 rows then it adjusts (No of rows - 10) the TopLeft hand view (i.e. scrolls).

  • RELEVANCY SCORE 3.36

    DB:3.36:Checkbox Inside Listbox jm


    How can I access CheckBox inside ListBox.

    ListBox x:Name=myList Width=180
    Height=143 Template={StaticResource MyListBox}

    ListBox.ItemTemplate

    DataTemplate

    StackPanel Orientation=Horizontal Width=180
    VerticalAlignment=Top HorizontalAlignment=Left Background={Binding
    Converter={StaticResource TextColorConverter}}

    CheckBox
    Content={Binding Id} Width=14
    Height=14 Margin=2,2,0,0 ClickMode=Press
    Checked=CheckBox_Checked/CheckBox

    TextBlock Text={Binding
    Name} FontSize=12 FontFamily=Arial
    Margin=5,0,0,0/TextBlock

    /StackPanel

    /DataTemplate

    /ListBox.ItemTemplate

    /ListBox

    After Binding I have 5 checkbox's. Now what I want to achieve here is have 2 Button Select All and UnSelect All . How can I do this? How can do isChecked = true or false on the button event?

    Thanks
    Thomas

    DB:3.36:Checkbox Inside Listbox jm

    Just stumbled across this post and I though I would share how I acomplished this using a list box item style with a check box IsChecked property bound to to the list box item IsSelected property. This approach will allow you to leverage the list box selected
    items. Style:
    Style x:Key=ListBoxItemStyle TargetType=ListBoxItem
    Setter Property=Padding Value=3 /
    Setter Property=HorizontalContentAlignment Value=Left /
    Setter Property=VerticalContentAlignment Value=Top /
    Setter Property=Background Value=Transparent /
    Setter Property=BorderThickness Value=1/
    Setter Property=TabNavigation Value=Local /
    Setter Property=Template
    Setter.Value
    ControlTemplate TargetType=ListBoxItem
    Grid Background={TemplateBinding Background}
    VisualStateManager.VisualStateGroups
    VisualStateGroup x:Name=CommonStates
    VisualState x:Name=Normal /
    VisualState x:Name=MouseOver
    Storyboard
    DoubleAnimation Storyboard.TargetName=fillColor Storyboard.TargetProperty=Opacity Duration=0 To=.35/
    /Storyboard
    /VisualState
    VisualState x:Name=Disabled
    Storyboard
    DoubleAnimation Storyboard.TargetName=contentPresenter Storyboard.TargetProperty=Opacity Duration=0 To=.55 /
    /Storyboard
    /VisualState
    /VisualStateGroup
    VisualStateGroup x:Name=SelectionStates
    VisualState x:Name=Unselected /
    VisualState x:Name=Selected
    Storyboard
    DoubleAnimation Storyboard.TargetName=fillColor2 Storyboard.TargetProperty=Opacity Duration=0 To=.75/
    /Storyboard
    /VisualState
    /VisualStateGroup
    VisualStateGroup x:Name=FocusStates
    VisualState x:Name=Focused
    Storyboard
    ObjectAnimationUsingKeyFrames Storyboard.TargetName=FocusVisualElement Storyboard.TargetProperty=Visibility Duration=0
    DiscreteObjectKeyFrame KeyTime=0
    DiscreteObjectKeyFrame.Value
    VisibilityVisible/Visibility
    /DiscreteObjectKeyFrame.Value
    /DiscreteObjectKeyFrame
    /ObjectAnimationUsingKeyFrames
    /Storyboard
    /VisualState
    VisualState x:Name=Unfocused/
    /VisualStateGroup
    /VisualStateManager.VisualStateGroups
    Rectangle x:Name=fillColor Opacity=0 Fill=#FFBADDE9 IsHitTestVisible=False RadiusX=1 RadiusY=1/
    Rectangle x:Name=fillColor2 Opacity=0 Fill=#FFBADDE9 IsHitTestVisible=False RadiusX=1 RadiusY=1/
    Grid
    Grid.ColumnDefinitions
    ColumnDefinition Width=Auto /
    ColumnDefinition Width=* /
    /Grid.ColumnDefinitions
    CheckBox Grid.Column=0 IsHitTestVisible=False Margin=2,0 IsChecked={TemplateBinding IsSelected} /
    ContentPresenter Grid.Column=1 x:Name=contentPresenter Content={TemplateBinding Content}
    ContentTemplate={TemplateBinding ContentTemplate}
    HorizontalAlignment={TemplateBinding HorizontalContentAlignment}
    Margin={TemplateBinding Padding}/
    /Grid
    Rectangle x:Name=FocusVisualElement Stroke=#FF6DBDD1 StrokeThickness=1 Visibility=Collapsed RadiusX=1 RadiusY=1 /
    /Grid
    /ControlTemplate
    /Setter.Value
    /Setter
    /Style
    List box implementation:
    ListBox SelectionMode=Multiple ItemContainerStyle={StaticResource ListBoxItemStyle} DisplayMemberPath=MyProperty /

  • RELEVANCY SCORE 3.35

    DB:3.35:How To Access Textblock Inside The Listbox Using Keyevents? d1


    Hi,
    I have to add keyboard support (tab -keydown event) to focus the listbox at first.Then I need to access the inside textblock with in that listbox and need to set keydown event for that textblock to open textblock content.
    This is my sample code:
    ListBox x:Name=Report Grid.RowSpan=3 ItemsSource={Binding} Grid.Row=3 ItemContainerStyle={StaticResource SharedListBoxItemStyle}

    ListBox.ItemTemplate
    DataTemplate
    StackPanel Width=200 Margin=0,0,10,10
    Image x:Name=imgChartRep Height=100 Source={Binding ImageUrl} Stretch=Fill /
    StackPanel Name=spChartDetails MouseEnter=StackPanel_MouseEnter MouseLeave=StackPanel_MouseLeave Background=Transparent Orientation=Horizontal
    TextBlock x:Name=txtChartName MaxWidth=175 Tag={Binding UserId} Text={Binding ChartTitle} TextWrapping=Wrap HorizontalAlignment=Left Style={StaticResource BlackLargeItalicTextStyle} TextDecorations=Underline/
    /StackPanel
    /StackPanel
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox

    Can you please help me?

    Thanks,
    DIP.

    DB:3.35:How To Access Textblock Inside The Listbox Using Keyevents? d1

    Hi,
    Thanks for your response.
    I am having trouble to focus the listbox itself.
    How to get the focus of listbox.(Using keyevents)
    Can you please help me?
    Thanks,
    DIP.

  • RELEVANCY SCORE 3.33

    DB:3.33:About Listbox c8


    how can we use multiple format(fonts/color/size) for the text inside the listbox? please try to provide appropriate URL,code snippets.

    DB:3.33:About Listbox c8

    Questions regarding Windows Forms should be posted in the Windows Forms Forums.To achieve this, you will have to draw the items yourself.  Head over to the Windows Forms Forums and search up there.  I'm positive you'll find the answer, if not, we'll give ya' some code. 

  • RELEVANCY SCORE 3.28

    DB:3.28:How To Find Checkbox Controls In Listbox? sk


    Hi, I can't iterate through the list of checkboxes in a Listbox to see what is checked. i use DataTemplate to display content.how to find checkbox controls in listbox? My Xaml code, somebody knows how to find a control defined in the DataTemplate of a
    ListBox? can anyone help me?Thanks in advance Regards, Sajesh

    DB:3.28:How To Find Checkbox Controls In Listbox? sk

    You will get your answer here.....
    http://silverlight.net/forums/p/12311/40027.aspx

  • RELEVANCY SCORE 3.22

    DB:3.22:New Tabpage With New Listbox Inside It js


    Dear ALL How to make a button creates a new TabPage with a new ListBox inside it ? Thanks in Advance

    DB:3.22:New Tabpage With New Listbox Inside It js

    That code does'nt add new listbox in the new Tabpage

  • RELEVANCY SCORE 3.21

    DB:3.21:Image On Inbuilt Custom Controls sm


    I want to put Image as a background on Inbuilt Silverlight Custom controls like Button and ListBox.
    How can i do it?

    DB:3.21:Image On Inbuilt Custom Controls sm

    Hi Nirav,
    The canvas which i use here is the canvas of the Button control(the root element). All the rectangles and other framework elements are the childeren of this canvas.
    And, the canvas background will not be set on button click but during button's initialization. Also, if you dont want to display other child framework elements, remove them or change their opacity to zero in the UpdateBackground() method.
    Regards,
    Sakthi

  • RELEVANCY SCORE 3.20

    DB:3.20:Accessing Listbox Itemtemplate 9x


    I'm trying to access the elements inside of the itemtemplate (as shown below)for a selected item inside the listbox through the code-behind. Does anybody know how to do this?

    Listbox
    x:Name=lstTest Grid.Row=0
    ItemsSource={Binding MyList, Mode=OneWay}
    ListBox.ItemTemplate
    DataTemplate
    StackPanel
    TextBox x:Name=txtBoxItemValue
    Text={Binding ItemValue} Width=400
    Visibility=Collapsed /
    TextBlock x:Name=txtBlockItemValue
    Text={Binding ItemValue} Width=400
    Visibility=Visible MouseLeftButtonUp=OnItemClick /
    /StackPanel
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox
    Thanks,
    -Jarred Froman

    DB:3.20:Accessing Listbox Itemtemplate 9x

    You should use the VisualTreeHelper in your event handler for the selection. Though the following post does not answer your specific question it should give you an idea how you can use the VisualTreeHelper to walk the element tree:
    http://silverlight.net/forums/p/21987/77132.aspx#77132
    (If this answers your question, MARK this as the answer)
    Jim (http://jimmangaly.blogspot.com/)

  • RELEVANCY SCORE 3.18

    DB:3.18:Probel With Rowsource Property For Listbox Controls km


    In Access 2010, I’ve created a form that contains several
    ListBox controls, each with its Row Source Type property set to Table/Query.
    The Open event procedure for the form contains SQL code that
    creates strings that are to be the RowSource property for each ListBox control.
    The Open event procedure calls a procedure that assigns the SQL strings as the
    RowSource property for the ListBox controls. A much-simplified version of the
    code is this:
    Private Sub Form_Load()
    Dim SqlCode1 As String
    Dim SqlCode2 As String
    SqlCode1 = SELECT [Member List].LastName, [Member List].FirstName
    SqlCode1 = SqlCode1 FROM[Member List];
    SqlCode2 = SELECT [MemberList].FirstName, [Member List].LastName
    SqlCode2 = SqlCode2 FROM[Member List];
    DisplayList SqlCode1, SqlCode2
    End Sub

    Private Sub
    DisplayList(SqlCode1, SqlCode2)
    MyList1.RowSource = SqlCode1
    MyList2.RowSource = SqlCode2
    End Sub

    My problem is this: When I create a quite simple form that contains just two ListBox
    controls and the procedures I’ve just shown, the ListBox controls correctly
    show the data from the table. However, in the application I’m creating, in
    which the record sources for the tables consist of much more complex queries
    (defined in SQL), the ListBox controls in the form are empty.

    How can I solve this problem?

    DB:3.18:Probel With Rowsource Property For Listbox Controls km


    In Access 2010, I’ve created a form that contains several
    ListBox controls, each with its Row Source Type property set to Table/Query.
    The Open event procedure for the form contains SQL code that
    creates strings that are to be the RowSource property for each ListBox control.
    The Open event procedure calls a procedure that assigns the SQL strings as the
    RowSource property for the ListBox controls. A much-simplified version of the
    code is this:
    Private Sub Form_Load()
    Dim SqlCode1 As String
    Dim SqlCode2 As String
    SqlCode1 = SELECT [Member List].LastName, [Member List].FirstName
    SqlCode1 = SqlCode1 FROM[Member List];
    SqlCode2 = SELECT [MemberList].FirstName, [Member List].LastName
    SqlCode2 = SqlCode2 FROM[Member List];
    DisplayList SqlCode1, SqlCode2
    End Sub

    Private Sub
    DisplayList(SqlCode1, SqlCode2)
    MyList1.RowSource = SqlCode1
    MyList2.RowSource = SqlCode2
    End Sub

    My problem is this: When I create a quite simple form that contains just two ListBox
    controls and the procedures I’ve just shown, the ListBox controls correctly
    show the data from the table. However, in the application I’m creating, in
    which the record sources for the tables consist of much more complex queries
    (defined in SQL), the ListBox controls in the form are empty.

    How can I solve this problem?

    The most likely thing is that there's a problem with SQL of the more complex queries, such that they don't return any records. If you take that SQL, paste it into the SQL view of a new query, and switch to datasheet view, are any records returned?
    Dirk Goldgar, MS Access MVP
    Access tips: www.datagnostics.com/tips.html

  • RELEVANCY SCORE 3.18

    DB:3.18:Listbox Object Collection 7c


    Hello,

    I have a question about the Listbox control. When I populate my listbox, I'm using a data template with a button in it. When I click on any button in the ListBox I can capture that event and fire my code to update the button content. What I would like to do
    is, when the Listbox initially loads or when the app loads, I'd like to cycle through the listbox object collection and update the button content so it is current. I have not found any way to reference or get access to the objects that are created within the
    listbox unless I actually click on one.

    I know all about the .items and .itemsource but those aren't helpful cause I need the actual listbox objects not the listbox items.

    Anyone know how to access a listbox objects collection for Windows Phone?

    DB:3.18:Listbox Object Collection 7c

    Pauls example he sent me was exactly what I was looking for.

  • RELEVANCY SCORE 3.16

    DB:3.16:How To Get A Checkbox Inside Listbox In Compact Framework sf


    Hi,

    I am designing a Questionnaire. In this i need to design a multiple
    selection in the listbox by using checkbox.. but i didn't find this
    option in the listbox.

    How to get this feature in listbox

    Regards
    Sarath

    DB:3.16:How To Get A Checkbox Inside Listbox In Compact Framework sf

    Hey Alexy,
    Could you send me the Code Regarding This (if possible design also)
    Regards
    Sarath

  • RELEVANCY SCORE 3.16

    DB:3.16:Listbox Size Changed Behaviour dj


    HI
    I have a grid consisting of three columns
    First Column contains Listbox which contains a expander as the item template the expander contains list of controls including a textbox

    second column contains a grid splitter
    third column contains a rectangle
    when my applicationis loaded and i write anything in the textbox the text doesnot wrap and horizontal scrollbar is visible and my entire listbox is stretched taking gridsplitter and rectanglebehind the window

    How to stop this behaviour ?
    Ihave tried toset the width of the listbox in sizechangedevent but when i drag the splitter the listbox takes the definite width and does not resize or get stretched .or u can say my expander inside the listbox doesnot filled up to the availabel space
    and sizexhanged evnt is not getting fired .
    please help me as soon as possible..

    DB:3.16:Listbox Size Changed Behaviour dj

    Hmm, strange, as long as there aren't a Width specified to the scroller and the content of if will not fit into the window, a scroller should be displayed. Guess it want work as you said.. well, I'm out of suggestions right now... Scaling would be the
    last thing, but it can be strange to scale the content. If you want the TextBox to fit in the ListBox, I assume the other controls should still have its width.. In that case I think you will get a problem if the controls in front of the ListBox will take
    up the width of the ListBox, it will push the TextBox outside and you will need to scroll to see it. So either I should just leave it as it's, use the scroller, or not use it. If some people have low resolution, or make the window small, they have to live
    with it.. or see if you can design the items in the ListBox in some different ways..

  • RELEVANCY SCORE 3.14

    DB:3.14:Set Focus Listbox Item (Thijs) - 1/15/2007 6:17 Am Pst 3a


    By: Thijs

    When I navigate to a page, containing listboxes and other controls, the
    listbox gets the focus (at startup or by Listbox1.Focus()). But I don't want
    to set the focus to the listbox itself, but to a listbox item, so I can
    browse the listbox immediately instead of selecting an item first. How to do
    this?

    DB:3.14:Set Focus Listbox Item (Thijs) - 1/15/2007 6:17 Am Pst 3a

    By: Thijs

    Thanks Jen! It's working fine now :-)

    Jen Rowe [MSFT] wrote:

    Please note that the code in my previous post will not work (i.e.
    ListBoxItem listBoxItem = (ListBoxItem)listBox.Items[0];) as expected if you
    have databound items in your list box.
    To achieve the same effect, you would need to use ItemContainerGenerator
    to get the UI element for a particular databound item. Make sure you call
    this after all the databinding for the listbox is complete. I would suggest
    creating an event for Window Loaded and setting the focus then.
    private void OnWindowLoaded(object sender, RoutedEventArgs e)

    {

    ListBoxItem listBoxItem =
    listBox.ItemContainerGenerator.ContainerFromIndex(0) as ListBoxItem;

    listBoxItem.Focus();

    }

    Jen Rowe [MSFT] jrowe@online.microsoft.com wrote in message
    news:%23rmGv2OOHHA.4848@TK2MSFTNGP04.phx.gbl...
    Try something like:
    listBox.SelectedIndex = 0;
    ListBoxItem listBoxItem = (ListBoxItem)listBox.Items[0];
    listBoxItem .Focus();

    Use of arrow keys should then work as expected.



    Thijs Thijs@discussions.microsoft.com wrote in message
    news:43605501-1DB2-4CC7-9322-834110D6C8A9@microsoft.com...
    I tried both, but none of them works. The listbox is selected with the
    first
    item highlighted, after pressing downkey for example, the first item gets
    the
    focus and after pressing downkey again the second item is selected. When
    I
    set selecteditem in Blend to 1, the second item is highlighted and the
    listbox has the focus. After pressing downkey, the itemlist gets the
    focus
    and the first item is selected. From then on, I can browse through the
    list
    in a normal way...

    By the way, I changed the whole look of the listbox already :-)

    Jen Rowe [MSFT] wrote:

    You can always do something like:
    listBox.SelectedIndex = 0; This will select the 1st item. If you just
    set
    focus to the listbox itself, using the arrow keys will immediately begin
    selecting list items.

    You also could change the style/color of the selection if you want it to
    look different.

    Thanks,

    Jen

    Thijs Thijs@discussions.microsoft.com wrote in message
    news:0A9AAF6B-8E48-4D3A-9B55-7753EE729EA5@microsoft.com...
    When I navigate to a page, containing listboxes and other controls,
    the
    listbox gets the focus (at startup or by Listbox1.Focus()). But I
    don't
    want
    to set the focus to the listbox itself, but to a listbox item, so I
    can
    browse the listbox immediately instead of selecting an item first. How
    to
    do
    this?







  • RELEVANCY SCORE 3.13

    DB:3.13:Access Combo Listbox pm


    How do I disallow editing choices in listbox?

    DB:3.13:Access Combo Listbox pm

    If it is a listbox, and not a combo box, then if you don't want to let the selections that have been clicked changed, set the LOCKED property of the list box to YES.

  • RELEVANCY SCORE 3.12

    DB:3.12:How To Set The Borderbrush Around Each Item In A Listbox Programmatically 78


    The pivot control seems to cause controls inside it to ignore the border brush setting. It does not change the border color automatically if the theme is light vs dark (it defaults to only showing dark), thus making the borders disappear in the light
    theme. It was easy to set the buttons borders manually through code, but I need to do it for several bound listboxes and the items inside of them. Any help or pointers would be appreciated.

    Steve

    DB:3.12:How To Set The Borderbrush Around Each Item In A Listbox Programmatically 78

    Thank you very much, that solved the issue. This is my first silverlight/wp7 app and I am still learning. I appreciate the help.

    Steve

  • RELEVANCY SCORE 3.12

    DB:3.12:Accessing Height Of Controls Within A Datatemplate? xc


    I'm working in Windows 8 Metro, but I don't think this is a Metro-specific question:
    I'm trying to access the height of a stackpanel in a data template to set a property that an animation is bound to for a sliding-out animation.
    Even after the control containing the data template is created and child elements have been added to the stackpanel, the height and actual height of the stackpanel are always zero, so I can't set the value for the opening animation to bind to.
    I can access and use the stackpanel using VisualTreeHelper, but when I debug, it never has a height!
    The code looks like this:
    ListBox
    ListBox.ItemTemplate
    DataTemplate
    StackPanel x:Name=extensionPanel/
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox
    In the code behind, after using VisualTreeHelper to access the stackpanel, I tried calling

    extensionPanel.Measure(new Windows.Foundation.Size(Double.PositiveInfinity, Double.PositiveInfinity));
    and
    extensionPanel.Arrange(new Windows.Foundation.Rect(new Windows.Foundation.Point(0, 0), extensionPanel.DesiredSize));
    but the height of extensionPanel is always 0.0!

    Does anyone have an idea on how can I access the height of a control inside a datatemplate?
    Thanks in advance.

    DB:3.12:Accessing Height Of Controls Within A Datatemplate? xc

    Thanks a lot, Pete. I created the new application using your code and everything worked great. When adding the attached property to my Metro application, I kept getting an error saying the property could not be attached, but now that I see that the datatemplate
    isn't the problem, I'll add a watch for a pointer to the ActualHeight while debugging and monitor it that way.

  • RELEVANCY SCORE 3.11

    DB:3.11:Checkbox Inside A Listbox Is Checked Or Not? 1f


    Hi All,
    I have a listbox with a data template having checkbox, textblock and textbox. I can populate it with all the values and it works fine. I want to find out if any of the checkboxes inside it are checked or not? Can anyone help me how in code behind should
    I access the contents of the listbox and find out if any of the checkboxes are checked?

    Thanks in anticipation,
    Mavericky

    DB:3.11:Checkbox Inside A Listbox Is Checked Or Not? 1f

    If you have your ItemsSource Bound to a List Of Objects you could just bind to the IsCheckedProperty.

    ex:

    ListBox ItemsSource={Binding Properties} Height=225
    ListBox.ItemTemplate
    DataTemplate
    Border BorderBrush=Black
    StackPanel Orientation=Horizontal Margin=4

    ComboBox ItemsSource={Binding Types} SelectedIndex={Binding SelectedTypeIndex,Mode=TwoWay} Width=100/
    TextBox Text={Binding VariableName,Mode=TwoWay} Width=150/
    CheckBox IsChecked={Binding HasOnChange,Mode=TwoWay} Width=150 VerticalAlignment=Center HorizontalAlignment=Center/
    CheckBox IsChecked={Binding InModel,Mode=TwoWay} Width=150 VerticalAlignment=Center HorizontalAlignment=Center/
    /StackPanel
    /Border
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox

    Where Properties would be your class and each instance of the class in the list would contain a property it would be bound to

  • RELEVANCY SCORE 3.10

    DB:3.10:Usercontrol With Other Controls Inside (Urgent) kx


    Hi all
    i just have a question!!?
    i´m doing my own usercontrol, and i have seta few controls inside it (a few buttons and some textboxes )
    and i place my user controls inside a form.
    but my problem is in the code i can access the controls inside of my usercontrol using the UserControl1.Controls Property, is there anyway to no have access to those controls inside ????
    if yes How ?? anysample !!!
    thks
    JSB

    DB:3.10:Usercontrol With Other Controls Inside (Urgent) kx

    Well...in theory you can do all of the painting yourself by overriding OnPaint in your UserControl. The problem is that, since the controls themselves wont actually exist on the form (you are really just painting them), they wont receive messages, and therefore they wont actually function like real controls. You would have to recreate all the functionality within your UserControl, and I doubt you are going to have a lot of success doing that.
    You do have another option though. Control has a protected method called CreateControlsInstance that is used to create the control collection of the class. You could use that method to return a custom class derived from ControlCollection. The only thing this could really do, though, is prevent outside users from adding or removing controls from the collection; you cant hide all of the controls, because the framework uses that same collection in its architecture to display the controls.

  • RELEVANCY SCORE 3.10

    DB:3.10:How Can I Access The Controls Inside A Spesific Cell In Datagridview? c3


     
    I have a DataGridView that has a checkbox inside one of its columns. How can i access this checkbox programmatically to check and uncheck it?
     

  • RELEVANCY SCORE 3.09

    DB:3.09:How Add Controls Inside The Toolbar? sz


    Hi,
     
    I'm trying to add contrls(Button, ListBox, TextBox) inside the toolBar.
     
    I'm using VS 2008 with C#...
     
    I would like to add these controls in visual with the controls is ready...
     
    How do it?
     
    I hope you help me.
     
    Thank you,

    DB:3.09:How Add Controls Inside The Toolbar? sz

    Correct, we don't have a designtime experience for WPF toolbars or menubars in VS 2008.
     

  • RELEVANCY SCORE 3.09

    DB:3.09:Databinding And Listbox Questions zj


    Hi
    I have an XML document data binded to a listbox. Each item in the listbox displays an image, and 2 text fields. Next to the listbox, I have a textbox inside a grid.
    Here are my questions:
    1. How can I use the textbox to filter the items in the listbox based on one of the text fields?
    2. How can I make each item within the listbox dragable so that I would be able to drag an item from the listbox, and drop it into the grid. Once dropped inside the grid, it must be removed from the listbox? (the combined(Image, text field, text field) item, not only one text field)
    3. When a user clicks on one of the items in the listbox, the appropriate data should be populated into various controls within the datagrid.

    Thanks in advance for any help.

    DB:3.09:Databinding And Listbox Questions zj

    1. You will need a datamodel that has a collection exposed that can be filtered, your textbox should also be databound to that model, so that updates to the search property properly filter the exposed collection that populates the listbox.

    2. This one is trickier, there are drag + drop behaviors available, as well as some support in the SLToolkit.

    3. You can bind the datacontext of the grid (or other object) to the selected item of the listbox, that way any databinding in the grid can be done against the object you have selected in the listbox.

  • RELEVANCY SCORE 3.09

    DB:3.09:How Can I Detect A Click In A Scrollbar Of A Control? 8k


    I've got a ListBox with a WrapPanel as the ItemsPanel. How can I detect when someone clicks in the horizontal scrollbar for the wrappanel? In particular, I need to detect clicking on the arrows and clicking in the shaft of the scrollbar which I think is
    called alarge change. I've tried using a
    VisualTreeVisualizer to show me what's there but it only shows the controls I've added not the 'embedded' ones inside the ListBox. Where do I start with this?
    The ListBox is defined like this:
    ListBox HorizontalAlignment=Stretch VerticalAlignment=Stretch
    ScrollViewer.VerticalScrollBarVisibility=Disabled
    ItemsSource={Binding GroupObjects}
    ListBox.ItemsPanel
    ItemsPanelTemplate
    toolkit:WrapPanel Orientation=Vertical FlowDirection=LeftToRight /
    /ItemsPanelTemplate
    /ListBox.ItemsPanel
    : (etc.)
    /ListBox

    DB:3.09:How Can I Detect A Click In A Scrollbar Of A Control? 8k

    yifung- you were right, sort of.The controlwas loaded but the content wasn't. Even after all this time, I forget that Silverlight does async!
    JeyZ- fortunately, I haven't had to go down that route. yet. :-)
    MF_MiEK- thanks very much for your suggestion. Using .GetScrollHost in conjuction with

    VisualTreeVisualizer, I got a look at what I needed. Then, using combinations of GetChild and FindName I worked my way through the control templates to the controls I needed.

    I've posted my code in case anyone can see a better way of doing it and in case it helps someone else:
    var scrollViewer = groups.GetScrollHost();
    var scrollBar = ((FrameworkElement)VisualTreeHelper.GetChild(scrollViewer, 0)).FindName(HorizontalScrollBar);
    var scrollBarRoot = (FrameworkElement)VisualTreeHelper.GetChild((DependencyObject)horScrollBar, 0);

    var smallDecrease = (RepeatButton)horScrollBarRoot.FindName(HorizontalSmallDecrease);
    smallDecrease.Click = new RoutedEventHandler(smallDecrease_Click);

    var largeDecrease = (RepeatButton)horScrollBarRoot.FindName(HorizontalLargeDecrease);
    largeDecrease.Click = new RoutedEventHandler(largeDecrease_Click);

    var largeIncrease = (RepeatButton)horScrollBarRoot.FindName(HorizontalLargeIncrease);
    largeIncrease.Click = new RoutedEventHandler(largeIncrease_Click);

    var smallIncrease = (RepeatButton)horScrollBarRoot.FindName(HorizontalSmallIncrease);
    smallIncrease.Click = new RoutedEventHandler(smallIncrease_Click);

    Now, I just need to work out when to run this and what I want to do in my event handlers. :-)

  • RELEVANCY SCORE 3.06

    DB:3.06:Multiple Select Control as


    It seems unclear how Microsoft wants to support multiple select controls. It seems that they want me to use the LongListSelector. But so far I haven't been able to find how to use it for multiple selection. ListBox has a SelectionMode Property
    but it's not in the designer toolbox. I've seen some articles on line for a MultiSelectList but can't find that in the designer toolbox.
    Can someone with some inside knowledge explain the preferred way to display and get back a list of items that you would have gotten back using a ListBox with the SelectionMode set for multiple select?
    Also maybe there is away to get these older controls into the designer if someone can tell me how to do that I can use these.
    Thanks

    DB:3.06:Multiple Select Control as

    It seems unclear how Microsoft wants to support multiple select controls. It seems that they want me to use the LongListSelector. But so far I haven't been able to find how to use it for multiple selection. ListBox has a SelectionMode Property
    but it's not in the designer toolbox. I've seen some articles on line for a MultiSelectList but can't find that in the designer toolbox.
    Can someone with some inside knowledge explain the preferred way to display and get back a list of items that you would have gotten back using a ListBox with the SelectionMode set for multiple select?
    Also maybe there is away to get these older controls into the designer if someone can tell me how to do that I can use these.
    Thanks

  • RELEVANCY SCORE 3.05

    DB:3.05:How To Detect Listbox Scrollbar Pressed 8k


    Hi,
    How can I detect that ScrollBar inside ListBox was pressed?
    I am using WEC7 with silverlight for windows embedded

    Regards,
    Luka

    DB:3.05:How To Detect Listbox Scrollbar Pressed 8k

    I have never tried this, but if I wanted to, the first thing I would do is go into Blend and edit the control template for the ListBox and then modify the control template for the contained scroll control. I would then try attaching LeftButtonDown
    events to the control and possibly the objects in the control to see if I can hook the event.

  • RELEVANCY SCORE 3.05

    DB:3.05:Cant Access Controls When Using Databound Pivot pz


    Hello,
    With this code it's not possible to access the ListBox ClientListBox from codebehind:
    controls:Pivot Name=ClientPivot
    Title=MY APPLICATION
    ItemsSource={Binding PageCollection}
    HorizontalContentAlignment=Stretch
    VerticalContentAlignment=Stretch
    controls:Pivot.ItemTemplate
    DataTemplate
    ListBox x:Name=ClientListBox ItemsSource={Binding ClientCollection}

    ListBox.ItemTemplate
    DataTemplate
    TextBlock Text={Binding Name} /
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox
    /DataTemplate
    /controls:Pivot.ItemTemplate
    /controls:Pivot
    Also it's not possible to access controls used in controls:Pivot.HeaderTemplate
    What am I doing wrong?
    Thanks,
    Jimmy

    DB:3.05:Cant Access Controls When Using Databound Pivot pz

    Hello,
    With this code it's not possible to access the ListBox ClientListBox from codebehind:
    controls:Pivot Name=ClientPivot
    Title=MY APPLICATION
    ItemsSource={Binding PageCollection}
    HorizontalContentAlignment=Stretch
    VerticalContentAlignment=Stretch
    controls:Pivot.ItemTemplate
    DataTemplate
    ListBox x:Name=ClientListBox ItemsSource={Binding ClientCollection}

    ListBox.ItemTemplate
    DataTemplate
    TextBlock Text={Binding Name} /
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox
    /DataTemplate
    /controls:Pivot.ItemTemplate
    /controls:Pivot
    Also it's not possible to access controls used in controls:Pivot.HeaderTemplate
    What am I doing wrong?
    Thanks,
    Jimmy

  • RELEVANCY SCORE 3.04

    DB:3.04:Javascript Inside A Webpart df


    Hi All,How to call a javascript from a DataFormWebPart ? Inside this web part I have 10-15 controls ?I need a particular controls' client-id, say textbox control,  How i can access it  too ?Regards,Murali

    DB:3.04:Javascript Inside A Webpart df

    Hi All,How to call a javascript from a DataFormWebPart ? Inside this web part I have 10-15 controls ?I need a particular controls' client-id, say textbox control,  How i can access it  too ?Regards,Murali

  • RELEVANCY SCORE 3.03

    DB:3.03:How To Get Access To Textblock Inside Listbox Datatemplate By Name? d9


    Hello everyone,

    DB:3.03:How To Get Access To Textblock Inside Listbox Datatemplate By Name? d9

    I actually have the same issue here. I want to get the Text property of a text box inside of a DataTemplate. The textblock has a name and i would like to replace some values before it is displayed.

  • RELEVANCY SCORE 3.03

    DB:3.03:Listbox Of Comboboxes Question: How To Get Listbox From Selectionchanged Event Of Combobox 7z


    I have a ListBox whose itemtemplate is a user control that consists of a combobox. I need a way to get a reference to lbx (the containing listbox) inside cbx_SelectionChanged. Can you suggest a solution? Thanks.
    // user control's XAML is - name is UC_ComboBox
    Grid
    ComboBox x:Name='cbx SelectedChanged=cbx_SelectionChanged
    /ComboBox
    /Grid

    // the listbox XAML is
    ListBox x:Name=lbx
    ListBox.ItemTemplate
    DataTemplate
    local:UC_ComboBox/
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox

    DB:3.03:Listbox Of Comboboxes Question: How To Get Listbox From Selectionchanged Event Of Combobox 7z

    Thankscsnance,
    I was able to make #1 work so I marked your reply as correct answer.
    As for #2, I tried that even before I posted my question. But I found it impossible to get to the listbox. I think it's because the combobox is inside a DataTemplate. If you can show me working codeI will appreciate it much as it can become handy in
    similar situations in the future.

  • RELEVANCY SCORE 3.03

    DB:3.03:How Can I Access An Object Within A Datatemplate? 3f


    I have a Listbox which I bind to a collection of custom objects (in my solution, these objects are of a class called QueueListButtonData).
    Now when I bind the Listbox, it has a DataTemplate for its items (basically consists of a few Button and Border controls).
    My question is..
    On a selection change of the Listbox, how can I obtain a Button or Border control from the DataTemplate of the selected item ???

    P.S. I have given names to my controls in the DataTemplate, I'm sure that will help me retrieve them...

  • RELEVANCY SCORE 3.02

    DB:3.02:How To Find Control Inside Listbox ? fz


    Hi all,
    I am having Treeview control inside a listbox and I am trying to add Nodes to the treeview control via textbox. Can some please tell me how will I find the treeview control inside the Listbox and also find the selected Node if Treeview has any items.
    I tried using VisualTreeHelper
    but its not working.
    Thanks in advance.

    DB:3.02:How To Find Control Inside Listbox ? fz

    Thank you so much ttzankov. Its working fine now.

  • RELEVANCY SCORE 3.02

    DB:3.02:How Can I Determine Controls Parent And Access A Controls Width Property When It Is Inside A Datatemplate aa


    Hi,

    I have a modified listbox called lstStayHome, the DataTemplate contains a button called btnLstStayHome with some textblocks for the button content. I Used the button because I needed to catach the Click event as SelectionChanged for the Listbox didn't meet
    my needs. Now I need to get the following information and I am hoping someone can help:

    In the Click event handler for the button I need to determine the buttons parent, in this case that it came from a ListBox named lstStayHome, how can I do this? (I will have several lists using the same click event and need to take a different action depending
    on the list) How can I set the button's width property in code behind while it is in a DataTemplate contained within the ListBox? (I want to be able to resize the button OnOrientationChanged, but I can't access the button by name)

    Below is the xaml that shows the ListBox setup for the two questions above.

    ListBox x:Name=lstStayHome

    ListBox.ItemTemplate

    DataTemplate

    Button x:Name=btnLstStayHome
    BorderBrush={x:Null}
    Foreground=White Style={StaticResource
    Transparent} Width=465
    HorizontalContentAlignment=Left Click=lst_Click

    Button.Content

    StackPanel

    TextBlock
    Text={Binding Subject}
    TextWrapping=Wrap Style={StaticResource
    PhoneTextExtraLargeStyle} /

    TextBlock Text={Binding
    Description} TextWrapping=Wrap
    Style={StaticResource PhoneTextAccentStyle}
    /

    /StackPanel

    /Button.Content

    /Button

    /DataTemplate

    /ListBox.ItemTemplate

    /ListBox

    DB:3.02:How Can I Determine Controls Parent And Access A Controls Width Property When It Is Inside A Datatemplate aa

    Check this post:
    http://windowsphonegeek.com/tips/how-to-access-a-control-placed-inside-listbox-itemtemplate-in-wp7

  • RELEVANCY SCORE 3.01

    DB:3.01:Question About Gridlines In Access k8


    Property sheets for various Access 2010 controls (ComboBox, ListBox, and others) list various Gridline properties. Changing those properties in property sheets seems to have no effect on the displayed controls. I came across one on-line statement that says
    Access ComboBox controls do not support gridlines. If that is the case, why do property sheets list Gridline properties?
    Do ComboBox and ListBox controls support gridlines? If so, how do I use them?

    DB:3.01:Question About Gridlines In Access k8

    Much thanks, I have spent the last several hours looking for this!!!Ed Warren Raising sails on masts not masts on sails

  • RELEVANCY SCORE 3.01

    DB:3.01:How To Test The Type Of A Form Control ? 19


    I'm writing a program in which I want to list the values of some of the properties on every control on every form in the application. I can do this for simple controls like Buttons and Labels, but am having a problem when it comes to a complex control
    like a ListBox. I know how to extract the data when I laboriously code each ListBox individually. The problem is how to do it when it's a generic object buried inside two loops -
    For Each frm As Form In Application.OpenForms
    For Each ctr As Control In frm.Controls
    ...
    Next
    Next
    Another way of expressing the same problem is to ask how to test ctr to see if it is a ListBox.
    Ro

    DB:3.01:How To Test The Type Of A Form Control ? 19

    In case there might ever be group boxes involved...

    For Each frm As Form In Application.OpenForms
    Dim ctl As Control = frm.GetNextControl(Me, True)
    Do Until ctl Is Nothing
    Debug.WriteLine({0} {1}, ctl.GetType.ToString, ctl.Name)
    If TypeOf ctl Is ListBox Then
    Dim lBox As ListBox = DirectCast(ctl, ListBox)
    '
    End If
    ctl = frm.GetNextControl(ctl, True)
    Loop
    Next

    Serial Port
    Random Microsoft® Community Contributor 2011

  • RELEVANCY SCORE 3.01

    DB:3.01:Accessing Activex Controls 91


    How to access ActiveX controls from Java Applications?

    DB:3.01:Accessing Activex Controls 91

    the general answer is you need JNI.

    however specificially when it comes to controls and COM there are some
    tools that allow you to interact with ActiveX from Java.

    here are two that I know of

    http://danadler.com/jacob/index.html

    and

    http://www.infozoom.de/ie/jacozoom.html

  • RELEVANCY SCORE 3.00

    DB:3.00:How To Bind Listbox Inside Datagrid sk


    Hello,
    how can i access(adding some items) the ListBox in the DataGrid at DataGrids LoadingRow-Event?

    my:DataGrid LoadingRow=dgTanten_LoadingRow Name=dgTNT IsSynchronizedWithCurrentItem=True
    my:DataGrid.Columns
    my:DataGridTextColumn Header=Name Binding={Binding Path=TNT_NAME}/
    my:DataGridTextColumn Header=Vorname Binding={Binding Path=TNT_VNAME}/
    my:DataGridTextColumn Header=Ort Binding={Binding Path=TNT_ORT}/
    my:DataGridTemplateColumn Header=E-Name
    my:DataGridTemplateColumn.CellTemplate
    DataTemplate
    ListBox MaxHeight=50 Name=myListBox DisplayMemberPath=PS_NAME

    /ListBox
    /DataTemplate
    /my:DataGridTemplateColumn.CellTemplate
    /my:DataGridTemplateColumn

    /my:DataGrid.Columns
    /my:DataGrid

    DB:3.00:How To Bind Listbox Inside Datagrid sk

    Here is nice article regarding binding the control inside the datagrid rowDetailTemplate
    http://asimsajjad.blogspot.com/2010/04/rowdetailtemplate-of-datagrid-control.html

  • RELEVANCY SCORE 3.00

    DB:3.00:Listbox Size Changed Event 3p


    HII am facing an issue in silverlight3 control listbox  
    I have a grid consisting of three columns
    First  Column contains Listbox which contains  a expander as the item template  the expander contains list of controls including a textbox
    second column contains a grid splitter
    third column contains  a rectangle
    when my application is loaded and i write anything in the textbox the text doesnot wrap and horizontal scrollbar is visible and my entire listbox is stretched  taking gridsplitter and rectangle behind the window
     How to stop this behaviour ?
    I have tried to set the width of the listbox in sizechangedevent but when i drag the splitter the listbox takes the definite width and does not resize or get stretched . or u can say my expander inside the listbox doesnot filled up to the availabel space  and sizexhanged evnt is not getting fired .
    when i disabled the horizontalscrollbar then i get my text wrap but i need scrollbar visibile when my page is resized  or smaller in view  so please suggest some solution please help me as soon as possible..

    DB:3.00:Listbox Size Changed Event 3p

    HII am facing an issue in silverlight3 control listbox  
    I have a grid consisting of three columns
    First  Column contains Listbox which contains  a expander as the item template  the expander contains list of controls including a textbox
    second column contains a grid splitter
    third column contains  a rectangle
    when my application is loaded and i write anything in the textbox the text doesnot wrap and horizontal scrollbar is visible and my entire listbox is stretched  taking gridsplitter and rectangle behind the window
     How to stop this behaviour ?
    I have tried to set the width of the listbox in sizechangedevent but when i drag the splitter the listbox takes the definite width and does not resize or get stretched . or u can say my expander inside the listbox doesnot filled up to the availabel space  and sizexhanged evnt is not getting fired .
    when i disabled the horizontalscrollbar then i get my text wrap but i need scrollbar visibile when my page is resized  or smaller in view  so please suggest some solution please help me as soon as possible..

  • RELEVANCY SCORE 3.00

    DB:3.00:Yellow Background Appears When Clicking Controls 3s


    Hi Guys
    I wondered if someone may be able to help me.  I have quite a few windows forms applications that are written in vb.net and for some reason certain controls when they are selected render with a yellow background, a bit like how autofill on web pages does when you have the google toolbar installed.
    For example, click on a regular textbox and the inside goes yellow, click on a listbox and the whole inside goes yellow, click on a combobox and the inside of textarea and the dropdown go yellow.
    These are just standard windows forms controls, no custom drawing going nothing.  I don't the google toolbar installed (not that would affect a windows forms application anyway).  I am at a complete loss.
    Has anyone else ever seen this?  Any help would be much appreciated.
    Thanks in advance.
    Dan

    DB:3.00:Yellow Background Appears When Clicking Controls 3s

    You might want to check your internet explorer settings, too...  If you go into  Internet Options -Content Tab - Auto Complete Button, make sure Forms is not checked as an option as I think this can also highlight the textboxes on forms.

  • RELEVANCY SCORE 2.99

    DB:2.99:Cannot Rebind Listbox From Parent Page Of Usercontrol Inside The Listbox Item Template 3p


    I cannot for the life of me figure out how to rebind my listbox from a button click inside a usercontrol inside my listboxitemtemplate

    ------------------------------------
    -ListBox
    ---ListBox.ItemTemplate
    ------UserControl
    ---------Button (Button click to refresh listbox
    -------------------------------------------------

    here is my code.
    Xaml (MainPage.xaml)

    ListBoxx:Name=lbMostRecentMargin=0,0,-12,0ItemsSource={BindingItems}

    ListBox.ItemTemplate

    DataTemplate

    favControls:FavMemberListItemDataContext={Binding}/

    /DataTemplate

    /ListBox.ItemTemplate

    /ListBox

    DB:2.99:Cannot Rebind Listbox From Parent Page Of Usercontrol Inside The Listbox Item Template 3p

    I have figured out my solutions. I can do everything above and subscribe to it on the favControl itself.

  • RELEVANCY SCORE 2.98

    DB:2.98:Access Controls Inside Listbox Headertemplate In Metro Apps xa


    Hi all,
    how to access the controls within the listview headertemplate.
    I am able to get the controls in itemtemplate using
    var currentItem1 = MyListView.ItemContainerGenerator.ContainerFromIndex(0) as ListViewItem;
    StackPanel sp = FindDescendantStackPanel(currentItem1);
    where
    public T FindDescendantT(DependencyObject obj) where T : DependencyObject
    {
    // Check if this object is the specified type
    if (obj is T)
    return obj as T;

    // Check for children
    int childrenCount = VisualTreeHelper.GetChildrenCount(obj);
    if (childrenCount 1)
    return null;

    // First check all the children
    for (int i = 0; i childrenCount; i)
    {
    DependencyObject child = VisualTreeHelper.GetChild(obj, i);
    if (child is T)
    return child as T;
    }

    // Then check the childrens children
    for (int i = 0; i childrenCount; i)
    {
    DependencyObject child = FindDescendantT(VisualTreeHelper.GetChild(obj, i));
    if (child != null child is T)
    return child as T;
    }

    return null;
    }

    but to get access to the controls inside headertemplate?Smiley

    DB:2.98:Access Controls Inside Listbox Headertemplate In Metro Apps xa

    To access controls inside a listview header template, you can use
    void tableListView_Loaded(object sender, RoutedEventArgs e)
    {
    Grid obj = tableListView.HeaderTemplate.LoadContent() as Grid;
    // obj.Tapped = obj_Tapped;
    foreach (TextBlock t in (obj as Grid).Children)
    {
    // t.Tapped = t_Tapped;
    // t.PointerPressed = t_PointerPressed;
    }

    My problem is I want to add a event to the controls inside the listview headertemplate.
    I commented the lines above used for adding the handler.
    but the event never fires.
    Please let me know how to add an event handler.
    The textblock inside the template shows exact value which I am binding but the event is not getting fired. What am I missing?
    Nazia

  • RELEVANCY SCORE 2.98

    DB:2.98:Listbox And Controls pa


    Can anyone tell me how to display listbox items with a checkbox and star rating control each in C# for WP7? I want the listbox item data source to an xml file.
    Please help!

    DB:2.98:Listbox And Controls pa

    Hi Sanchita,
    You can consider posting it at the following more appropriate forum for more efficient responses. Thanks!
    wp7: http://forums.create.msdn.com/forums/default.aspx?GroupID=19Bob Shen [MSFT]
    MSDN Community Support | Feedback to us

  • RELEVANCY SCORE 2.98

    DB:2.98:User Control Inside A Web Part 18


    hi, I am trying to develop two connecting web parts.Provider will have a few input controls(textbox, listbox, etc) from where a user can select some values.But designing such a web part (GUI aspects) is bit complex, so i thought of having a USER CONTROL(which contains all input controls) inside a web part, which is easier to make.(REFER:- http://msdn.microsoft.com/en-us/library/dd206945(printer).aspx)But problem is:-Suppose there is SUBMIT button, on user control. How will the web part be able to capture the SUBMIT button pressed event?e.g:- User, selected abc, bcd and some other strings from input controls, and i want to pass these to Consumer.How can we do that, as those selections are made inside UserControl but not WebPart.I hope i make my question clear.Thanks,Gaurav Nanda

    DB:2.98:User Control Inside A Web Part 18

    Use the Button control to create a push button on the Web page. You can create either a Submit button or a Command button.
    When you use a Button control, you typically write an event handler for the button's Click event or its Command event. These events are handled by using server-based code. This is different than events in traditional HTML pages or in client-based Web applications, where a button's onclick event is handled by using JavaScript that runs in the client. For more information, see ASP.NET Web Server Control Event Model.
     
    You can reference: Button Class(http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.aspx)Keep It Simple and Stupid.

  • RELEVANCY SCORE 2.98

    DB:2.98:Listbox dc


    Hi,
    any body know how to count the number of items in a listbox.
    I used rowCount but it counts only the items that you can see
    inside the box of the listbox but not all of them

    any help will be appreciated.

    Thanks

    Benbak

    DB:2.98:Listbox dc

    listBox.dataProvider.length

    You may have to cast the dataProvider to ArrayCollection or
    whatever it is you used as the dataProvider.

  • RELEVANCY SCORE 2.98

    DB:2.98:How To Retrive The Controls Under Listbox Item On Listbox Selectionchanged Event da


    How to retrive the controls under listbox item on listbox selectionchanged event ?

  • RELEVANCY SCORE 2.97

    DB:2.97:I Have A Listbox With Propety Nodes "Item Names" And "Double Click".I'M Trying To Access The Files In The Listbox Using These Nodes But It Isn't Working. How Exactly Does Items Names Work?? 1j


    I realise that the first item in the listbox is 0 but how can I open these files in the listbox...I'm very confused!!

  • RELEVANCY SCORE 2.97

    DB:2.97:Groupbox Inside Groupbox, How To Acess The Second Groupbox Controls? p9


    supose i have groupBox1 inside groupBox100, i want to get the comboBoxXpto inside groupBox1, how do i get this groupBox1 controls?like this::for (int k=0;kgroupBox100-Controls-Count;k++)                            {                if (System.Windows.Forms.GroupBox == (groupBox100-Controls[k]-GetType())-ToString())
    //how to control the groupBox1??

  • RELEVANCY SCORE 2.97

    DB:2.97:Listbox Controls df


    Hi,

    Rather than having a Listbox on a Userform, i have just created a Listbox on a sheet.
    Problem i have at the moment is i cant select an item in the Listbox when clicking on the Up and Down arrow. What i would like to do is store to a cell everytime i make a selection from the list. not sure though how to do this. As always, any help on this
    appreciated.

    Thanks
    John

    DB:2.97:Listbox Controls df

    If I understand your problem correctly, you have a listbox control on a worksheet that you want to be able to select values using the up/down arrow keys, but you only want to commit a change, for example by pressing Enter or Space, or by Double-clicking?
    And you want to create a growing list of selected items?
    I've not tested this in Excel 2003, but if you use an ActiveX ListBox control on your sheet, you can use the following macros to update a list in column
    B (edit as required).
    Right-click on the ListBox and View Code. Paste the following:

    Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
    Dim lnLastRow As Long

    With ActiveSheet
    lnLastRow = .Range("B" .Rows.Count).End(xlUp).Row
    If .Range("B" lnLastRow).Value "" Then
    lnLastRow = lnLastRow + 1
    End If
    .Range("B" lnLastRow).Value = Me.ListBox1.Value
    End With
    End Sub

    Private Sub ListBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    Dim lnLastRow As Long

    If KeyCode = 13 Or KeyCode = 32 Then 'Enter = 13, Space = 32
    With ActiveSheet
    lnLastRow = .Range("B" .Rows.Count).End(xlUp).Row
    If .Range("B" lnLastRow).Value "" Then
    lnLastRow = lnLastRow + 1
    End If
    .Range("B" lnLastRow).Value = Me.ListBox1.Value
    End With
    End If
    End Sub

    Here I have used the Double-Click event and the KeyDown event of the ListBox (in this case called ListBox1) instead of the usual Change event, so "changing" the selected item using the up/down arrows (or any alphanumeric character key) has no affect, only
    double-clicking with the mouse, or pressing Enter or Space when the ListBox is active causes the list in columnn B to be updated.
    Hope that helps.
    Cheers
    Rich

  • RELEVANCY SCORE 2.97

    DB:2.97:How To Access Bound Control ka


    I have a ListBox bound with data. I add between various controls some buttons.
    How do I get the correspondent ListItemindex when a button from inside it is clicked?

    DB:2.97:How To Access Bound Control ka


    I have a ListBox bound with data. ............How do I get the correspondent ListItemindex when a button from inside it is clicked?
    Here's a cool helper class that does for you in Silverlight what the ItemContainerGenerator does for you in WPF.

    Jim (http://jimmangaly.blogspot.com/)

  • RELEVANCY SCORE 2.96

    DB:2.96:How To Sort Listbox? dd


    I have two listboxes. One (A) with a bounded list and one (B) empty without any binding (B). Both listboxes are inside of ListBoxDragDropTarget elements. Now I want to drag elements from listbox A to the empty listbox B. How can I achieve that listbox B
    will be sorted automatically after each drop event?

    DB:2.96:How To Sort Listbox? dd

    hi,
    I am afraid, there is no build-in sort method for silverlight.
    You have to write your own or find a suitable sort method in internet.

    Best Regards,

  • RELEVANCY SCORE 2.96

    DB:2.96:Behaviour Of Combobox Vs. Listbox jk


    Hi, I'm developing a User Control with some list control (ListBox or ComboBox). When some event fires - the list becomes visible and shows data inside. If I use a combox, when I place my control inside a form, when a user open the combox box, no matter what is the control height - all the combobox options are visible even if the control is hiding other controls in the screen. However, If I use ListBox - some options in the list are not-visible, probably because my control is not high enough to present all the items. How can I make my ListBox expend itself to show all items and even hide other controls in the forms (like a combox). Thanks....

    DB:2.96:Behaviour Of Combobox Vs. Listbox jk

    It is possible, although the designer doesn't support it.  Check my code in this thread. Hans Passant.

  • RELEVANCY SCORE 2.96

    DB:2.96:How To Filter Databound Listbox Using Textbox In Vb.Net? 1z


    Hello Friends..Please help me about this. I am new in vb.net programming. I have two controls :1 textbox and 1 listbox(databound from Ms Access database) in a form. I want to filter items in listbox using textbox. When I type A in textbox, all
    items start with letter A will be display only in listbox. I found sample in a web but the items are set programmatically (ex. Listbox1.Items.Add(RBP)

    Public Class Form1

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

    ListBox1.Items.Add(RBP)
    ListBox1.Items.Add(RVM)
    ListBox1.Items.Add(KBP)
    ListBox1.Items.Add(KLT)
    ListBox1.Items.Add(IBP)
    ListBox1.Items.Add(ZBP)
    ListBox1.Items.Add(CBP)
    ListBox1.Items.Add(JBP)

    For Each item In ListBox1.Items
    ListBox2.Items.Add(item)
    Next
    End Sub

    Private Sub Textbox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles Textbox1.TextChanged
    ListBox2.Items.Clear()
    For Each item In ListBox1.Items
    If item.contains(Textbox1.Text) Then
    ListBox2.Items.Add(item)
    End If
    Next
    End Sub


    End Class
    The above example is showing that the listbox items are set programmatically. All I want is to change it to databound listbox to filter. I do not want to set items in listbox programmatically because the items displayed on my listbox is from MS Access database.

    Anyone please help me. I highly appreciate your help.

    DB:2.96:How To Filter Databound Listbox Using Textbox In Vb.Net? 1z

    Hi,
    Here is a sample using RowFilter method of DataTable to filter the data.
    Public Class Form1
    Dim dt As New DataTable
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    'generate data to bind
    Dim rand As New Random()
    Dim lst As New List(Of String)
    With dt
    With .Columns
    .Add(Item)
    .Add(Value)
    End With
    With .Rows
    For index As Integer = 0 To 10
    Dim strtemp As String = Chr(rand.Next(65, 90)) Chr(rand.Next(65, 90)) Chr(rand.Next(65, 90))
    While lst.Contains(strtemp)
    strtemp = Chr(rand.Next(65, 90)) Chr(rand.Next(65, 90)) Chr(rand.Next(65, 90))
    End While
    .Add({strtemp, index})
    Next
    End With
    End With
    With ListBox1
    .DataSource = dt
    .DisplayMember = Item
    .ValueMember = Value
    End With
    End Sub

    Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
    ListBox1.DataSource.DefaultView.RowFilter = [Item] like '% TextBox1.Text.Trim() %'
    End Sub
    End Class

    Result:

    For information about RowFilter please refer to
    DataView.RowFilter Property (System.Data) and

    Using DataView.RowFilter - Marcelo's WebLog - Site Home - MSDN Blogs
    Regards.

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click
    HERE to participate the survey.

  • RELEVANCY SCORE 2.96

    DB:2.96:Listbox With Checkbox Inside Listbox pj


    i have a requirement that i need to show a list of products and a list of countries against each product. The user should be able to select the product and the country or countries.

    here is the code that i have:

    ListBox x:Name=lbProducts Grid.Row=6 Margin=4
    ListBox.ItemTemplate
    DataTemplate
    StackPanel Orientation=Horizontal
    CheckBox x:Name=cbProducts Content={Binding ProductName} IsChecked={Binding IsSelected, Mode=TwoWay} VerticalAlignment=Center/CheckBox
    TextBlock x:Name=tbCountry Text=Country: FontWeight=Bold Margin=5,0,5,0 VerticalAlignment=Center/TextBlock
    ListBox x:Name=lbCountries Margin=5,0,0,0 Loaded=lbCountries_Loaded
    ListBox.ItemsPanel
    ItemsPanelTemplate
    StackPanel Orientation=Horizontal/
    /ItemsPanelTemplate
    /ListBox.ItemsPanel
    ListBox.ItemTemplate
    DataTemplate
    CheckBox x:Name=cbCountry Content={Binding CountryName} IsChecked={Binding IsSelected, Mode=TwoWay} Checked=cbCountry_Checked/CheckBox
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox
    /StackPanel
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox
    I have a webservice tobindall data. In the 'OnNavigatedTo' page event, iconnect to wcf web service, bind the lbProducts which has the product name and productid.
    In the event 'lbCountries_Loaded' i connect to the webservice and bind the listbox lbCountries to thedata.

    Everythingworks great.Products and countries are shown as i want.
    Problem: i want to retrieve the data for selected products and selected countries. Binding is 2 way. i get a list of selected Productsiterating through the itemsource for lbProducts. However i dont know which countries have been selected for which products.
    I tried thecbCountry_Checked event to get the datacontext of that listbox item to get the product ID but its not accesible. i get the datacontext of CountriesList.The parent for checkbox is not listbox item. so i cannot access it either. Iterating through
    Country itemsource does not help as i wont get the information of listbox.
    I am using Silverlight 4. Any tips on how to do this? any other controls i can use to acheive this? Limitation is i can only use the wcf webservice to fetch data.

    DB:2.96:Listbox With Checkbox Inside Listbox pj

    you can implement this method on the front end in your ViewModel (if you're doing MVVM) or in the binding code as well. The container class can be defined in the Silverlight side.

  • RELEVANCY SCORE 2.96

    DB:2.96:How To Get The Control Name From Datatemplate zs


    hi i got a listbox which defined inside the datetemplate
    how do i get the listbox name in the code behind?Change

  • RELEVANCY SCORE 2.95

    DB:2.95:How To Retrieve Checkbox Inside Wpf Listbox? cj


    Friends, I have a ListBox control in my Window1.xaml as follows:

    DB:2.95:How To Retrieve Checkbox Inside Wpf Listbox? cj

    Then you will have to create your own data object:
    public ObjectSelectionT
    {
    public ObjectSelection(T object, bool isSelected)
    {

    }

    public T MyObject { get; private set; }

    public bool IsSelected { get; private set; }
    }
    At the time the data is populated in your Window (it's not a Form, it's a Window), you can create a collection of ObjectSelect items and have both the actual EF data and the IsSelected property. The T should be the type of the EF entity (or the base class of
    all you entities, worst case object).Geert van Horrik -
    CatenaLogic
    Visit my blog:
    http://blog.catenalogic.com

    Looking for a way to deploy your updates to all your clients? Try
    Updater!

  • RELEVANCY SCORE 2.95

    DB:2.95:Como Redimensionar Um Controle Dentro Do Listbox // Resizing A Control Inside The Listbox? 7j


    Como redimensionar um controle dentro do Listbox?
    Criei um ListBox que carrega uma lista de UserControls customizados, o ListBox redimensiona sua largura corretamente porém os meus controles não estão acompanhando o redimensionamento do ListBox.
    Os controles possuem um Grid onde posiciono seus componentes mas ele não está preenchendo toda largura da linha do ListBox.
    Gostaria de saber se existe alguma maneira de capturar o ActualWidth do ListBox e passar para o controle dinâmicamente?
    ===========//===========
    Resizing a control inside
    the Listbox?

    I created a ListBox that
    loads a list of custom
    UserControls, the ListBox resize
    the width correctly but my
    controls are not following the
    resizing of the ListBox.

    The controls have a grid
    where do I position components but it
    is not filling the entire width of the
    line of the ListBox.

    I wonder if there is any way
    to capture the ActualWidth the
    ListBox control and move to the
    dynamically?

    DB:2.95:Como Redimensionar Um Controle Dentro Do Listbox // Resizing A Control Inside The Listbox? 7j

    Yes, I had
    forgotten to add the reference. Now I'll try apply your solution!
    Thanks.

  • RELEVANCY SCORE 2.94

    DB:2.94:Focus On First Control Inside Listbox k1


    I have textbox controls inside listbox.I have an application in which when I click on Add button it adds one item to Listbox collection.

    Now What i want to do is to set focus on first textbox of Listbox collection when i click on Add button. I tried with selected item and selected Index but its not working. So is there any other way to perform this?

    public class SetFocusTrigger : TargetedTriggerActionControl
    {
    protected override void Invoke(object parameter)
    {
    if (Target == null) return;

    Target.Focus();
    }
    }

    DB:2.94:Focus On First Control Inside Listbox k1

    I have textbox controls inside listbox.I have an application in which when I click on Add button it adds one item to Listbox collection.

    Now What i want to do is to set focus on first textbox of Listbox collection when i click on Add button. I tried with selected item and selected Index but its not working. So is there any other way to perform this?

    public class SetFocusTrigger : TargetedTriggerActionControl
    {
    protected override void Invoke(object parameter)
    {
    if (Target == null) return;

    Target.Focus();
    }
    }

  • RELEVANCY SCORE 2.94

    DB:2.94:How To Get Access To An Element Inside A Datatemplate? dx



    I have a DataTemplate
     
            DataTemplate x : Key =itemTemplate
                StackPanel Orientation =Horizontal
                    Label Content =First Name: /
                    TextBox x : Name =txtFirstName Text ={ Binding XPath =FirstName} /
                    Label Content =Last Name: /
                    TextBox x : Name =txtLastName Text ={ Binding XPath =LastName} /
                / StackPanel
             / DataTemplate
     
    Using the template for ListBox items
     
    XmlDataProvider x : Name =xmlDataProvider XPath =Sections /
     
    ListBox x : Name =lbPeople ItemsSource ={ Binding XPath =People /Person}
    ItemTemplate ={ StaticResource itemTemplate }
    IsSynchronizedWithCurrentItem =True
    Visibility =Visible SelectionMode =Single
    / ListBox
     
    I need to change person’s name programmatically.
    How can I get access to txtFirstName ?  

    DB:2.94:How To Get Access To An Element Inside A Datatemplate? dx

    Hi Tao Liang , Does collection has to be only ObservableCollection?
    ListT will also be ok

  • RELEVANCY SCORE 2.94

    DB:2.94:Listbox Items Iteration jz


    Hi,
    I want to iterate all the elements of a listbox control. Inside the loop, I want to get the IsChecked value of the checkbox inside the data template. How do we do so?
    ListBoxx:Name=lstLanguages
    ListBox.ItemTemplate
    DataTemplate
    CheckBoxContent={BindingName}/
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox

    thanks!

    DB:2.94:Listbox Items Iteration jz

    I agree with the IsChecked databinding scenario (mentioned above). Your class can have a bool that stores the Checked property. You can loop through your collection to see which items are checked.
    If you want to check if the physical checkboxes are checked, you will need to find the checkboxes in the DataTemplate.
    http://forums.silverlight.net/forums/p/194688/452132.aspx

  • RELEVANCY SCORE 2.94

    DB:2.94:Listbox In Access kz


    So I have a Microsoft Access Database, and inside that want to create a listbox control on my table, so that I can then have a ListBox on my form with the information from the ListBox in the Access Database.

    DB:2.94:Listbox In Access kz

     
    Hi Mike,
    I am not sure about what you want to do. Did you want do it in Microsoft Access? If so, you can ask you question on this forum:
    ·         http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=74SiteID=1
    Or if you want to do it in your application, you can get the items from the Access database using ADO.NET, and then bind these items to a ListBox. Please check the following link on how to get data from Access database.
    ·         http://msdn2.microsoft.com/en-us/library/dw70f090(VS.80).aspx
    ·         http://msdn2.microsoft.com/en-us/library/ms971485.aspx
    Hope this helps.Best regards and Happy New Year.Rong-Chun Zhang

  • RELEVANCY SCORE 2.94

    DB:2.94:Accessing Content Of Datatemplate In Codebehind fc


    Hi all,
    I am using pivot control in my windows phone 7 application.....Its contents are binded...Inside it there is a listbox. But i cannot access the listbox in codebehind as listbox is inside the datatemplate. Can anyone help me how can i access the listbox in
    codebehind? I have copied code for reference.

    controls:Pivot
    controls:Pivot.ItemTemplate
    DataTemplate
    Grid
    Grid
    StackPanel
    StackPanel Margin=0,0,0,51
    ListBox ItemsSource={Binding CategoryContent} Height=500 Width=500
    ListBox.ItemTemplate
    DataTemplate
    .........
    ...........
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox
    /StackPanel
    /StackPanel
    /Grid
    /DataTemplate
    /controls:Pivot.ItemTemplate
    /controls:Pivot

    DB:2.94:Accessing Content Of Datatemplate In Codebehind fc

    In general you really really want to avoid directly accessing template controls. The idea is to bind the controls to an underlying data object and work with updates to that object.

  • RELEVANCY SCORE 2.93

    DB:2.93:Unable To Find The Grid Cell Position On Drop(Using Dragdroptarget Controls) 18


    hi all,
    my requirement is like, i want to drag and drop controls on to the grid. in order to do that, i am making use of silverlight dragdroptarget controls.
    i am using listbox as toolbox and wrappanel as control holder. wrappanel is wrapped by paneldragdroptarget control. where as my listbox is wrapped with listbox dragdrop target control.
    inside my wrap panel , i have placed a grid for holding the controls in a structural manner.
    now, i am able to drag controls from my listbox to the gridsuccessfully.right now, i am providing the cell position statically. i wanted to define the position automatically.
    finally, i need your help to identify the cell position while you are dropping onto it.
    Please let me know if i have confused you or need bit more clarity from me.!!
    thanks in advance.
    Vamsi Krishna.

    DB:2.93:Unable To Find The Grid Cell Position On Drop(Using Dragdroptarget Controls) 18

    hi all,
    my requirement is like, i want to drag and drop controls on to the grid. in order to do that, i am making use of silverlight dragdroptarget controls.
    i am using listbox as toolbox and wrappanel as control holder. wrappanel is wrapped by paneldragdroptarget control. where as my listbox is wrapped with listbox dragdrop target control.
    inside my wrap panel , i have placed a grid for holding the controls in a structural manner.
    now, i am able to drag controls from my listbox to the gridsuccessfully.right now, i am providing the cell position statically. i wanted to define the position automatically.
    finally, i need your help to identify the cell position while you are dropping onto it.
    Please let me know if i have confused you or need bit more clarity from me.!!
    thanks in advance.
    Vamsi Krishna.

  • RELEVANCY SCORE 2.93

    DB:2.93:How Do I Get Information From Controls On My Form In Another Class? 9z


    Alright so I have a listBox on my main form and my end goal is to be able to write all of these to a .txt file. But I want to do all that in a new class. How do I access my listBox through the new class?

    DB:2.93:How Do I Get Information From Controls On My Form In Another Class? 9z

    The more common approach is the other way around. Your UI should access your class.
    So you could build a List of items using the List generic class and pass that list to the new class so it can write them to a .txt file.
    Hope this helps.www.insteptech.com ;
    msmvps.com/blogs/deborahk
    We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!

  • RELEVANCY SCORE 2.93

    DB:2.93:Pix Inside To Inside Access x9



    How to access the Inside web server from the host in inside network.

    DB:2.93:Pix Inside To Inside Access x9


    www.cisco.com/warp/customer/110/alias.html

  • RELEVANCY SCORE 2.92

    DB:2.92:How To Style A Listbox With Itemtemplate, Databinding And Different States Across Individual Controls In The Itemtemplate? p9


    Hi there
    Please could someone help with sample code or an idea of how to create this scenario:
    I have a listbox which is databound to a datasource, and contains different controls within the itemtemplate e.g. textblock, button, which have certain properties bound (e.g. Text, Content, Visibility etc).
    I need to style the listbox and listboxitems to a certain defined style created by our graphics people (PSD). The listbox items need to have a normal and mouseover state, which need to INCLUDE the controls in the itemtemplate e.g. the background of the row/item
    needs to change colour but SO DOES the foreground of the textblock.
    I thought I would create the ListBox, databind it, create the itemtemplate with the controls and databind them (all in my xaml page so that I can bind them easily to my data objects on that page), then create the 2 styles (in App.xaml so that they can be
    reused for other listboxes)and it would work. Which it does, until you want to modify the states in the style, because you don't have access to individual controls, only a ContentPresenter.
    Please can someone give me a working example of the proper way to do this?
    Thanks so much,
    Debbie

    DB:2.92:How To Style A Listbox With Itemtemplate, Databinding And Different States Across Individual Controls In The Itemtemplate? p9

    One way that comes to mind for you to get nice custom per-type behavior of the elements in a listbox would be to create a custom listbox class and override prepareContainerForItemOverride:
    http://msdn.microsoft.com/en-us/library/system.windows.controls.listbox.preparecontainerforitemoverride(VS.95).aspx

    In there you can apply specific styles on a per item-type basis as necessary for your app. I'm not sure what you mean by 'modify the states in a style' but maybe this helps?

  • RELEVANCY SCORE 2.92

    DB:2.92:Can We Add Input Controls In Datatemplate Applied To A Listbox dx


    hi All,
    I add a user control inside a stackpanelon a button click .
    This functionality i want to replace by Listbox having a datatemplatesame as that of the user controland a button click will apply this template to next row in Listbox so that next row will be displayed and i canaddinput in that datatemplate .
    basically i want to avoid adding number of user controls which are performaing as a input form in my application fordifferent resources.
    -Priyanka

    DB:2.92:Can We Add Input Controls In Datatemplate Applied To A Listbox dx

    Hi:
    Could you clarify your requirement? I'm not sure what do you mean.
    Thanks

  • RELEVANCY SCORE 2.91

    DB:2.91:All Controls/Forms/Menu/Submenu Names In A Listbox ak


    Hi,
    I m using VS2005
    For better user management I want set user access to specific menu/subment/controls etc.
    Now Is there any option to get All controls/forms/menu/submenu names in a listbox of a project whether the form is open or close. All forms all controls in a list box.
    please help meShakhawat

    DB:2.91:All Controls/Forms/Menu/Submenu Names In A Listbox ak


    Hi,
    I m using VS2005
    For better user management I want set user access to specific menu/subment/controls etc.
    Now Is there any option to get All controls/forms/menu/submenu names in a listbox of a project whether the form is open or close. All forms all controls in a list box.
    please help me

    Shakhawat

    I think you can create a table in your database for this settings or saved it as a settings file in the local file(such as a xml file, a txt file or any other files). if the user set them, save them into database/local file and load it into the listbox. In
    this way, there is no need to consider that you should keep these settings in memory and how to pass them form one form to another form. Just read them!
    Best RegardsNeddy Ren [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • RELEVANCY SCORE 2.91

    DB:2.91:How To Access A Control Present Inside A Datatemplate Of Listbox In Metro App? xx


    i am developing a windows 8 metro app in which i have listbox which contains a set of textblocks and a Image.
    ListBox x:Name=lstbxbStudents Background=Transparent ItemContainerStyleSelector={StaticResource ItemStyleSelector} ScrollViewer.VerticalScrollBarVisibility=Auto ItemTemplate={StaticResource LandscapeItemTemplate} Height=476 SelectionChanged=lstbxbProducts_SelectionChanged_1 Style={StaticResource ListBoxStyle1} HorizontalAlignment=Left Width=901
    /ListBox

    For that image ImgCmt i have set the source of the Image static inside the datatemplate of the listbox.
    CollectionViewSource x:Name=cvs2 IsSourceGrouped=true /
    !-- TODO: Delete this line if the key AppName is declared in App.xaml --
    x:String x:Key=AppNameStudents Screen/x:String

    DataTemplate x:Key=LandscapeItemTemplate
    StackPanel Orientation=Horizontal
    StackPanel Width=30/StackPanel
    StackPanel Width=120 Orientation=Horizontal
    TextBlock Text={Binding stunum} VerticalAlignment=Center HorizontalAlignment=Left /
    /StackPanel
    StackPanel Width=350
    TextBlock Text={Binding studsc} HorizontalAlignment=Left /
    /StackPanel
    StackPanel Width=10/StackPanel
    StackPanel Width=100
    TextBlock Text={Binding stuum} x:Name=txtblkstuum HorizontalAlignment=Left /
    /StackPanel
    StackPanel Width=150
    TextBlock Text={Binding stugrp} VerticalAlignment=Center TextAlignment=Right HorizontalAlignment=Center /
    /StackPanel
    StackPanel Width=100
    TextBlock Text={Binding stusection, Mode=TwoWay} TextAlignment=Center x:Name=txtbxbstusection Tag={Binding stunum} VerticalAlignment=Center HorizontalAlignment=Right /
    /StackPanel
    StackPanel Width=50/StackPanel
    StackPanel
    Image Source=Assets/comments.png Name=ImgCmt PointerPressed=Image_PointerPressed_1 VerticalAlignment=Center Width=20 Height=20/Image
    /StackPanel
    /StackPanel
    /DataTemplate

    /Page.Resources

    my objective is that i want to change the source of the image to different image source(change the image) in codebehind depnding upon some condition for that i need to access the control present inside a datatemplate of listbox in metro app ???

    How can i do this :-

    1)How to access a control present inside a datatemplate of listbox in metro app ???

    2)What are the different ways in which i can do this ??

    3)How can i change the source of the image to different image source(change the image) in codebehind depnding upon some condition ??

    Please help me out.

    Looking forward for your response.

    DB:2.91:How To Access A Control Present Inside A Datatemplate Of Listbox In Metro App? xx

    You can find control and set the image source (check
    this one for implementation details), but this should be kept as last option. In your case you can use simple DataBinding to set the image source from app and local folder location.
    Code will be something like this
    Image Source={Binding ImageUri} Height=60 Width=60/
    Public Property inside data model
    public Uri ImageUri { get; set; }

    Filling this property somewhere in your code (it is from localfolder, you can use ms-appx for app location)
    Items.Add(new GridVwItem() { ImageUri = new Uri(ms-appdata:///local/Logo.png), Txt=1 });

    For exact code refer
    this post (code is for GridView but concept is same for ListBox too).
    Thanks,

  • RELEVANCY SCORE 2.91

    DB:2.91:Accessing Controls Inside A Datatemplate From Codebehind ak


    Hello All,
    How to access a control inside a datatemplate in codebehind in a panoroma control.
    i want the controls to get loaded on the start of the application.
    here is my mark up...
    controls:PanoramaItem Header=test
    ListBox ItemsSource={Binding Items}
    ListBox.ItemTemplate
    DataTemplate
    StackPanel
    TextBlock x:Name=txtName/
    local:ucTemplateGrid x:Name=gvMainTemplate /
    /StackPanel

    /DataTemplate

    /ListBox.ItemTemplate

    /ListBox

    /controls:PanoramaItem
    pls let me know how to access these controls and load the controls from code behind...

    DB:2.91:Accessing Controls Inside A Datatemplate From Codebehind ak

    Hello
    I want to read the value of textblock and display it into anoter page how?
    ListBox Name=ContactHistoryData ItemsSource={Binding} Height=469 Margin=24,0,0,0 Tap=ContactHistoryData_SelectionChanged_1

    ListBox.ItemTemplate
    DataTemplate
    Grid
    Grid.ColumnDefinitions
    ColumnDefinition Width=70/
    ColumnDefinition Width=*/
    /Grid.ColumnDefinitions
    Border Margin=5 BorderThickness=2 BorderBrush={StaticResource PhoneAccentBrush}
    Image Source=Assets/call.png Width=48 Height=48 Stretch=Fill /
    /Border
    StackPanel Grid.Column=1 Margin=5
    StackPanel Orientation=Horizontal
    TextBlock Text={Binding Path=RemoteParty} FontSize={StaticResource PhoneFontSizeLarge} Margin=18,8,0,0/
    !--TextBlock Text={Binding Path=Status} FontSize={StaticResource PhoneFontSizeSmall} Margin=18,8,0,0/--
    /StackPanel
    TextBlock Text={Binding Path=StartTime} FontSize={StaticResource PhoneFontSizeSmall} Margin=18,8,0,0/

    /StackPanel

    /Grid

  • RELEVANCY SCORE 2.91

    DB:2.91:Listbox Scrollbar Moved Event cs


    Hi,
    Does anyone know how do I access scrolbar inside the listbox in silverlight for windows embedded?
    I use WEC7

    Regards,
    Luka

    DB:2.91:Listbox Scrollbar Moved Event cs

    Hi,
    Does anyone know how do I access scrolbar inside the listbox in silverlight for windows embedded?
    I use WEC7

    Regards,
    Luka

  • RELEVANCY SCORE 2.91

    DB:2.91:How To Find Checkbox Controls In Listbox? p8


    my code:
    ListBox x:Name=lstCourse Grid.Row=1 Grid.Column=2
    ListBox.ItemTemplate
    DataTemplate
    StackPanel Orientation=Vertical
    CheckBox x:Name=chkCourse Content={Binding CourseName} Margin=5 Tag={Binding CourseId}/CheckBox
    /StackPanel
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox

    i use DataTemplate to display content.how to find checkbox controls in listbox?how to use listboxitem?i use lstCourse.Itemsreturn IList interface not listboxitem class.Thanks.
    behind code use listbox's itemsSource property
    void soapClient_GetCoursesByProductAndTermCompleted(object sender, GetCoursesByProductAndTermCompletedEventArgs e)
    {
    if (e.Error == null)
    {
    OnlineTestService.CourseTable[] courseTables= e.Result;
    lstCourse.ItemsSource = courseTables;
    }
    }

    DB:2.91:How To Find Checkbox Controls In Listbox? p8


    His (and my problem) ishe can't iterate through the list of checkboxes to see what is checked. I am getting around this by linking IsChecked to a bool in my data object (two way). Im not sure i want the data associated like this as the list is
    a simple lookup table whereas the data is going into a different object on save.

    Also, if it's not the clicked checkbox is what is needed for post processing, but another control's (say, textbox) value in the same row, then getting the checkbox is not enough... Is there a way to get to the controls in the template directly?
    cheers
    vitya

  • RELEVANCY SCORE 2.90

    DB:2.90:Accessing Combobox Inside A Datatemplate Of A Listbox From C# Code Behind In Metro Application? xp


    i have acombo box present inside alist-box , listbox has a datatemplate in which this combobox and other elements resides .

    ListBox x:Name=lstbxbProducts HorizontalAlignment=Left Height=547 Margin=0,221,0,0 VerticalAlignment=Top Width=1044 RenderTransformOrigin=0.600000023841858,0.5
    ListBox.ItemTemplate
    DataTemplate
    StackPanel Orientation=Horizontal
    StackPanel Width=80 Orientation=Horizontal
    TextBlock Text={Binding prdnum} VerticalAlignment=Center HorizontalAlignment=Left /TextBlock
    TextBlock Text= - VerticalAlignment=Center HorizontalAlignment=Left /TextBlock
    /StackPanel
    StackPanel Width=400
    TextBlock Text={Binding prddsc} VerticalAlignment=Center HorizontalAlignment=Left /TextBlock
    /StackPanel
    StackPanel Width=300
    ComboBox Name=cmbbxbUMselec ItemsSource={Binding} Width=200 FontSize=24 VerticalAlignment=Center HorizontalAlignment=Center /ComboBox
    /StackPanel
    StackPanel Width=180
    TextBlock Text={Binding prcby_prc} VerticalAlignment=Center HorizontalAlignment=Center /TextBlock
    /StackPanel
    StackPanel Width=100
    TextBox Text={Binding stdordqty, Mode=TwoWay} VerticalAlignment=Center TextAlignment=Center
    HorizontalAlignment=Right /TextBox
    /StackPanel

    /StackPanel
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox

    My doubt is that i am not able access the combobox present inside a the datatemplate of the listbox ,
    i want to bind a list to the combobox from c# codebehind
    cmbbxbUMselec.DataContext = lstumcods;
    in this way from code behind but i am not able access the combobox present inside a the datatemplate of the listbox
    Please let me know how can i work around this.
    Thanks in advance

    DB:2.90:Accessing Combobox Inside A Datatemplate Of A Listbox From C# Code Behind In Metro Application? xp

    Was this answered correctly? I'm not sure if I have a similar issue or a different issue. I also want to bind to a combobox inside of a list box. The XAML page has a datacontext associated with it. I will call it MyVM. The
    MyVM contains two lists. The first is the itemsSource for the listbox, I'll call it lblist. The second is the itemsSource for the combobox, I'll call it cblist.
    In WPF, I am setting the ItemsSource for the ListBox to lblist. Doing that means that the following XAML for the combobox doesnt' work:
    ComboBox ItemSource={Binding Path=cblist, mode=TwoWay, . . . } Instead I have to use:
    ComboBox ItemSource={Binding Path=DataContext.cblist, RelativeSource={RelativeSource AncestorType={x:Type UserControl}},
    My problem, is that windows store apps don't appear to support the RelativeSource={RelativeSource AncestorType=, . . ..

    How do I bind to an item in the DataContext when it is different from theListBox ItemsSource?
    ThanksRobotuner

  • RELEVANCY SCORE 2.90

    DB:2.90:Access Asp.Net Controls Inside Static Methods 3m


    Need to access web controls inside static methods????? Help...

    DB:2.90:Access Asp.Net Controls Inside Static Methods 3m

    This is a training and certification forum. As your question relates to neither of these, it will be moved to the Off-topic forumWhen you see answers and helpful posts, please click Vote As Helpful,
    Propose As Answer, and/or Mark As Answer

    Jeff Wharton
    MSysDev (C.Sturt), MDbDsgnMgt (C.Sturt), MCT, MCPD, MCSD, MCITP, MCDBA
    Blog: Mr. Wharty's Ramblings
    Twitter: @Mr_Wharty
    MC ID:
    Microsoft Transcript

  • RELEVANCY SCORE 2.90

    DB:2.90:How To Update Listbox From An Array ? x3



    Hello,
    I would like to update a listbox (CVI user interface) from TestStand FileGlobals array variable. I'm successfully using the function TS_ExchangePropertyAndCtrlVals for other user interface controls, but I guess I have a problem when trying to get values from an array to listbox. Does this function support listbox control ? If not, how I could update an array to listbox ? Or, is there any other way to handle an TestStand array in CVI operator interface ? I would not like to usean ActiveX control for now.
    Regards,
    Petri

    DB:2.90:How To Update Listbox From An Array ? x3

    Thanks Ray,

    I probably wroteunclearly my question. Actually I don't have any problem to usea dll from TestStand including transferring array contents to dll, and I have no problems to update CVI user interfaceexcept the list box. I was wondering if there is a simple way to update a list box from an array, similar to the function TS_ExchangePropertyAndCtrlVals using the PropertyMap, or is the only wayto do thejob as described in the examples you mentioned.

    I'm using TS v3.5.

    Regards,

    Petri

  • RELEVANCY SCORE 2.90

    DB:2.90:How Do I Copy The Words Out Of My Listbox? 8f


    I want to copy the words that appear inside a listbox to a Document.txt?
    A listbox seems to be read-only. How do I change this?

    DB:2.90:How Do I Copy The Words Out Of My Listbox? 8f

    Or another example
    Public Class Form1    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click        Dim s As String =         For Each x As String In Me.ListBox1.Items            s = s x vbCrLf        Next        My.Computer.FileSystem.WriteAllText(Foo.txt, s, False) '//This writes the file foo.txt with contents.    End SubEnd Class
     
    If you only want selected items then use the following line instead
            For Each x As String In Me.ListBox1.SelectedItems

  • RELEVANCY SCORE 2.90

    DB:2.90:How To Access A Nested Listbox Selected Index? 7d


    Hi,
    I have Nested listbox in ListBox control, While Click on Selected item i have to do few things to display via childwindow
    Same things i needs to do with Next Back Buttons,
    While clicking on Next or Back Button it will be change Listbox Selected Item display childwindow,it's working in simple listbox
    control.
    but i can not do this with Nestedlistbox.
    Thanks

    DB:2.90:How To Access A Nested Listbox Selected Index? 7d

    Hi,
    Use Observable colletion.
    Make sure that you have binded the Observable colletion list to both the Outer and Inner listbox.
    So if you dont get the Nestedlistbox then just update the list which is binded to inner list which inturn automatically changes are reflected back to Ui of nested listbox.
    Mark as answer if this post helps you.

  • RELEVANCY SCORE 2.90

    DB:2.90:Listbox With Embedded Controls - Invoke Item Changed cd


    Hi, I have a listbox whereby the listboxitems contain other controls (combobox, Textedit, etc). Selecting on of the contained controls does not invoke an item changed event (btw: I'm using the MVVM pattern with a SelectedItem property to which the SelectedItem
    is bound). This only happens if I select outside of the controls in the listboxItem row itself.

    How would I do this. Thanks!

    -- xavier

    DB:2.90:Listbox With Embedded Controls - Invoke Item Changed cd

    Hi,
    I wonder if your comboBox and TextEdit(?is that from a third party component) is binded to the same itemsource as your listbox. I think only in this way, can it invoke item change event.

    Best Regards,

  • RELEVANCY SCORE 2.89

    DB:2.89:Double Click On Listbox Control ak


    hi!
    can i disable double-click on listbox control? i've noticed that if i set control (listbox/datagrid) to use readonly controls, datagrid respects that, but listcontrol not (eg. doubleclick on listbox opens modal edit entity and datagrid not).. is this bug?
    how can i make entity to be read-only just for particular screen?
    Thanks!
    Kivito

    DB:2.89:Double Click On Listbox Control ak

    Hi. I had the same issue and checked the MS response to your bug report. While I don't think that their answer was clear, they did point out the fix in a roundabout way. If you delete the Add, Edit, and Delete buttons from the List Command Bar (don't just
    make the buttons Not Visible) the List is no longer editable with a double-click. Just what you would have expected with the Read-Only setting.4tuneate

  • RELEVANCY SCORE 2.89

    DB:2.89:Accessing Objects/Controls In Calling Form 1j


    Hi!I got this class User() and when the mainForm has validated that the user exist it creates a new object User().Now i want within the class code of User, be able to access a listbox in the mainForm. How do i managade to do that?Should i pass a reference to the mainForm to the User-class when the User constructor is called?I want to send som text from the UserClass to the the mainForm's listbox......

    DB:2.89:Accessing Objects/Controls In Calling Form 1j

    Come to think of it, timvw is correct. Although the dependency issue may not be much of a concern in a small application with only a few classes, if there's even the slightest change the application would grow, creating an event would be best.
     
    Here's an example like what Tim suggested:
     

    Code Snippet

  • RELEVANCY SCORE 2.89

    DB:2.89:How To Get Controls Of Dmf Elements In The Java Script ds


    Hi to all, Give any example how to get controls of dmf form elements into the javascript(for textbox,radiobuttons,listbox etc)Thanks in advanceRamu

    DB:2.89:How To Get Controls Of Dmf Elements In The Java Script ds

    Hi,From WDK Developement Guide,Getting a control by ID in JavaScriptIn the following example from advSearch.jsp, a text control is given an ID: dmf:text name='location' id='location' size='70' defaultonenter='true' tooltipnlsid="MSG_LOOK_IN" /
    The control is retrieved in JavaScript in the same page using the JavaScript function document.getElementById():script
    if (document.getElementById("location") != null)
    document.getElementById("location").focus();
    /script
    Please refer the WDk Development Guide for more informatio.Regards,Prabhu

  • RELEVANCY SCORE 2.89

    DB:2.89:Cannot Use A Control Defined In A Template In The Code Behind k3


    Hi,
    I have some controls (button, textbox) defined in the data template of a listbox (in fact in the template of the lisbox items). When I want to interact with these controls in the code behind (for example if I want to set myTextBox.Text = blabla;)their
    given names don't appear with intellisense and VS throws an error (the name myTextBox doesn't exist in the current context).
    How can I have access to these controls in mymain class?

    DB:2.89:Cannot Use A Control Defined In A Template In The Code Behind k3


    void btnLoadVideo_Click(object sender, RoutedEventArgs e)
    {
    Button btn = (Button)sender;
    Person p = btn.DataContext as Person;
    // get the property you want for load video
    }

  • RELEVANCY SCORE 2.88

    DB:2.88:How To Set New Location And Size To The Controls Inside The Tabpages(Not Created Dynamically) 8x


    I have a TabControl and it has two tabpages. (every tabPages have a lot of controls like label,panel, datagridview etc. created manually from toolbox of VS) Now what i want to do?
    when a button click;
    TabControl will set its location to a new point and its width and height size will be larger so the controls like TabPage1 or TabPage2 and their controls mentioned above will set its locations and size.

    i write a code to access the controls (buttons,labels etc) inside the tabPages like this;
    tabControl1.TabPages[0]..... but it gives exception when writing like this tabControl1.TabPages[0].button1 ?
    what is the reason? Or how can i access the controls inside the tabpages?

    DB:2.88:How To Set New Location And Size To The Controls Inside The Tabpages(Not Created Dynamically) 8x

    Use the Anchor or Dock properties on [each of] the child Controls so that they adjust their size relative to the Tab Page on which they are placed.
    Or, use the Layout event on the Tab Page to rearrange the child Controls by hand.
    Regards, Phill W.

  • RELEVANCY SCORE 2.88

    DB:2.88:Listbox Partial Access ps


    My listBox is defined as an ItemTemplate that contains some controls like TextBlock and Image.
    There is a way to insert a url link to TextBlock or Image in order to allow user jump to the link ?

    Thanks
    Fred

    DB:2.88:Listbox Partial Access ps

    My listBox is defined as an ItemTemplate that contains some controls like TextBlock and Image.
    There is a way to insert a url link to TextBlock or Image in order to allow user jump to the link ?

    Thanks
    Fred

  • RELEVANCY SCORE 2.88

    DB:2.88:Vertical Scrolling With Nested Listboxes 3k


    Hi,
    I have an application where I need to display multiple horizontal ListBox controls dynamically inside some layout control. Each ListBox scrolls horizontally. I need the containing control to show a vertical scroll bar when the number of ListBoxes exceed
    the page size.
    I tried using a ListBox as a layout container (vertical by default) to contain these rows of ListBoxes, but it doesn't seem to honor the ScrollViewer.VerticalScrollBarVisibility=true when the number of horizontal listboxes flow out of the browser window.

    ListBox x:Name=ContainerListBox
    ScrollViewer.VerticalScrollBarVisibility=Auto
    !--Dynamic horizontal listboxes go here--

    /ListBox
    Can anyone help?
    Thanks
    Anand

    DB:2.88:Vertical Scrolling With Nested Listboxes 3k

    Wrapping it inside a grid and removing all explicit settings related to scrollbars worked...

    Thanks

  • RELEVANCY SCORE 2.87

    DB:2.87:How To Bind Dataset Or Datatable To Views Controls ? af


    Hello,
     
    Est-ce possible d'avoir un exemple simple de grille ou Listbox dans une PartView bindée avec un DataTable ou un DataSet dans un Part? Merci
     
    Is it possible to have a simple sample with a Grid or ListBox in a PartView Binded to DataTable or DataSet in Part ( IE : AdventureWorks.HumanResources.Employee) .
    I have a DataSet and DataTable (inside Part) with corrects datas, but I dont know how to bind these to View control.
     
    Thanks in advance
    Patrick

    DB:2.87:How To Bind Dataset Or Datatable To Views Controls ? af

    Hi Alex
     
    Just before your answer I tried to use a ComponentProperty and get the datas by code (foreach row in ...)  on the ListBox_onload event : that run fine, but your solution seem more easy.
    In second step I will try to use the DataComponents (provider, updater), but for the moment, the documentation is very poor.
    Sorry for my english and much Thank for your reply
     
    Patrick
     
     
     

  • RELEVANCY SCORE 2.87

    DB:2.87:Select Listbox Programatically 3k


    Hi,
    I have a button inside of a listbox datatemplate.When I click on the button, the button gets focus. However, the listbox is not selected. Is it possible to programtically set the listbox to be selected/focused in GotFocus handler of the button. I don't
    have direct access to the listbox because it's also part of another template.
    Thanks in advance!

    DB:2.87:Select Listbox Programatically 3k

    if the button is in the same visualtree such as a grid/border/stackpanel you could go up the visual tree to that point and find your listbox and do what you want with it. you could use the visual tree helper, look at VisualTreeHelper

  • RELEVANCY SCORE 2.87

    DB:2.87:New Tabpage With New Listbox Inside It mj


    Dear ALL How to make a button that creates a new TabPage with a new ListBox inside it ? Thanks in Advance

    DB:2.87:New Tabpage With New Listbox Inside It mj

    Thanks Amal Barak Allah Fiki You helped me alot

  • RELEVANCY SCORE 2.87

    DB:2.87:Access A Control Placed Inside Header Template Of A Datagrid In Wpf 1k


    Hi,
    I have a requirement to add filters to a datagrid. I have placed the filter controls in the headertemplate of a datagrid. How can I access these controls in code behind?I need to set itemsource for the listbox placed in header template through code
    behind on the basis of certain selections by user. Following is my data template(resource template)for header column.

    DataTemplate x:Key=buttonResourceTemplate
    StackPanel Name=spResource FlowDirection=LeftToRight Orientation=Horizontal
    TextBlock Text=Resource Name/TextBlock
    ToggleButton Name=btnResourceFilter IsChecked=False Height=20px Width=30px
    Image Source=image\filter.ico/Image
    /ToggleButton
    Popup Name=popupResource IsOpen={Binding ElementName=btnResourceFilter,Path=IsChecked} PlacementTarget={Binding ElementName=btnResourceFilter} PopupAnimation=Slide Height=300px Width=200px Closed=popupResource_Closed
    StackPanel Background=White
    CheckBox x:Name=ChkResourceAll IsChecked=True Content=Select All Foreground=Black Height=20px FontWeight=Bold Checked=ChkResourceAll_Checked Unchecked=ChkResourceAll_Unchecked /CheckBox
    ListBox Name=lstResource ItemsSource={Binding Path=Resource} Initialized=lstResource_Initialized Height=280px
    ListBox.ItemTemplate
    DataTemplate
    CheckBox x:Name=chkResource
    IsChecked={Binding ElementName=ChkResourceAll,Path=IsChecked,Mode=OneWay,NotifyOnTargetUpdated=True}
    Content={Binding ResourceName}
    Width=100
    Checked=chkResource_Checked
    Unchecked=chkResource_Unchecked
    TargetUpdated=chkResource_TargetUpdated
    Initialized=chkResource_Initialized /
    /DataTemplate
    /ListBox.ItemTemplate
    ListBox.Resources
    SolidColorBrush x:Key={x:Static SystemColors.HighlightBrushKey}
    SkyBlue
    /SolidColorBrush
    /ListBox.Resources
    /ListBox
    /StackPanel
    /Popup
    /StackPanel
    /DataTemplate

    DB:2.87:Access A Control Placed Inside Header Template Of A Datagrid In Wpf 1k

    my:DataGrid AutoGenerateColumns=False CellEditEnding=dgvProductInfo_CellEditEnding ItemsSource={Binding Eproduct, Mode=TwoWay} Margin=19,3,6,35 SelectionChanged=dgvProductInfo_SelectionChanged Name=dgvProductInfo
    my:DataGrid.Columns
    my:DataGridTextColumn Header=Product Width=150 IsReadOnly=True Binding={Binding productName}/
    my:DataGridTextColumn Header=Unit IsReadOnly=True Width=60 Binding={Binding unit}/
    my:DataGridTextColumn Header=sales Qty IsReadOnly=True Width=62 Binding={Binding quantity,NotifyOnValidationError=True,
    ValidatesOnExceptions=True }/
    my:DataGridTemplateColumn Header=Bin Width=*
    my:DataGridTemplateColumn.CellTemplate
    DataTemplate
    ComboBox Margin=2 Name=CmbDGV ItemsSource={Binding
    BinInfo } DisplayMemberPath=BinCode SelectedItem=Binding dgvProductInfo,Path=SelectedItem.BinCode,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay SelectedValuePath=BinCode SelectionChanged=CmbDGV_SelectionChanged/
    /DataTemplate
    /my:DataGridTemplateColumn.CellTemplate
    /my:DataGridTemplateColumn

    /my:DataGrid.Columns
    /my:DataGrid

    Inside a datagrid template colum i used a combobox control and access that using below code:
    private void CmbDGV_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {

    ComboBox s = (ComboBox)e.Source;
    EbinInfo ss = (EbinInfo)s.SelectedItem;
    }

    You try on this way

  • RELEVANCY SCORE 2.87

    DB:2.87:Switching Animation Between Listboxitems 7x


    Hi all,
    I've been bumping my head trying to figure out how to do this.
    I have a ListBox with a DataTemplate that its first child element is a Grid container, with more inside containers.
    Anyhow, the ListBoxItems inside the ListBox are being sorted (I'm using CollectionViewSource for this matter),
    and each time the collection's order changes, I'd like to begin an animation that will smoothly switch between the sorted ListBoxItems.
    So far I tried applying TranslateTransform to the controls inside the DataTemplate, and tried to animate that, but it move a thing :/
    By the way - I'd overridden the ListBox's ItemsPanelTemplate to a new StackPanel so it would be based on pixels and not on items.

    It will be awesome if anyone will have a solution for me.
    Thanks a lot!
    Dror.

    DB:2.87:Switching Animation Between Listboxitems 7x

    Wow, that's nice!
    Thanks a lot for this great answer!

  • RELEVANCY SCORE 2.87

    DB:2.87:How To Bind Data To A Listbox From An Access Database....And To Show It With A Button Click..??? sx


    I have an access database n need to retrieve data in a listbox...how toadd it to blend project..n how to bind the specific coloumn in the database to the listbox...??

  • RELEVANCY SCORE 2.87

    DB:2.87:Listbox Listboxitem Removed p9


    I have a helper class that allows me to monitor when ListBoxItems are created (great for hooking controls inside datatemplates..). Unfortunately I have no idea how to monitor when ListBoxITems are deleted or recycled..any insights would be welcome:

    public class ListBoxEx : ListBox
    {
    private readonly SubjectListBoxItem _added=new SubjectListBoxItem();
    private SubjectListBoxItem _removed=new SubjectListBoxItem();

    public IObservableListBoxItem ItemsAdded
    {
    get { return _added; }
    }
    protected override void PrepareContainerForItemOverride(System.Windows.DependencyObject element, object item)
    {
    base.PrepareContainerForItemOverride(element, item);
    if(element is ListBoxItem)
    {
    var lbi = element as ListBoxItem;
    _added.OnNext(lbi);
    }
    }

    }

    DB:2.87:Listbox Listboxitem Removed p9

    Hi DracoBlanc,
    You can detect changes by implementing INotifyCollectionChanged interface. And ObservableCollectionT is already a collection class we can use that implements INotifyCollectionChanged, when you add or remove objects to an observable collection, the observable
    collection will automatically raise a CollectionChanged event.
    You may refer:
    http://odetocode.com/articles/740.aspx
    Best Regards,

  • RELEVANCY SCORE 2.86

    DB:2.86:How To Identify Controls Inside Tree View 71


    I Have a tree view control , which has many elements inside it as shown below.....
    The record and play back is only capturing the co-ordinates of the controls inside.....
    what should i do to access these controls.. while hand coding them

    DB:2.86:How To Identify Controls Inside Tree View 71

    Ankit,
    If the hierarchy is big and growing, your code would work but gradually would blast off because of so many loops.

    Using a LINQ query would be a good idea instead.
    Thanks,
    Saswat

  • RELEVANCY SCORE 2.86

    DB:2.86:How To Get The Values Of A Textbox Or Checkbox From A Listbox? zp


    Hi,
    I have a listbox, that in its template has some other controls that the user can edit. How can I access those controls? Also, if there is a button in the template, how do I add an event handler to it?
    I managed to figure these in plain WPF, but in Silverlight it seems to be different...
    Any idea?
    vitya

    DB:2.86:How To Get The Values Of A Textbox Or Checkbox From A Listbox? zp

    Thanks, sladapter, for clearing up this area for me!
    cheers
    vitya

  • RELEVANCY SCORE 2.86

    DB:2.86:Listbox Within Listbox Scrolling Problem mj


    I have some structured data which i am trying to display in a combination of ListBoxes within a parent ListBox.
    My problem is that when selecting items in an inner ListBox the outter ListBox doesn't recognize this, i.e. scrolling the outter ListBox does not work.
    My idea is to subclass ListBoxItems of the inner ListBoxes and let the click event pass through to the underlying controls. But this is just an idea and i don't know how to do it either.

    Any help appreciated!

    DB:2.86:Listbox Within Listbox Scrolling Problem mj

    I removed the Background propertybut ihave the same error.
    Here is the StackTrace:
    Project.dll!Project.App.Application_UnhandledException(object sender, System.Windows.ApplicationUnhandledExceptionEventArgs e) Line 30 0x5 bytesC#
    System.Windows.dll!MS.Internal.Error.CallApplicationUEHandler(System.Exception e) 0x3a bytes
    System.Windows.dll!MS.Internal.Error.CallAUEHandler(uint hr, out uint bIsHandled) 0x7 bytes

  • RELEVANCY SCORE 2.86

    DB:2.86:How Do I Use An Itemrenderer With Array From Actionscript??? 89



    I am wanting to populating a list control with several Checkbox controls, i understand how to use the itemrenderer but all the examples I have found populate the dataprovider array outside of actionscript i want to know how to create my array inside of action script and pass it to the listbox. when i was playing around with this i could get the listbox to populate with checkbox but it would not so the label of the items, i am guessing i was not passing the right information in the array.

  • RELEVANCY SCORE 2.86

    DB:2.86:How To Visible/Collapsed Controls Using Mvvm Pattern jd


    Hi Devs,
    I am using MVVM pattern to create an App, my problem is :
    - I have a listbox control on my View , on Selecting a Particular item on listbox I need to display/Collapsed a Grid on my Page.
    Grid x:Name=LayoutRoot Background=Gray

    ListBox x:Name=listBox HorizontalContentAlignment=Stretch ItemsSource={Binding ContextCollection} Width=480
    ListBox.ItemTemplate
    DataTemplate --some UI Control Here --

    /DataTemplate

    /ListBox.ItemTemplate

    i:Interaction.Triggers
    i:EventTrigger EventName=SelectionChanged
    i:InvokeCommandAction Command={Binding ShowPopup}
    CommandParameter={Binding Path=SelectedItem, ElementName=listBox}/
    ec:NavigateToPageAction TargetName=Detail /
    /i:EventTrigger
    /i:Interaction.Triggers

    /ListBox

    -- I want to Display/Collapsed this Grid On Listbox Item Selection.
    Grid Background=Gray Height=150 Width=150
    /Grid

    /Grid

    -- So Alternatively, I am Binding ListBox Selection On my ViewModel, But I don't know how to Get Access of Listbox on the View to Visible/Collapsed it. Help me Guys !!
    Regards,

    Pardeep

    DB:2.86:How To Visible/Collapsed Controls Using Mvvm Pattern jd

    HiThomas Claudius Huber,
    I'd Bing convert bool to visibility wp7
    to visible/collapsed my Grid on Listbox selection. But I got Hard Luck on it. Your Word with An Example Would Surely Solve My Problem. Help If U Have Time to Spend .
    Regards,Pardeep

  • RELEVANCY SCORE 2.86

    DB:2.86:Tabbing Controls In Listbox Items 81


    I have a series of controls that define the DataTemplate of a Listbox. Something along these lines:

    ListBox.ItemTemplate
    DataTemplate

    Button /
    Textbox /
    Checkbox /

    ....

    Each item in the listbox is added dynamically. How would I get the tabbing to work such that when tabbing out of the Textbox in 0th item in the listbox, focus is set to the Textbox in the 1st listbox item, and
    then the Textbox in the 2nd Listbox item and so forth. Any ideas?

    -- xavier

    DB:2.86:Tabbing Controls In Listbox Items 81

    Hey guys this is great stuff!
    Interestingly I just was trying to do something similar with a SL4 application / intranet web page(s)...
    My only is that this blog might not solve is my datatemplate is fixed so i now my controls and they are load based on databinding the normal or common way to load the data and controls into the listbox.
    So how can I add the tabindex for the textboxes as they are load into the list box? I'm not doing that the databinding is doing it. I know there are some converters that can be coded as the rows in the list box are loaded can someone not so new to silverlight
    explain?
    SL4 does not have datatypes, style triggers or some of the other WPF stuff. It would be nice to have a way to set the tab order for the textboxes in the listbox. Right now I have only TextBlocks and TextBoxes but in the future I might have others. I will
    save this thread for future use. I really need this tab order thing figured out soon.
    Thanks in advance!!!

  • RELEVANCY SCORE 2.85

    DB:2.85:Checkbox Inside Dropdown jk


     Hi All,i want to display CheckBoxs inside a DropDownList for multiselection. Anybody knows how to accomplish this task...? When i Searched for it, i came accross 3rd party controls but I want to develop similar one in c#.Note: I can do with listbox also, but i dont want a listbox.

    DB:2.85:Checkbox Inside Dropdown jk

    OK, I am assuming that your listbox example you mentioned that works is using the same method i described. You would just need to have the HTML render like this:

    div id=myDropDown  

    !-- Code goes here to render you checkboxes -- 

    /div 

  • RELEVANCY SCORE 2.85

    DB:2.85:Accessing Image Inside A Listbox 9j


    I have a ListBox containing a list of Images, which will be populated at Runtime. I want to access the image inside the Listbox in code- behind, but I am unable to access. ( I cannot access ThumbnailImage in CS file )
    Can anybody help me?
    The code for ListBox, that I have, is -

    ListBox x:Name=ButtonImageHolder Grid.Row=0
    ListBox.ItemsPanel
    ItemsPanelTemplate
    StackPanel Orientation=Vertical Background=Black/
    /ItemsPanelTemplate
    /ListBox.ItemsPanel

    ListBox.ItemTemplate
    DataTemplate
    StackPanel Orientation=Horizontal
    Image x:Name=ThumbnailImage
    Tag={Binding}
    Source={Binding ImageURL}
    Loaded=Image_Loaded
    MouseLeftButtonUp=Image_MouseLeftButtonUp /
    TextBlock Tag={Binding}
    Text={Binding Heading} /
    /StackPanel
    /DataTemplate
    /ListBox.ItemTemplate
    /ListBox

    DB:2.85:Accessing Image Inside A Listbox 9j

    Hi Thomos,
    Thanks for your reply.
    Now I can access the image.