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.
Unfortunately, activation email could not send to your email. Please try again.

how to display multiple select dropdown on grid cell mouse click

Thread ID:

Created:

Updated:

Platform:

Replies:

106997 Feb 6,2013 07:16 AM Mar 10,2013 11:58 PM Windows Forms 13
loading
Tags: GridControl
Kazim
Asked On February 6, 2013 07:16 AM

Hi Team, 

I am new to syncfusion grid and unable to get help from the web for the multi select dropdown.

I am using GridGroupingControl which is derived from "Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl gridGroupingControl1;" on windows form. This grid will have first row as blank which will be used by the user to add a new row.

Find attached the Grid screenshot.

I have a requirement where whenever "Execution Days" cell is clicked, then the multiple select drop down has to be shown similar to the one shown in the screenshot and whatever values user checked on the dropdown has to be assigned to that cell on button ok Click.

Please provide me some example or code for this.

Thanks,
Kazim



Syncfusiongridcontrol_8365a11.zip

Vinish Kumar K [Syncfusion]
Replied On February 8, 2013 06:25 AM

Hi Kazim,

 

Thank you for your interest in Syncfusion Products,

 

We have analyzed your query related to the drop down grid. Now currently we are working on this query. We will get back to you with proper details on February 11, 2013. In meantime you can customize your application based on the custom cell model which is available in GridControl. Just assign celltype to custom cell type with following

 

this.gridControl1[rowIndex, colIndex + 2].CellType = "DropDownForm";

            this.gridControl1[rowIndex, colIndex + 2].Text = "choice1,choice3";

 

 

Please refer the following sample from our dashboard from the following path

 

<installed path>\Syncfusion\EssentialStudio\<version>\Windows\Grid.Windows\Samples\2.0\Custom Cell Types\Drop Down Cell Demo\

 

Please let me know if you have further concerns,

Regards,

Vinish.


Kazim
Replied On February 12, 2013 11:55 PM

Hi,

Thanks for the code provided as it helped me to know which cell type to be used. I am using Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl() and not the Grid control. I have achieved the drop down behaviour on the GridGroupingControl by using the below code.

private GridTableCellStyleInfo ggcStyle;
ggcStyle = gridGroupingControl1.TableDescriptor.Columns["ExecDays"].Appearance.AnyRecordFieldCell;
ggcStyle.CellType =
"DropDownForm";
this.daysCombo.Items.AddRange(new object[] {"Mon","Tue","Wed","Thu","Fri","Sat","Sun"});

Now the only problem is when I clicked on Ok button after selecting some values in the list, then that Grid cell is not getting those values assigned.

Please let me know how to assign the value to the GridGroupingControl cell on button OK click event.

Thanks & Regards,
Kazim


Vinish Kumar K [Syncfusion]
Replied On February 13, 2013 06:38 AM

Hi Kazim,

 

Thanks for your update.

 

We have analyzed your last update. We have tried to reproduce the issue in our end but I am afraid that I am unable to reproduce the issue in our end. Please provide the sample file which is you have used to select multi option combo box. This will help us to reproduce the issue in our end and provide an proper response and solution.

 

We will wait for your replay.

 

Regards,

Vinish.


Kazim
Replied On February 28, 2013 04:57 AM

Hi Team,

Find attached the sample project which is using the syncfusion gridgroupingcontrol along with the multi select checked list box.

 

I am not able to assign the values to the "Execution Days" cell whatever is selected from the checked list box on the button ok click. Particularly in the first row which is an empty one. Please let me know how to assign the selected values from the checked list box to the cell.

 

For example: The first row is empty. When clicked on the "Execution Days" cell, the multiselect drop down list will appear with all values unchecked. Now select any two values from the list and click on OK button. The selected value should be assigned to the first row "Execution Days" cell.

 

Thanks & Regards,

Kazim

 

 



SampleGridGroupingControl_4960cad5.zip

Vinish Kumar K [Syncfusion]
Replied On February 28, 2013 06:45 AM

Hi Kazim,

 

Thanks for your update.

 

We have deeply analyzed your sample with our source. We have found the issue in your sample. This issue is occur due to the sample level coding. Pease use the coding which is you have used in btnDaySelect_Click in btnSelectDay_Leave event. Please refer the following codes. W

 

private void daysCombo_Leave(object sender, EventArgs e)

        {

            //daysPanel.Visible = false;

 

            selectedDays.Clear();

            daysCombo.SelectedItems.Clear();

            var days = new string[7];

            daysCombo.CheckedItems.CopyTo(days, 0);

            foreach (var day in days)

            {

                if (!string.IsNullOrEmpty(day))

                    selectedDays.Append(day + ",");

            }

            daysPanel.Visible = false;

            if (selectedDays != null && selectedDays.Length > 0)

                selectedDays.Remove(selectedDays.Length - 1, 1);

        }

 

Please use above suggestion and let me know if this helps to you.

 

Regards,

Vinish


Vinish Kumar K [Syncfusion]
Replied On February 28, 2013 06:45 AM

Hi Kazim,

 

Thanks for your update.

 

We have deeply analyzed your sample with our source. We have found the issue in your sample. This issue is occur due to the sample level coding. Pease use the coding which is you have used in btnDaySelect_Click in btnSelectDay_Leave event. Please refer the following codes. W

 

