CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Thread: Data Grid

  1. #1
    Join Date
    Sep 2002
    Location
    India (Delhi)
    Posts
    199

    Thumbs down Data Grid

    HI

    I need a grid which is having coloums on top and left side also.
    like a cross tab grid

    is this possible dot net
    Keep Posting in this Forum

  2. #2
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    1,475

    Re: Data Grid

    Yes, you have two options:
    1. DataGrid: If you want the user to be able to add/delete/edit all the fields. You can customize its appearance to your needs.
    2. ListView: If you want fancy looking list, but the user can only do little editing.

  3. #3
    Join Date
    Sep 2002
    Location
    India (Delhi)
    Posts
    199

    Thumbs down Re: Data Grid

    Quote Originally Posted by jhammer
    Yes, you have two options:
    1. DataGrid: If you want the user to be able to add/delete/edit all the fields. You can customize its appearance to your needs.
    2. ListView: If you want fancy looking list, but the user can only do little editing.
    i need a row heading as we have column heading please tell me how to do that.
    Keep Posting in this Forum

  4. #4
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    1,475

    Re: Data Grid

    What exactly do you need in this "Row Heading"? Number? Words?What is the length of the heading?

  5. #5
    Join Date
    Sep 2002
    Location
    India (Delhi)
    Posts
    199

    Re: Data Grid

    please see the attached file its a jpg file you can get the view as what i want the grid to look like.
    Attached Images Attached Images
    Keep Posting in this Forum

  6. #6
    Join Date
    May 2003
    Location
    Germany
    Posts
    936

    Re: Data Grid

    The solution is simple. Take the System.Windows.Forms.DataGrid class and you have the grid and all you need. After that you can use DataGridTableStyles and DataGridColumnStyles for customizing the look.
    Useful or not? Rate my posting. Thanks.

  7. #7
    Join Date
    Sep 2002
    Location
    India (Delhi)
    Posts
    199

    Re: Data Grid

    Hi torrud

    pls give me some code for that coz i was looking on the net but not find useful code.
    or may be i m lil confused regarding this.
    Keep Posting in this Forum

  8. #8
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    1,475

    Re: Data Grid

    For start, I suggest you drag a DataGrid to the form. Then Right-Click on it, and select AutoFormat. Choose something, and see that the appearance of the grid changed. You can check the properties of the DataGrid, to see all the color properties and play with it.
    The DataGrid has a TableStyles property. You can click on it, and press Add. You will see there is ColumnStyles property. The MappingName is the name of the field in the table datasource. You can play with the background color, and set it to gray.
    After you press ok, you can switch to Code View, go to the InitializeComponents method and see how this is done in code.

    This would be a good start.

  9. #9
    Join Date
    Sep 2002
    Location
    India (Delhi)
    Posts
    199

    Thumbs down Re: Data Grid

    Quote Originally Posted by jhammer
    For start, I suggest you drag a DataGrid to the form. Then Right-Click on it, and select AutoFormat. Choose something, and see that the appearance of the grid changed. You can check the properties of the DataGrid, to see all the color properties and play with it.
    The DataGrid has a TableStyles property. You can click on it, and press Add. You will see there is ColumnStyles property. The MappingName is the name of the field in the table datasource. You can play with the background color, and set it to gray.
    After you press ok, you can switch to Code View, go to the InitializeComponents method and see how this is done in code.

    This would be a good start.

    i got some idea but still confuse how to change the text of RowHeader
    Keep Posting in this Forum

  10. #10
    Join Date
    Feb 2005
    Location
    Israel
    Posts
    1,475

    Re: Data Grid

    The text in RowHeader should be the first column in the grid. The table you are showing will have a column "RowHeader" for example, and each row will be assign with its appropriate row header. This will be shown in the first column of the grid (By setting the ColumnStyles)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured