Displaying Strings in a DataGrid Control

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

  1. #1

    Default Displaying Strings in a DataGrid Control

    I'm trying to display a string in a datagrid control and
    can't workout how to do it. In VB6 i used a MSFlexGrid
    ctrl.

    flxProjNum.TextMatrix(1, 0) = "HELLO"

    It seems the the datagrid control is supposed to be bound
    to a datasource and display that.

    Is there a way to do what i did in VB6? I am using an
    Informix database with openlink ODBC drivers(so no data
    adapters and sql server answers please!

    Thanks

    Duncan

    Duncan Guest

  2. Similar Questions and Discussions

    1. Displaying a user control
      Hi, I can't display a user control and the person whos user control it is said, <?IMPORT NAMESPACE="prog"...
    2. DataGrid-DataView-XML-Sorting strings as numeric
      I am populating a DataGrid with xml. I need to be able to sort some of the columns. However, the DataView.Sort is treating my strings (which are...
    3. Datagrid Displaying
      Paul, there are over 100 rows returned in the dataset. Also, I tried to reply to the original message thread and got an ASP.Net Error so I had to...
    4. datagrid control not displaying certain text with <brackets>
      im trying to insert a word enclosed in brackets but only shows up blank on the webpage. My database holds "<microsoft> security" but the cell in...
    5. #25122 [NEW]: Control over typecasting objects to strings
      From: a at b dot c dot de Operating system: Any PHP version: 5.0.0b1 (beta1) PHP Bug Type: Feature/Change Request Bug...
  3. #2

    Default Displaying Strings in a DataGrid Control

    So from the lack of response can i assume that you cannot
    do what i proposed!

    Is it the lack of sql server thats the problem?
    >-----Original Message-----
    >I'm trying to display a string in a datagrid control and
    >can't workout how to do it. In VB6 i used a MSFlexGrid
    >ctrl.
    >
    >flxProjNum.TextMatrix(1, 0) = "HELLO"
    >
    >It seems the the datagrid control is supposed to be bound
    >to a datasource and display that.
    >
    >Is there a way to do what i did in VB6? I am using an
    >Informix database with openlink ODBC drivers(so no data
    >adapters and sql server answers please!
    >
    >Thanks
    >
    >Duncan
    >
    >.
    >
    Duncan Guest

  4. #3

    Default Re: Displaying Strings in a DataGrid Control

    Sorry if i wasn't clear i was just trying to be brief as
    possible with the description of my problem.

    So...

    In vb6 i have used the flxgrid control to display simple
    strings ie. set the flexgrid called flxProjNum
    textmatrix property to Hello at row one, column zero to
    equal "HELLO"

    flxProjNum.TextMatrix(0, 0) = "HELLO"
    flxProjNum.TextMatrix(1, 0) = "Goodbye"

    Hello ! !
    --------------------------
    Goodbye! !
    --------------------------
    ! !

    I cannot find a way to do this with the asp.net datagrid
    control. It seems to need a dataset object containing your
    query results. I cannot do this because our ODBC
    connection and database don't seem to be compatible with
    the datagrid.

    What i could do was just set the appropriate col and row
    of the flxgrid the grid to equal the raw values from the
    query. ie display a colum of ordernumbers

    rs = adodb an recordset

    do while not rs.eof

    flxProjNum.TextMatrix(i, 0) = rs!ordernumber
    rs.movenext
    i = i +1
    loop

    Hope this helps to explain my problem better.
    Duncan
    Duncan Tippins Guest

  5. #4

    Default Re: Displaying Strings in a DataGrid Control

    Hi Duncan,

    As far as I know, the grid has to be bound. If you're interested, our
    Spread for Web Forms product will do what you need:

    fpSpread1.Sheets(0).Cells(0,0).Text = "Hello"
    fpSpread1.Sheets(0).Cells(1,0).Text = "Goodbye"

    It can be used in bound mode or in unbound mode - no databinding
    needed. Here's the link for more info, online demos, and video
    tutorials:
    [url]http://www.fpoint.com/netproducts/spreadweb/spread.html[/url]

    - Donald
    >
    > In vb6 i have used the flxgrid control to display simple
    > strings ie. set the flexgrid called flxProjNum
    > textmatrix property to Hello at row one, column zero to
    > equal "HELLO"
    >
    > flxProjNum.TextMatrix(0, 0) = "HELLO"
    > flxProjNum.TextMatrix(1, 0) = "Goodbye"
    Don 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