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.

No subject

Thread ID:

Created:

Updated:

Platform:

Replies:

2938 Feb 21,2003 05:46 AM Feb 24,2003 07:13 AM Windows Forms 7
loading
Tags: GridControl
Rajaraman
Asked On February 21, 2003 05:46 AM

I have a hierarchical Grid, I want to have Combo Box celltype in Child rows, i tried added these lines of code is not working. Grid1.gridbinder.internalcolumns.item(0).Celltype="ComboBox" Grid1.gridbinder.internalcolumns.item(0).datasource= dstest Please help me where i am missing Regards Rajaraman

Administrator [Syncfusion]
Replied On February 21, 2003 07:49 AM

You also need to specify ValueMember and DisplayMember. Example: [VB] Dim supplierIDStyle As GridStyleInfo = hlCategory_Products.InternalColumns("SupplierID").StyleInfo supplierIDStyle.CellType = "GridListControl" supplierIDStyle.DataSource = ds.Tables("Suppliers") supplierIDStyle.DisplayMember = "CompanyName" supplierIDStyle.ValueMember = "SupplierID" supplierIDStyle.HorizontalAlignment = GridHorizontalAlignment.Left [C#] GridStyleInfo supplierIDStyle = hlCategory_Products.InternalColumns["SupplierID"].StyleInfo; supplierIDStyle.CellType = "GridListControl"; supplierIDStyle.DataSource = ds.Tables["Suppliers"]; supplierIDStyle.DisplayMember = "CompanyName"; supplierIDStyle.ValueMember = "SupplierID"; supplierIDStyle.HorizontalAlignment = GridHorizontalAlignment.Left; Stefan

Rajaraman
Replied On February 22, 2003 12:46 AM

i want to write generic procedure, i may not know this level information, i know it is easy to do for master rows from Grid itself, please refer my code again, i dont this hlCategory_Products objects at my Form. i know only Grid. It is working if we work with hierarchy level object, but i need another way. Thanks Rajaraman > You also need to specify ValueMember and DisplayMember. > > Example: > > [VB] > Dim supplierIDStyle As GridStyleInfo = hlCategory_Products.InternalColumns("SupplierID").StyleInfo > supplierIDStyle.CellType = "GridListControl" > supplierIDStyle.DataSource = ds.Tables("Suppliers") > supplierIDStyle.DisplayMember = "CompanyName" > supplierIDStyle.ValueMember = "SupplierID" > supplierIDStyle.HorizontalAlignment = GridHorizontalAlignment.Left > > [C#] > GridStyleInfo supplierIDStyle = hlCategory_Products.InternalColumns["SupplierID"].StyleInfo; > supplierIDStyle.CellType = "GridListControl"; > supplierIDStyle.DataSource = ds.Tables["Suppliers"]; > supplierIDStyle.DisplayMember = "CompanyName"; > supplierIDStyle.ValueMember = "SupplierID"; > supplierIDStyle.HorizontalAlignment = GridHorizontalAlignment.Left; > > > > Stefan

Administrator [Syncfusion]
Replied On February 22, 2003 02:56 AM

Can you get the hierarchy level using GridDataBoundGrid1.Binder.GetHierarchyLevel? //set second column in the first child to checkbox GridHierarchyLevel level = this.gridDataBoundGrid1.Binder.GetHierarchyLevel(1); //first child GridStyleInfo style = level.GridBoundColumns[1].StyleInfo;//second column style.CellType = "ComboBox"; style.ValueMember = "Col2"; //name of value member column style.DisplayMember = "Col1"; //name of value member column style.DataSource = dt; //datatable with at least columns named Col1 and Col2 style.ShowButtons = GridShowButtons.Show; this.gridDataBoundGrid1.Refresh();

Rajaraman
Replied On February 22, 2003 03:37 AM

Hi Are you there? Can you come to some chat window either MSN/Yahoo Please reply me Regards Rajaraman > Can you get the hierarchy level using GridDataBoundGrid1.Binder.GetHierarchyLevel? > > > //set second column in the first child to checkbox > GridHierarchyLevel level = this.gridDataBoundGrid1.Binder.GetHierarchyLevel(1); //first child > GridStyleInfo style = level.GridBoundColumns[1].StyleInfo;//second column > style.CellType = "ComboBox"; > style.ValueMember = "Col2"; //name of value member column > style.DisplayMember = "Col1"; //name of value member column > style.DataSource = dt; //datatable with at least columns named Col1 and Col2 > style.ShowButtons = GridShowButtons.Show; > > this.gridDataBoundGrid1.Refresh(); > >

Rajaraman
Replied On February 22, 2003 03:45 AM

Hi I want to have a Unbound Column in Child Level rows? How to do it? I want to add rows to Child level? after enabling EnableAddnew, i can press enter go for creating another row(parent level), it is working, but i could not click the + button and add child rows Where I am missing? Regards Rajaraman

Administrator [Syncfusion]
Replied On February 22, 2003 10:03 AM

You would have to add a GridBoundColumn with some unique MappingName to the child level. Take a look at the Grid/Samples/DataBound/Hierarchical/CustomersVirt sample. In that sample, the parent and child share the same GridBoundColumn layout, but you could add a particular unbound column to that child collection, that would not be in the parent's collection. Adding new rows to a child level through the grid is not supported in the current release. This support will be in the upcoming 2.0 release. For now, you would have to add the new row directly to the datasource(through maybe a button or menu item). Then the grid should automatically display the added row.

Rajaraman
Replied On February 24, 2003 07:13 AM

Thanks Clay Regs Rajaraman

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.

;