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

cobo Box creation in spread sheet control.

StringCollection

list = new StringCollection();

list.Add("One");

list.Add("Two");

list.Add("Three");

var

combo1 = SpreadIOList.GridProperties.ActiveSpreadsheetGrid.CurrentCell.Grid.Model[1, 1];

combo1.CellType =

"ComboBox";

combo1.ChoiceList = list;

combo1.DropDownStyle = Syncfusion.Windows.Controls.Grid.

GridDropDownStyle.Editable;

// 

 

prob statment:

 i am getting exception in xamalparseexception.

for any help thanks in advance.

 

 

   

 

 

 


1 Reply

PS Pannir Selvam S Syncfusion Team August 30, 2013 02:09 AM UTC

Hi Mani Shankar,

 

Thanks for contacting Syncfusion support.

 

We have analyzed your query and we have tried to meet your requirement by setting the ComboBox celltype to the Cell in the QueryCellInfo event of grid like below code snippet.

 

Code Snippet[C#]:

var grid = this.spreadSheetControl.GridProperties.ActiveSpreadsheetGrid;
grid.Model.QueryCellInfo += new GridQueryCellInfoEventHandler(Model_QueryCellInfo);

 

void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)

{

    if (e.Style.RowIndex == 0 || e.Style.ColumnIndex == 0)

        return;

    if (e.Style.ColumnIndex == 1)

    {

        e.Style.CellType = "ComboBox";

        e.Style.ItemsSource = new List<string>(){"One","Two","Three"};

    }

}

 

 

 

We have prepared a sample based on this and you can download the sample from the below location.

 

Sample: SpreadsheetDemo_WPF (2).zip

 

Please let us know if you have any other queries.

 

Thanks,

Pannir


Loader.
Live Chat Icon For mobile
Up arrow icon