Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default ASP.NET data grid

    I'm building an ASP.NET application that stores/retrieves data using
    MS-Access. I have a datagrid that I want to populate with a datatable.
    However, I only want to display certain columns. I'm wondering how I
    can manually assign specific columns from the datatable, to specific
    columns in the data grid.
    Thanks.
    J. Babe Guest

  2. Similar Questions and Discussions

    1. trying to create data grid on the fly, with templated columns, and then updating all rows in the grid
      Hi, Please help, I'm trying to create data grid on the fly, with templated columns, for editing, and then updating all rows in the grid on one...
    2. Problem with Data Grid reading dynamic data
      I have created a website that uses datagrids to read data from an asp page. It works great, and fills the datagrid perfectly but it does not work...
    3. How to display a set of data in a data grid when drivenby a combo box?
      I am trying to build a page where the user can select a syle of food (i.e. chinese, italian etc) from a combo. I would then want the relevent...
    4. Drag and drop data between cells in a data grid
      Check out this, dino has explained how to do drag and drop in datagrid http://msdn.microsoft.com/msdnmag/issues/04/01/CuttingEdge/default.aspx --...
    5. Display data from database in a scrollable data grid on an ASP Page
      Hi All, I want to display data from database in a scrollable data grid on an ASP Page. I want to use it for entering data also. Should i have to...
  3. #2

    Default Re: ASP.NET data grid

    You can do this by adding a DataGridTableStyle item to the datagrid. See
    online help for DataGridTableStyle and DataGridColumnStyle.

    Hope it helps...

    "J. Babe" <babe_jt@hotmail.com> wrote in message
    news:8b32873e.0308040645.411fc0b8@posting.google.c om...
    > I'm building an ASP.NET application that stores/retrieves data using
    > MS-Access. I have a datagrid that I want to populate with a datatable.
    > However, I only want to display certain columns. I'm wondering how I
    > can manually assign specific columns from the datatable, to specific
    > columns in the data grid.
    > Thanks.

    niceguy Guest

  4. #3

    Default Re: ASP.NET data grid

    I was wondering if you have to add a reference to System.Windows.Forms
    to use the DataGridStyle class in a web application?


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    J. Babe Guest

  5. #4

    Default Re: ASP.NET data grid

    No, System.Windows.Forms is only for desktop applications.

    Only System.Web.UI.WebControls are valid controls for web apps.

    bill


    "J. Babe" <babe_jt@hotmail.com> wrote in message
    news:#LmUZypWDHA.1632@TK2MSFTNGP11.phx.gbl...
    > I was wondering if you have to add a reference to System.Windows.Forms
    > to use the DataGridStyle class in a web application?
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    William F. Robertson, Jr. Guest

  6. #5

    Default Re: ASP.NET data grid

    Your best bet is to limit your query - -
    Select Fname, Lname, Email from tablename

    instead of Select * from TableName

    However, no matter what your query - - you can use the AutoGeneratecolumns
    property of the DataGrid:
    AutoGeneratecolumns =False

    Then, for each Field you need to use, use a boundcolumn tag (inside Column
    tags) -- something like:
    ........AutoGenerateColumns="False"> '<--inside your DataGrid Tag

    <columns>

    <asp:BoundColumn DataField="product" HeaderText="Product"></asp:BoundColumn>

    <asp:BoundColumn DataField="ProdID" HeaderText="ProductID"
    ItemStyle-HorizontalAlign="Center"
    HeaderStyle-HorizontalAlign="Center"></asp:BoundColumn>

    <asp:BoundColumn DataField="Quantity" HeaderText="Quantity"
    ItemStyle-HorizontalAlign="Center"
    HeaderStyle-HorizontalAlign="Center"></asp:BoundColumn>

    </columns>



    David Wier
    [url]http://aspnet101.com[/url]
    [url]http://aspexpress.com[/url]


    "J. Babe" <babe_jt@hotmail.com> wrote in message
    news:8b32873e.0308040645.411fc0b8@posting.google.c om...
    > I'm building an ASP.NET application that stores/retrieves data using
    > MS-Access. I have a datagrid that I want to populate with a datatable.
    > However, I only want to display certain columns. I'm wondering how I
    > can manually assign specific columns from the datatable, to specific
    > columns in the data grid.
    > Thanks.

    David Wier 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