We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to select a symbol in palette

Hello,

i want to select or highlight a symbol in palette.
My goal is to help user to find a symbol from a text in a textbox and after it clicks a button.
This project is in VB Net.

Thank you.

Julian Alvarez 

3 Replies

AK Ashok Kumar V Syncfusion Team October 27, 2014 07:03 AM UTC

Hi Julian,

Thanks for your interest in Syncfusion product.

We have created a simple sample which achieves your requirement of selecting/highlighting the Node in the palette. We suggest you to use paletteGroupView’s “SelectedNode” function to achieve your requirement. Please refer the below code snippet and sample for your reference.

Here is the code snippet:

[VB]

     If paletteGroupView1.Palette IsNot Nothing Then

        For Each nd As Node In paletteGroupView1.Palette.Nodes

            If textBox1.Text = nd.Name Then

                'To Highlight the selectedNode

                paletteGroupView1.SelectNode(nd)

            End If

        Next nd

    End If

Please let us know if any concern.

Regards,

Ashok Kumar. 


Attachment: VB_131252_a96d7793.zip


JA Julian Alvarez October 27, 2014 11:51 AM UTC

Thank you for your answer, but i have again a little problem. 
I used a palettegroupbar with scrolling bars because  it contains a lot of items, so when i look for an item not visible the palettegroup doesn't scroll down until the desired item.

Best regards

Julian Alvarez
 


AK Ashok Kumar V Syncfusion Team October 29, 2014 03:03 PM UTC

Hi Julian,

Thanks for your update.

Please note that diagram’s “PaletteGroupView” also contains scroll bar, when more items are added to the GroupView. We suggest you to use paletteGroupView’s “BringItemIntoView” function to achieve your requirement. Please refer the below code snippet for your reference.

Here is the Code:

[VB]

If paletteGroupView1.Palette IsNot Nothing Then

        Dim incr = 0

        For Each nd As Node In paletteGroupView1.Palette.Nodes

            If textBox1.Text = nd.Name Then

                'To select the Node/Highlight

                paletteGroupView1.SelectNode(nd)

                'To Bring Item into the View

                paletteGroupView1.BringItemIntoView(incr)

            End If

            incr += 1

        Next nd

    End If

Please try the below attached sample and let us know if any concern.

Regards,

Ashok Kumar.


Attachment: VB_117470_2b177bfa.zip

Loader.
Live Chat Icon For mobile
Up arrow icon