Create Columns at run time

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default Create Columns at run time

    if you place a datagrid on a form and then, in Property builder, check the
    box saying Create Columns at run time. An then do a SQL Select into a
    datatable, and then bind the datatable to the grid, the grid displays
    correctly. BUT, the columns array is empty. The grid displays just fine.
    There are cells and rows but no columns.

    I want to make some of the columns non visible but I can't because there are
    no columns.

    Why is this?
    Thanks,
    Tina


    Tina Guest

  2. Similar Questions and Discussions

    1. Dynamically create datagrid columns
      I am trying to write a user control that is essentially a DataGrid with some custom functionality. My grid is to be bound to a custom collection....
    2. Create Columns Automatically at Runtime
      We have been having some unexplainable datagrid issues and questions on this subject and our messages have largely been ignored when posting to this...
    3. How To Create Columns?
      Im using CF6.1 and Access. I want to run a query or somehting that will allow me to create columns in access. Im designing a setup page for my app,...
    4. create dynamic columns
      Any one knows how to display sentence in 3 colums in coldfusion . Thank you!
    5. Hidden columns in execution time
      Hi, I have one datagrid where the columns are mounted in execution time and use a column template where exists a link. One necessary to make that...
  3. #2

    Default Re: Create Columns at run time

    If the columns are going to be made automatically at run-time, then you
    can't modify them at design-time.

    If you are going to want to configure aspects of the columns yourself, then
    you'll need to un-check "Create columns automatically at run time." and
    manually add columns yourself.

    I suggest adding Bound columns first and configuring each to be bound to the
    appropriate data field from your data source. After they are created and
    working, I would then click the link in the bottom of the Property Builder
    to "Convert to Template Column", so that you can get even more control over
    the configuration of the columns.



    "Tina" <tinamseaburn@nospammeexcite.com> wrote in message
    news:etkkuquxFHA.3384@TK2MSFTNGP10.phx.gbl...
    > if you place a datagrid on a form and then, in Property builder, check the
    > box saying Create Columns at run time. An then do a SQL Select into a
    > datatable, and then bind the datatable to the grid, the grid displays
    > correctly. BUT, the columns array is empty. The grid displays just fine.
    > There are cells and rows but no columns.
    >
    > I want to make some of the columns non visible but I can't because there
    > are no columns.
    >
    > Why is this?
    > Thanks,
    > Tina
    >

    Scott M. Guest

  4. #3

    Default Re: Create Columns at run time

    I Can't do what you say because my program is a SQLTable Update Utility. I
    don't know what the columns will be at design time.

    I'm "Creating the columns at run time" via a databind which does indeed
    create the grid correctly but the Columns array is nothing i.e.
    Datagrid1.columns(0) is out of bounds.

    It seems the columns array should be there. the Headertext is even there
    which is an attribute of the columns in the array.

    What is really odd is related to another thread you replied to where my
    datagrid was empty in a subsequent button click event. It was because I had
    the Create columns checkbox checked!!!!!!!! When I unchecked it, my grid
    had all of its rows and data in the button event. I think thats a bug in
    the grid componnet.
    T

    "Scott M." <s-mar@nospam.nospam> wrote in message
    news:u4zPlGwxFHA.3300@TK2MSFTNGP09.phx.gbl...
    > If the columns are going to be made automatically at run-time, then you
    > can't modify them at design-time.
    >
    > If you are going to want to configure aspects of the columns yourself,
    > then you'll need to un-check "Create columns automatically at run time."
    > and manually add columns yourself.
    >
    > I suggest adding Bound columns first and configuring each to be bound to
    > the appropriate data field from your data source. After they are created
    > and working, I would then click the link in the bottom of the Property
    > Builder to "Convert to Template Column", so that you can get even more
    > control over the configuration of the columns.
    >
    >
    >
    > "Tina" <tinamseaburn@nospammeexcite.com> wrote in message
    > news:etkkuquxFHA.3384@TK2MSFTNGP10.phx.gbl...
    >> if you place a datagrid on a form and then, in Property builder, check
    >> the box saying Create Columns at run time. An then do a SQL Select into
    >> a datatable, and then bind the datatable to the grid, the grid displays
    >> correctly. BUT, the columns array is empty. The grid displays just
    >> fine. There are cells and rows but no columns.
    >>
    >> I want to make some of the columns non visible but I can't because there
    >> are no columns.
    >>
    >> Why is this?
    >> Thanks,
    >> Tina
    >>
    >
    >

    Tina Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139