How to add ticked to split button dropdown?

Hi,
I want after selecting an item in the dropdown it is marked with a location (eg a check mark) so that I can see the selected location next time!
How do I achieve this? (Is there any simple way?)



10 Replies

VR Vijayalakshmi Roopkumar Syncfusion Team September 2, 2020 01:25 PM UTC

Hi Khanh 
 
Thank you for contacting Syncfusion Support 
 
We have checked the reported requirement, and found that you want to change the image for the selected item of splitbutton. However, it can be achieve by setting the image for the clicked item through DropDownItemclicked event of Splitbutton. However , we are facing the issue with this and logged a defect report on this. The patch for this fix is estimated to be available on 16th Sep, 2020. 
 
You can track the status of this defect using the following feedback link: 
 
 
Also, please let us know about your currently using product version, it would be helpful for us to provide you the patch accordingly. 
 
Please let us know if you have any other concerns. 
 
Regards, 
Vijayalakshmi VR 



TG The GridLock September 2, 2020 05:45 PM UTC

Hi Vijayalakshmi ,
My version is 18.1.042 
Thanks!



VR Vijayalakshmi Roopkumar Syncfusion Team September 3, 2020 04:57 AM UTC

Hi  Khanh 
 
Thank you for your update. 
 
We will provide you the patch in your version 18.1.0.42 as promised earlier on 16th Sep, 2020. 
 
Please let us know if you have any other concerns. 
 
Regards, 
Vijayalakshmi VR 



VR Vijayalakshmi Roopkumar Syncfusion Team September 16, 2020 01:04 PM UTC

Hi Khann 
 
Thank you for your patience. 
 
We have fixed the reported issue with SplitButtonAdv and please find the patch for the same from following. Using this patch, now you can able to set the image for selected item in splitbutton dropdown using the following code: 
 
Code: 
 
 
private void SplitButton1_DropDowItemClicked(object sender, ToolStripItemClickedEventArgs e) 
{ 
e.ClickedItem.Text = "Yellow"; 
e.ClickedItem.Image = Bitmap.FromFile(@"../../help.png"); 
 
} 
 
 
 
 
Screenshot: 
 
 
 
   
Recommended approach - exe will perform automatic configuration.   
   
Please find the patch setup from below location:   
   
 
 
Please find the patch assemblies alone from below location:   
   
 
 
 
  
 
Assembly Version: 18.1.0.42 
   
Installation Directions:   
This patch should replace the files "Syncfusion.Tools.Windows” under the following folder.   
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\[TargetFramework]   
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\18.1.0.42\precompiledassemblies\18.1.0.42\\4.6   
   
To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you must manually copy and paste them to the preferred location or you must run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies.   
   
   
Disclaimer:   
Please note that we have created this patch for version 18.1.0.42 specifically to resolve the issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received.  Please let us know, if you are using any other Syncfusion version, we will provide patch in your version.   
 
Please let us know if you have any other concerns. 
 
Regards, 
Vijayalakshmi VR 



TG The GridLock September 17, 2020 03:00 AM UTC

ok Vijayalakshmi.
I will check it out.


VR Vijayalakshmi Roopkumar Syncfusion Team September 17, 2020 04:28 AM UTC

Hi Khann 
 
Thank you for your update. 
 
We will wait until your reply. 
 
Regards, 
Vijayalakshmi VR 



TG The GridLock September 19, 2020 05:46 AM UTC

Hi Vijayalakshmi ,
I want to keep only the previous selectedindex (only one instead all), how do I change this:


my test code:
 private ToolStripItem t;
        private void SplitButton1_DropDowItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            if (t != null)
            {
              
                t.Image = null;
                splitButton1.Refresh();
            }

           
            e.ClickedItem.Image = Bitmap.FromFile(@"../../help.png");
            t = e.ClickedItem;
           
        }


VR Vijayalakshmi Roopkumar Syncfusion Team September 21, 2020 12:49 PM UTC

Hi Khanh 
 
Thank you for your update. 
 
From your update, we could understood that you want to maintain the image for previous selected item alone. However in this click event, we could not save the previous selected item , but you can able to set the image for specified item alone by comparing the text property using the following code: 
 
Code: 
 
 
 
private void SplitButton1_DropDowItemClicked(object sender, ToolStripItemClickedEventArgs e) 
        { 
            var  t = e.ClickedItem; 
             if(t != null && e.ClickedItem.Text == splitButton1.DropDownItems[0].Text) 
            { 
                e.ClickedItem.Image = Bitmap.FromFile(@"../../help.png"); 
                t = e.ClickedItem; 
            } 
             
        } 
 
 
 
Please try this solution and let us know if it is helpful. 
 
Regards, 
Vijayalakshmi VR 



TG The GridLock September 22, 2020 02:36 AM UTC

Hi Vijayalakshmi,
I want when open the dropdown I will see the previously selectedindex(of course it has only one selected index)
here is the code I am using:

Private Sub SplitButton1_DropDowItemClicked(sender As Object, e As ToolStripItemClickedEventArgs)
        For Each s As Syncfusion.Windows.Forms.Tools.toolstripitem In splitButton1.DropDownItems
            If s.Image isnot nothing Then
                s.Image = Nothing '        <<----   Reset image from previous selecteditem
                Exit for
            End If
        Next s
        e.ClickedItem.Image = myimage '  <----   assign image for new selecteditem for later opendropdown
 End Sub

can you check again? 


VR Vijayalakshmi Roopkumar Syncfusion Team September 22, 2020 04:23 PM UTC

Hi Khanh, 
 
Thank you for your update. 
 
As per your update, you want to maintain the previous selected item. So we have checked the provided code and it works on maintaining the previous selected item on each dropdown opening operation. You can use this to achieve your requirement. 
 
Please let us know if you have any other concerns. 
 
Regards, 
Vijayalakshmi VR 


Loader.
Up arrow icon