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
close icon

Add multiple values within single cell

Hi,

Ii my application i have used GCC and there is a column (Dropdown values) that user can enter multiple key value pairs.
Eg -: 
1 Display item1
2 Display Item2
3 Display Item3

as above, users should be able to add multiple records (Id, display items) through GCC,  and need to load saved data as well. 
How i can archive this. Some kind of control or small popup is better.

Thanks & Regards,
Sumudu Ekanyake


7 Replies

MG Mohanraj Gunasekaran Syncfusion Team August 9, 2016 10:31 AM UTC

Hi Sumudu, 
 
Thank you for using Syncfusion product, 
 
The reported scenario with “Adding multiple values from the DropDown” can be achieved by using the GridListControl as a CellType. Please refer the below code snippet and attached sample, 

Code Snippet: 
GridTableCellStyleInfo styleInfo = this.gridGroupingControl1.TableDescriptor.Columns["CategoryName"].Appearance.AnyRecordFieldCell; 
styleInfo.DataSource = GetTable(); 
styleInfo.CellType = "GridListControl";   
 
Image: 
 
 
Sample link: GridGroupingControl 

Regards, 
Mohanraj G. 



SU sumudu August 9, 2016 12:43 PM UTC

Hi Mohanraj,

Thank you for your update.
Please refer bellow image.

[url=https://postimg.org/image/sis1sh2sb/][img]https://s9.postimg.org/sis1sh2sb/GCC_Drop_Down.png[/img][/url]

If user select control type as combobox,then user should be able to enter value list and display list.

Thanks & Regards,
Sumudu

Attachment: GCCImage_2c630e1c.zip


MG Mohanraj Gunasekaran Syncfusion Team August 10, 2016 02:04 PM UTC

Hi Sumudu, 
 
Sorry for the inconvenience caused, 
 
We have analyzed your query at our end. The reported scenario has achieved by using the TableControlCurrentCellCloseDropDown event to save and load the values in ValueList and DisplayList column. Please refer the below code also refer the sample and video from below link. 
 
Code snippet: 
void gridGroupingControl1_TableControlCurrentCellCloseDropDown(object sender, GridTableControlPopupClosedEventArgs e) 
{ 
    cr = this.gridGroupingControl1.TableControl.CurrentCell.Renderer as GridComboBoxCellRenderer; 
    GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.TableControl.CurrentCell.RowIndex, e.TableControl.CurrentCell.ColIndex); 
             
    if (cr != null && cr.ListBoxPart.SelectedValue != null) 
    { 
        int rowIndex = this.gridGroupingControl1.TableControl.CurrentCell.RowIndex; 
 
        if (!String.IsNullOrEmpty(style.TableCellIdentity.DisplayElement.GetRecord().GetValue("ValueList").ToString())) 
            value += "," + cr.ListBoxPart.SelectedValue.ToString(); 
        else 
            value = cr.ListBoxPart.SelectedValue.ToString(); 
        if (!String.IsNullOrEmpty(style.TableCellIdentity.DisplayElement.GetRecord().GetValue("DisplayList").ToString())) 
            displayvalue += "," + (((DataRowView)cr.ListBoxPart.SelectedItem).Row["Display Items"]).ToString(); 
        else 
            displayvalue = (((DataRowView)cr.ListBoxPart.SelectedItem).Row["Display Items"]).ToString(); 
        if (!string.IsNullOrEmpty(cr.ListBoxPart.SelectedValue.ToString())) 
        { 
            style.TableCellIdentity.DisplayElement.GetRecord().SetValue("ValueList", value); 
            style.TableCellIdentity.DisplayElement.GetRecord().SetValue("DisplayList", displayvalue); 
            this.gridGroupingControl1.TableControl.RefreshRange(GridRangeInfo.Row(rowIndex)); 
        } 
    } 
} 
 
 
 
Sample Link: GridGroupingControl 
Video Link: MultipleValue 
 
Note: 
If we misunderstood your query, please provide the more details about your requirement that would be helpful to provide the solution sooner. 
 
 
Regards, 
Mohanraj G. 



SU sumudu August 11, 2016 03:55 AM UTC

Hi Mohanraj,

Thank you very much for your response.
I did it with by using another way.

Thanks & Regards,
Sumudu Ekanayake.


MG Mohanraj Gunasekaran Syncfusion Team August 11, 2016 05:53 AM UTC

Hi Sumudu, 
 
Thanks for your update, 
 
We are glad to know that your reported problem has been resolved. Please let us know if you need any further assistance. 
 
Regards, 
Mohanraj G.


SU sumudu August 11, 2016 06:58 AM UTC

Hi Mohanraj,

It's resolved.

Thanks & Regards,
Sumudu


MG Mohanraj Gunasekaran Syncfusion Team August 11, 2016 11:31 AM UTC

Hi Jalil, 

Thanks for your update. 

Regards, 
Mohanraj G. 


Loader.
Live Chat Icon For mobile
Up arrow icon