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.

merging cells

Thread ID:

Created:

Updated:

Platform:

Replies:

19320 Sep 23,2004 09:13 AM Sep 28,2004 07:06 AM Windows Forms 18
loading
Tags: GridControl
Mahesh Naik
Asked On September 23, 2004 09:13 AM

I would like to set the merge properties of a column to true so that cells with same values get merged in that column. ditto for a row. mHow do i do that for a unbound essential grid. also, How do i display my text in the centre row of a covered range? I am new to grids and also to .net and also to VB

Administrator [Syncfusion]
Replied On September 23, 2004 10:54 AM

Hi Mahesh, First you need to set Options.MergeCellsMode = GridMergeCellsMode.OnDemandCalculation|GridMergeCellsMode.MergeRowsInColumn|GridMergeCellsMode.MergeColumnsInRow; then for individual cells: - to merge neighbouring columns in same row set cell.Item(row, col).MergeCell = GridMergeCellDirection.ColumnsInRow - to merge neighbouring rows in same column set cell.Item(row, col).MergeCell = GridMergeCellDirection.RowsInColumn In order to center text within a covered range, you first make it a covered range and set vertical and horizontal alignemnt, e.g. gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(6, 2, 7, 6)) gridControl1(6, 2).VerticalAlignment = GridVerticalAlignment.Middle gridControl1(6, 2).HorizontalAlignment = GridHorizontalAlignment.Center Stefan

Mahesh Naik
Replied On September 24, 2004 06:28 AM

thank you. currently i am a VB dabbler.What namespaces i use? you have given the variables without fully qulified names.? >Hi Mahesh, > >First you need to set >Options.MergeCellsMode = GridMergeCellsMode.OnDemandCalculation|GridMergeCellsMode.MergeRowsInColumn|GridMergeCellsMode.MergeColumnsInRow; > >then for individual cells: > >- to merge neighbouring columns in same row set > >cell.Item(row, col).MergeCell = GridMergeCellDirection.ColumnsInRow > >- to merge neighbouring rows in same column set > >cell.Item(row, col).MergeCell = GridMergeCellDirection.RowsInColumn > >In order to center text within a covered range, you first make it a covered range and set vertical and horizontal alignemnt, e.g. > > > gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(6, 2, 7, 6)) > gridControl1(6, 2).VerticalAlignment = GridVerticalAlignment.Middle > gridControl1(6, 2).HorizontalAlignment = GridHorizontalAlignment.Center > > >Stefan > > >

Mahesh Naik
Replied On September 24, 2004 07:05 AM

cant i have the property assigned to a full column.? a full row?. i have 17 copies of the grid , each with a different number of rows and different text matter in the columns. i want the msflxgrideffect of vb6, > >thank you. currently i am a VB dabbler.What namespaces i use? >you have given the variables without fully qulified names.? > >>Hi Mahesh, >> >>First you need to set >>Options.MergeCellsMode = GridMergeCellsMode.OnDemandCalculation|GridMergeCellsMode.MergeRowsInColumn|GridMergeCellsMode.MergeColumnsInRow; >> >>then for individual cells: >> >>- to merge neighbouring columns in same row set >> >>cell.Item(row, col).MergeCell = GridMergeCellDirection.ColumnsInRow >> >>- to merge neighbouring rows in same column set >> >>cell.Item(row, col).MergeCell = GridMergeCellDirection.RowsInColumn >> >>In order to center text within a covered range, you first make it a covered range and set vertical and horizontal alignemnt, e.g. >> >> >> gridControl1.CoveredRanges.Add(GridRangeInfo.Cells(6, 2, 7, 6)) >> gridControl1(6, 2).VerticalAlignment = GridVerticalAlignment.Middle >> gridControl1(6, 2).HorizontalAlignment = GridHorizontalAlignment.Center >> >> >>Stefan >> >> >>

Administrator [Syncfusion]
Replied On September 24, 2004 07:26 AM

Sure. to assign the value to a column: - to merge neighbouring rows in same column set grid.ColStyles.Item(col).MergeCell = GridMergeCellDirection.RowsInColumn Same with rows using grid.RowStyles.Item(row). Stefam

Mahesh Naik
Replied On September 24, 2004 07:55 AM

thank you, i managed col and row, but what about the option statement on the top. Do i use the or operator instaed of | in VB? and how do i set it in vb i am trying it on a tiny t41 right now..waiting..

Mahesh Naik
Replied On September 24, 2004 08:11 AM

Options.MergeCellsMode = GridMergeCellsMode.OnDemandCalculation|GridMergeCellsMode.MergeRowsInColumn|GridMergeCellsMode.MergeColumnsInRow; what is the fully qualified syntax to set. I drilled down to locate where option as present but i got it only as a readonly property?

