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.

Some questions about nested grids

Thread ID:

Created:

Updated:

Platform:

Replies:

37750 Nov 29,2005 02:31 PM Nov 30,2005 02:40 PM Windows Forms 4
loading
Tags: GridControl
Alejandro Serrano
Asked On November 29, 2005 02:31 PM

Hi, I''m making an application that needs a special way of nesting grids. I''ve just started working with Grid, but I cannot find on documentation a way to do what I''m looking for. As far as I have understood, when I ant to create a nested grid I have to create some kind of relation and populate the data. However, what I need is just create a nested grid and populate it by myself, because each nested grid in the same hierarchy level may be completely different from other. So I have to questions: 1) Is there a way to add cells, columns, rows... to the Grid without relying on data? 2) Can I make nested grids in a hierarchy without any special schema? I mean, creating them by code. I thought there would be some "NestedGrids" collection in some "Row" object, but I cannot manage to find it :-( Thanks in advance

Administrator [Syncfusion]
Replied On November 29, 2005 06:47 PM

There is no way to use either a GridGroupingControl or a GridDataBoundGrid without defining some kind of relation to define the nested tables. Here is one way you can attack this problem. You can use a virtual GridControl and define the grid contents in any manner you would like. It will take some work to do this, but it is possible. One solution would be to have a virtual grid holding your parent table with a +/- cell in the first column. Then when this cell is clicked, a row is inserted in the main grid. You can make this row a covered cell that holds another grid embedded in the cell. This grid could also be a virtual grid that has any number columns/rows. Another way is to use a GridGroupingControl. You say your child tables may vary from parent row to parent row. If there are a few (say three) of these different child tables, you can set the schema up so each child level will display all three tables. Then you can hide the two that you do not want to see for a particular parent row. Both these approaches will take some effort but this latter approach is likely easier to get done.

Alejandro Serrano
Replied On November 30, 2005 11:12 AM

OK, I''ve found how to add the relations. However, I still need two things: 1) How can I hide the nested gids with no actual rows? 2) I would need to add a DropDown with a grid inside that shows available options for a row. However, I don''t know how to create relation/cell. 3) How can I know when a row has been hit? Can I save some kind of Tag property to save an object?

Administrator [Syncfusion]
Replied On November 30, 2005 11:27 AM

Can you give some details on what you are doing? For example, what kind of grid are you using and and what is your data provider?

Alejandro Serrano
Replied On November 30, 2005 02:40 PM

I am not using any data provider (I mean, not SQL Server, or Oracle...). I''m doing a game which needs to a tool to create lists of items. These items can be grouped in different ways that are indeed taken from an XML File. This XML file tells the program which rows, columns and relation show. The data, however, is in an Access file. What I need is to create by-hand made datasets (or write directly in the grid), that show relations. For example, a character may have a mount or not, so this is a kind of relation. However, another one may just carry objects. I was thinking about doing different tables for each character, retrieving by myself the data from Access file. This shows a little better what I''m telling Unit + -- Characters +-- Knight +-- Mount +-- Mount X (with all properties in columns) => This must also have a DropDown to see all available mounts +-- Wizard +-- Magic Objects +-- Potions => this may have a NumericUpDown or similar to add or remove items So what I was going to do is to create a "Unit" table, with relations to every table that is needed in child tables, but hiding what I don''t need (for example, I need to hide "Mount" for wizard). I hope this helps, and you couldhep me. Thanks in advance

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.

;