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

  1. #1

    Default Complex DataGrid

    Hi,

    Based on the article I have read so far, I know we could customize
    datagrid at column level, how about cell level?


    What I want to achieve is the datagrid only have one column, some cells
    are just like normal BoundColumn, some of them are comboBox. Is it
    possible?


    Thanks

    zhuang Guest

  2. Similar Questions and Discussions

    1. Complex SQL?
      Hi, I have a table which contains subscriptions from students, bu they are tagged with a date (so I have a kind of history). Both 'email' and...
    2. Complex Paths
      Whats up: Anyone know of some good turotials that concentrate on creating mid-to-advanced paths in Illustrator CS... I'm getting the hang of it on...
    3. Presenting complex query results through datagrid
      lets assume that i run a query that returns the following records countryID,countryName,cityID,cityName 1,USA,1,Chicago 1,USA,2,Los Angeles...
    4. Bind Complex Custom Business Object to DataGrid
      Guys, Still fairly new to ASP.NET. I want to bind a collection of (what I think are) fairly complex Business Objects to a DataGrid. The...
    5. complex condition
      I know there must be a way to do the following: if (($foobar > 3) || ($foo="t" && $bar = "b")) {print "yup"} Of course this is wrong, but what...
  3. #2

    Default Re: Complex DataGrid


    Hi,

    I don't know what article you're talking about but it is quite possible to
    customize your datagrid at even the cell level. What you can do is to use
    the ItemDataBound event, (or in any subroutine loop through the
    DataGridItemCollection) and actually add controls or remove controls from a
    cell. This way you can have a column with a cell containing a combobox, and
    the next one with a textbox.

    It'd be best in your case if you set that column as a template column to
    start with. Then in your template, add whatever controls you feel can be
    present in the cell. Now when binding the datagrid, the ItemDataBound event
    will fire. You can look for the control
    (e.Cells(0).FindControl("controlname")) and hide it, or set its value, or
    replace it with a literal containing the text you want from the dataset.

    HTH
    Altaf

    --------------------------------------------------------------------------------
    All that glitters has a high refractive index.
    [url]www.mendhak.com[/url]


    "zhuang" <zhuang.lui@caudwellcommunications.co.uk> wrote in message
    news:1131116359.136193.265030@g49g2000cwa.googlegr oups.com...
    > Hi,
    >
    > Based on the article I have read so far, I know we could customize
    > datagrid at column level, how about cell level?
    >
    >
    > What I want to achieve is the datagrid only have one column, some cells
    > are just like normal BoundColumn, some of them are comboBox. Is it
    > possible?
    >
    >
    > Thanks
    >

    S.M. Altaf [MVP] 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