Welcome to the Xceed Community | Help
Community Search  

Best way to achieve various results

Sort Posts: Previous Next
  •  11-14-2008, 3:19 AM Post no. 16875

    Best way to achieve various results

    Hello,

    I am evaluating the Data Grid for .NET to see if it will meet our needs.  I would like to know the best way to accomplish, or even if it's possible, various results as defined below.  Please note that not all requirements are displayed simultaneously, so some requirements may seem to contradict each other.  They're just seperate displays.

    • Some data comes from multiple identical databases, where each value from each database is displayed as a seperate column on a row.  Is it possible to use databinding for this?  Or should I create a business object with the data and use that as a data source?  Or would it be best to do this unbound?
    • Data needs to be displayed in row pairs.  That is, Row 0 and 1 are grouped together, row 2 and 3 are grouped together, etc.. I need these pairs to appear as if they're one 'row' visually, even though they are two rows of cells editable seperately and each row is a different row in the database(s).  In other words, the botton border of row 0 is not shown, nor is the top border of row 1, and this alternates.  Additionaly, when a row is selected, i need to highlight the whole row and it's pair row.
    • I need to display multiple "sections" of rows with different columns and types.  For example, Rows 1-10 are an "orders" section, with order data (not master/detail) but rows 11-20 are Accounts.  Ideally these sections are collapsing.  Conceptually this is similar to a report with different sections of totally different data.  I don't think i can use groups because my understanding is that groups only work on sets of the same data.
    • I need to format data different depending on which row of a pair it is.  For example, column 0 is a date/time type.  Row 0, col 0 has to display the date, and row 1, col 0 of the pair has to display the time (they are two seperate columns in the database, date and time, both datetime types).  It's this requirement that makes me think i'll be forced to do this unbound, although I suppose I could do some temporary table magic to massage it into the right format for binding, but it still needs to format the data diffrently depending on whether it's the top or bottom row of the pair.

    I know this is a lot of stuff, and i'm not looking for complete solutions, just some general shoot from the hip advice on how to tackle each problem with the Xceed Grid.

    Thanks

  •  11-14-2008, 3:54 PM Post no. 16894 in reply to 16875

    Re: Best way to achieve various results

    1- Not possible.  Need to create business object, or do it unbound.

    2- This could be, but will require you to derive from the current classes and create your own classes to handle this.  There is no out-of-the-box feature that will permit you to do this, so it will require a bit of work.  If you decide to go this way, we can provide a sample showing how to "play" with row borders.

    3- Not possible to have a different set of columns, except for the master row / detail row. Only solution is to use two different grids.

    4- Each cell can have its own combination of editor and viewers, which allows you to do this.  We have a sample showing this, but you need to have the product installed on your machine to be able to see it.

    Look at the Rich Cell editors sample that you find in the Xceed Grid Live Explorer (Start Menu -> All Programs -> Xceed Components -> Our components in action! -> Xceed Grid Live Explorer).  Every editor/viewer in the "Editors" column is different in each row.

    You will find the code here under XP:

    C:\Program Files\Xceed Components\Xceed Grid for .NET <version>\Samples\CSharp\RichCellEditor

    Under Vista, it will be here :

    C:\Xceed Component Samples\Xceed Grid for .NET <version>\Samples\CSharp\RichCellEditor

     


    André
    Software Developer and Tech Support
    Xceed Software Inc.
  •  11-14-2008, 10:09 PM Post no. 16904 in reply to 16894

    Re: Best way to achieve various results

    André:

    3- Not possible to have a different set of columns, except for the master row / detail row. Only solution is to use two different grids.

    Hmm.. that's disappointing.  I was thinking of perhaps using a dummy master row and then use the detail to create the actual groups.  However, upon investigating it looks like each master record uses the same detail row(s), so that kind of defeats the purpose unless I wish just hide the details i don't want for each section, which seems rather inefficient.

    Is there any way to embed a full grid within a grid cell?  If so, that's a possible solution.  Multiple grids outside would be too difficult to manage given that their size would actually be variable.

    André:

    4- Each cell can have its own combination of editor and viewers, which allows you to do this.  We have a sample showing this, but you need to have the product installed on your machine to be able to see it.

    Yes, i understand that.  I guess that wasn't my question.  I was referring to the fact that my records look like this:

    Date, Time, Foo, Bar

    However, my pair rows have to look like this where Date and time are seperate columns but must sort of "superimpose" each other.

    Row 0: Date | Foo | Bar
    Row 1: Time | Foo | Bar

    Thanks for the info on the first two items.

  •  11-17-2008, 11:47 AM Post no. 16940 in reply to 16904

    Re: Best way to achieve various results

    Attachment: OldVsNewEditors.zip

    3- The SynchronizeDetailGrids property on the GridControl permits you to set different columns on each details when it is set to false.  So I think it would do what you want.

    In addition, it is possible to place a GridControl within a cell.  If you look at the same editor sample I was referring to, the last cell of the Editor column is a GridControl.

    4- The sample I referred to might not have been the best to demonstrate that, but the important thing to understand is that our DatePicker control does not support time, so you need to use a different control to display time.  So two different editors in the same column, as the sample demonstrates.  The other option is to use another control that support both date and time, and that will display properly according to the underlying data.

    To demonstrate the first option (a DatePicker for date and another control for time), I have attached a sample giving a possible solution for this.  It is a sample that demonstrates the difference between the old editors (grid version 2.5 and down) and the new editors (grid version 3.0 and up).  If you concentrate only on the new editors, and look at "Date -1 Normal date edition" and at "Custom 1 -Time edition", it should give you what you need.

     


    André
    Software Developer and Tech Support
    Xceed Software Inc.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.