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.
Syncfusion Feedback

this.gridDataBoundGrid1.Model[cc.RowIndex, 2].CellType = "ComboBox";

Thread ID:

Created:

Updated:

Platform:

Replies:

71743 Feb 12,2008 06:20 AM UTC Feb 13,2008 09:24 AM UTC Windows Forms 3
loading
Tags: GridControl
Sherly Numawaty
Asked On February 12, 2008 06:20 AM UTC

Dear all,

i've write that code on CurrentCellChanged,but it doesnt work..


i want to set celltype of column at index 2 become combobox...

please advice..



Jisha Joy [Syncfusion]
Replied On February 12, 2008 08:49 AM UTC

Hi Sherly,

If you want to set the CellType of Coulmn at index to ComboBox, this can be achieved by the following code snippet:

this.gridDataBoundGrid1.Binder.InternalColumns[2].StyleInfo.CellType = "ComboBox";

Please refer the sample in the link to illustrate this:
http://websamples.syncfusion.com/samples/Grid.Windows/71743/main.htm

Kindly try this and let me know if you need further assistance.

Regards,
Jisha




Sherly Numawaty
Replied On February 13, 2008 02:03 AM UTC

Hi Jisha

firstly thanks for ur response

actually, i've try ur code before, but it will be change the columns for all rows
the things what i'm trying to do is change columns on specific rowindex

i want to change for 1 row only...

is it possible?

fyi,i'm using vs2003

tx u so much,

sherly



SubhaSheela R [Syncfusion]
Replied On February 13, 2008 09:24 AM UTC

Hi Sherly,

Thank you for using Syncfusion products.

In the GridDataBoundGrid Control, you cannot set cell specific properties like CellType, BackColor (other than CellValue or Text) using an indexer like this.gridDataBoundGrid[8,10].CellType = "ComboBox". The reason is that in GridDataBoundGrid, the only data storage is the bounded datasource. That only holds a single value. It does not hold CellType, Backcolor, or any of the other cell specific properties. So, in order to set cell specific properties like CellType in GridDataBoundGrid, you could handle the PrepareViewStyleInfo event or Model.QueryCellInfo event. Below is the code snippet:

private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)
{
if (e.ColIndex == 2 && e.RowIndex == 2)
{
StringCollection items = new StringCollection();
items.Add("Apple");
items.Add("Grapes");
items.Add("Banana");
items.Add("Mango");
items.Add("Cherry");
e.Style.CellType = "ComboBox";
e.Style.BackColor = Color.LightBlue;
e.Style.ChoiceList = items;
}


Please refer to the sample available in the link below and let me know if it helps:

http://websamples.syncfusion.com/samples/Grid.Windows/F71743FollowUp /main.htm

Regards,
Subhasheela R



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.

Warning Icon 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.Close Icon

;