Administrator [Syncfusion]
Replied On September 24, 2004 11:04 AM

Mahesh, try grid.Model.Options.MergeCellsMode = GridMergeCellsMode.OnDemandCalculation Or GridMergeCellsMode.MergeRowsInColumn Or GridMergeCellsMode.MergeColumnsInRow Stefan

Mahesh Naik
Replied On September 25, 2004 08:09 AM

Good morning, .no doenot work.. i have a grdcontrol with name msfgsection my statement is with msfgsection .grid.model.option...........=....... it tells me grid id not a memebr of ''syncfusion.Windows.froms.grid.gridcontrol'' how do i reference the parent ? I managed to compile my data entry application just a hr back but without the mer effect.Every row is repeating the question text...

Mahesh Naik
Replied On September 25, 2004 09:40 AM

hello, i manged to get it.Is a grid and gridcontrol the same object?. i just put.model.option.mergecells onthe rhs..., and managed to put through a translation. I am finding the code becoming more dirtier. I have 17 instances. How do i create my own grid based on your grid(by using it a parent and inherting only what the son likes) . I have also to handle 8 different colour styles on all the grids. 2 more remaining glitches, please before i start evaluating the software ... i want to disable sorting,editing and column sizing. Basically i donot want any more properties than waht i got with MSFlexgrid with vb 6,0. My developers had used that .ocx and i [with a lot of patient help from C1] poted it to C1flexgrid. I like your covered cells as it saves me a lot of I/O. 700 Question texts had to be repaeted at each row allocated for the groups of answers for a question. after trial and testing for a next survey [with lots of money only] i may intend to use syncfusion grid though you are missing a zip compatible library in your pocket emptying product.

Administrator [Syncfusion]
Replied On September 25, 2004 03:38 PM

If you are using a GridDataBoundGrid, you can set properties to control the things you mentions. //turn off sorting this.gridDataBoundGrid1.SortBehavior = GridSortBehavior.None; //turn off column sizing this.gridDataBoundGrid1.ResizeColsBehavior = GridResizeCellsBehavior.None; //turn off editing this.gridDataBoundGrid1.Binder.EnableEdit = false;

Mahesh Naik
Replied On September 26, 2004 04:35 AM

I am using a vanilla unbound grid with only 2 events as of now. i handle keydown and rowcol chnage[after change].

Mahesh Naik
Replied On September 26, 2004 05:15 AM

how do i disable editing ? unbound gridcontrol

Administrator [Syncfusion]
Replied On September 26, 2004 05:47 AM

this.grid.ReadOnly = false; will do it. There are several other ways you can do it as well such as handling the grid.CurrentCellStartEditing event and setting e.Cancel = true, or using CellType = "Static" for all your cells (this.grid.TableStyle.CellType = "Static";).

Mahesh Naik
Replied On September 26, 2004 07:29 AM

i mean readonly for the user , not the program. i take the keystrokes and execute them based on my edit logic. I tried readonly but then it makes it readonly even for the program. >this.grid.ReadOnly = false; will do it. > >There are several other ways you can do it as well such as handling the grid.CurrentCellStartEditing event and setting e.Cancel = true, or using CellType = "Static" for all your cells (this.grid.TableStyle.CellType = "Static";).

Administrator [Syncfusion]
Replied On September 26, 2004 06:55 PM

You still use grid.ReadOnly = true. When you want to programatically change something, you first set grid.IgnoreReadOnly = true, make teh change from code, and then set grid.IgnoreReadOnly = flase to trun the readonly back on for your user.

Mahesh Naik
Replied On September 27, 2004 02:07 AM

may not work. some questions take their feedback from a list of values already listed in column 3.while selecting the arrows take you up and down only within the question boundries. To really run away from the question i use \ char{actually it is user selctable}. for questions like age i actually trap the key strokes within a cell and validate them to be within the acceptable allowed bounds. Either i want the editing switched off or all input to be filtered by me so that i can translate the keystrokes. I want your mercedes car to run like my bullock cart because the road only allows that. Mahesh Naik

Administrator [Syncfusion]
Replied On September 27, 2004 10:02 AM

You are free to design your own custom cell type that handles all aspects of the user''s interaction with a specific cell in keyboard interaction. Take a look at the discussion Deriving a Cell Control in the grid user guide\essentialgrid overview\deriving a cell control. We ship many samples that use custom cell types. Do a search in the grid\samples for CellModels.Add. This will show you more than 20 examples. To handle keystrokes in a custom cell type, you can the techninues discussed in this forum thread. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=8961

Mahesh Naik
Replied On September 28, 2004 07:06 AM

thank you .I was excatly doing that right now. that is only thing pendig for me to learn about the relevant ideas about your grid . I will come back after a couple of days.

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.

;