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.

MultiRowRecord with GridDataBoundGrid and Celltypes: DropDownBox

Thread ID:

Created:

Updated:

Platform:

Replies:

58188 Mar 20,2007 10:48 AM Mar 21,2007 05:02 AM Windows Forms 2
loading
Tags: GridControl
Xerxos
Asked On March 20, 2007 10:48 AM

Hello
I have studied the examples
1. MultiRowRecord with the GridDataBoundGrid
2. Celltypes DropDown in the GridControl

Is ist possible to change the celltypes in the GridDataBound to a DropDownBox? I want a MultiRowRecord with one DropDownbox in one cell.

I have already tried this:

DataTable dt;
private void Form1_Load(object sender, System.EventArgs e)
{
this.gridDataBoundGrid1.Binder.SuspendBinding();

DataColumn column;

column = new DataColumn();
column.DataType = System.Type.GetType("System.String");
dt.Columns.Add(column);

column = new DataColumn();
column.DataType = System.Type.GetType("System.String");
dt.Columns.Add(column);

DataRow dr = dt.NewRow();
dr[1] = "One";
dr[0] = "One";

dt.Rows.Add(dr);


this.gridDataBoundGrid1.DataSource = dt;
this.gridDataBoundGrid1.Binder.ResumeBinding();

StringCollection items = new StringCollection();
items.Add("One");
items.Add("Two");
items.Add("Three");

gridDataBoundGrid1[1, 1].CellType = "ComboBox";
gridDataBoundGrid1[1, 1].ChoiceList = items;

but it does not work.
Thanx for any help!


Administrator [Syncfusion]
Replied On March 20, 2007 12:23 PM

Hi Xerxos,

By default, DataBoundGrid doesn't store any style info properties. You can not set any cell or row specific properties for the DataBoundGrid other than the CellValue. You need to handle the PrepareViewStyleInfo (or Model.QueryCellInfo) Event to do this. Through this event you can set the style properties for the grid.

To set the CellType for a cell, you check for the e.RowIndex/e.ColIndex, if that points to the row you desired, set the e.Style.CellType for it.

////
e.Style.CellType = "ComboBox";
e.Style.ChoiceList = items;

See the KnowledgeBase Articles for more info.
QueryCellInfo event : http://www.syncfusion.com/Support/article.aspx?id=10351
PrepareViewStyleInfo event :http://www.syncfusion.com/Support/article.aspx?id=560

Regards,
Haneef

Administrator [Syncfusion]
Replied On March 21, 2007 05:02 AM

Thank you very much, it works fine now! ;)

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.

;