private void daysCombo_Leave(object sender, EventArgs e)

        {

            //daysPanel.Visible = false;

 

            selectedDays.Clear();

            daysCombo.SelectedItems.Clear();

            var days = new string[7];

            daysCombo.CheckedItems.CopyTo(days, 0);

            foreach (var day in days)

            {

                if (!string.IsNullOrEmpty(day))

                    selectedDays.Append(day + ",");

            }

            daysPanel.Visible = false;

            if (selectedDays != null && selectedDays.Length > 0)

                selectedDays.Remove(selectedDays.Length - 1, 1);

        }

 

Please use above suggestion and let me know if this helps to you.

 

Regards,

Vinish


Kazim
Replied On February 28, 2013 11:08 PM

Hi Vinish,

Thanks for the update. My concern is only with the first row as for other rows it is working fine in my application. I have changed the coding as shown below as per your suggestion but still i am not getting the result for the first row. That is whenever some value are selected for the first row "Execution Days" column, then those values are not being assigned to that cell. Please help me to achieve this for the first row.

private void btnDaySelect_Click(object sender, EventArgs e)
{
daysPanel.Visible =
false;
}

private void daysCombo_Leave(object sender, EventArgs e)
{
     //daysPanel.Visible = false;
     
selectedDays.Clear();
     daysCombo.SelectedItems.Clear();
    
var days = new string[7];
     daysCombo.CheckedItems.CopyTo(days, 0);
    
foreach (var day in days)
     {
        
if (!string.IsNullOrEmpty(day))
         selectedDays.Append(day +
",");
     }
     daysPanel.Visible =
false;
     
if (selectedDays != null && selectedDays.Length > 0)
         
selectedDays.Remove(selectedDays.Length - 1, 1);
}

Thanks & Regards,
Kazim


Kazim
Replied On February 28, 2013 11:13 PM

Hi Vinish,

The first row in my previous reply refers to the first empty row.

Thanks & Regards,
Kazim



samplegridcontrolimage_5bc25d5c.zip

Vinish Kumar K [Syncfusion]
Replied On March 5, 2013 06:52 AM

Hi Kazim,

 

Thanks for your update.

 

We have deeply analyzed your query with the sample provide by you. The issue  is occur if the cell contain empty strings. For other cells the sample works properly. This issue may be occur due to the make of an cell value as null but not sure. Because we can’t able to reproduce in some time. So please let you check in your application is there any codes are used to remove the cell value either in designer or in any cell validation. The below lines in PrepareViewStyleInfo gives an empty value so please modify the method to get  selectedDays values

 

e.TableControl.Table.TableModel[e.Inner.RowIndex, 4].CellValue = selectedDays.ToString();

 

And let me know if this works for you else please let me know we will provide an proper response.

 

Regards,

Vinish.


Kazim
Replied On March 6, 2013 03:34 AM

Hi Vinish,

 

I removed the below line as you said but of no use.

 

e.TableControl.Table.TableModel[e.Inner.RowIndex, 4].CellValue = selectedDays.ToString();

 

I am posting the whole code again. Please check and help me to assign the selected values from the checked list drop down to the first cell of "Execution Days" column.

 

Thanks & Regards,

Kazim 



SampleGridGroupingControl_a11bb94b.zip

Vinish Kumar K [Syncfusion]
Replied On March 7, 2013 02:16 PM

Hi Kazim,

 

Sorry for the inconvenience caused.

 

Please ignore my previous update. I have suggested some solution for you in last update. And I have  analyzed the sample again and test the application again and again. I have found the issue is occur due to the following two reason.

 

1.       The combobox doesn’t works properly with the AddNewrecord row.

2.       The values are always null for this dropdown combo box column always.

So to avoid this issue I have found an simple work around for your application. This will gives an some efficient solution. Please refer the following highlighted codes.

 

private void daysCombo_Leave(object sender, EventArgs e)

        {

            //daysPanel.Visible = false;

            GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;

 

            selectedDays.Clear();

            daysCombo.SelectedItems.Clear();

            var days = new string[7];

            daysCombo.CheckedItems.CopyTo(days, 0);

            foreach (var day in days)

            {

                if (!string.IsNullOrEmpty(day))

                    selectedDays.Append(day + ",");

            }

            daysPanel.Visible = false;

            if (selectedDays != null && selectedDays.Length > 0)

                selectedDays.Remove(selectedDays.Length - 1, 1);

            if (cc.ColIndex == 4 && cc.RowIndex == 2)

                this.gridGroupingControl1.Table.AddNew();

        }

 

Please refer the attached sample file and let me know if this helps.

 

Regards,

Vinish.



SampleGridGroupingControl_767baf2b.zip

Kazim
Replied On March 8, 2013 05:18 AM

Hi Vinish,

 

Thanks a lot for the solution provided. It is working fine now.

 

Regards,

Kazim


Vinish Kumar K [Syncfusion]
Replied On March 10, 2013 11:58 PM

Hi Kazim,

 

Thanks for your update.

 

We are happy to hear about your issue is resolved. If you need any further assistance. Please open a new forum / incident. We will provide response quickly.

 

Regards,

Vinish.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;