Gridview Control and Customizing Column Displays

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

  1. #1

    Default Re: Gridview Control and Customizing Column Displays

    > I want it to show in Column 1, a customized version of the data...
    > In that first column, the Picture, with the name underneath it, a link
    > that
    > points to a url like: http://www.mysite.com/scripts/?getxml=<itemID> and
    > a
    > javascript call that pops up the itemsummary on the page....
    Don't autogenerate the columns.
    For the Column1, make it 'HyperlinkField' with

    1. DataNavigateUrlFormatString set appropriately, including placeholder for
    itemID
    2. DataNavigateUrlFields set to "itemID"
    3. DataTextUrlField set to itemID
    4. Optionally, DataTextFormatString set appropriately, like "See Item {0}",
    etc.

    I have provided an example below. Use it with a data-source that connects to
    Northwind and points to 'Customers' table.

    <asp:HyperLinkField DataNavigateUrlFields="CustomerID"
    DataNavigateUrlFormatString="~/Default.aspx?id={0}"
    DataTextField="CustomerID" />

    --
    Happy Hacking,
    Gaurav Vaish | [url]www.mastergaurav.com[/url]
    [url]www.edujini-labs.com[/url]
    [url]http://eduzine.edujinionline.com[/url]
    -----------------------------------------


    Gaurav Vaish \(MasterGaurav\) Guest

  2. Similar Questions and Discussions

    1. Showing the column headers of a GridView when there is no data
      Hi, Is there a way to show the column headers of a GridView control even if there is no data? The only thing I see is the EmptyDataTemplate but I...
    2. How to custom gridview control if it derive from web user control?
      How to custom gridview control (modify column templates) if it derived from web user control? I have a web user control which contains one...
    3. GridView control -- SQL advanced options disabled
      Usually this occurs because the data source is not updateable. I saw this when someone was specifying a SQL Serve VIEW as the data source, rather...
    4. Making datagrid hyperlink column displays Link or Text???
      I am creating a download page that will display a download link for each product that has not already been downloaded.. I know how to test for...
    5. customizing attribute values for control properties
      Is there somewhere an example on how to customize the serialization of control properties to aspx/ascx control attributes? I've implemented...
  3. #2

    Default Re: Gridview Control and Customizing Column Displays

    > I want it to show in Column 1, a customized version of the data...
    > In that first column, the Picture, with the name underneath it, a link
    > that
    > points to a url like: http://www.mysite.com/scripts/?getxml=<itemID> and
    > a
    > javascript call that pops up the itemsummary on the page....
    Don't autogenerate the columns.
    For the Column1, make it 'HyperlinkField' with

    1. DataNavigateUrlFormatString set appropriately, including placeholder for
    itemID
    2. DataNavigateUrlFields set to "itemID"
    3. DataTextUrlField set to itemID
    4. Optionally, DataTextFormatString set appropriately, like "See Item {0}",
    etc.

    I have provided an example below. Use it with a data-source that connects to
    Northwind and points to 'Customers' table.

    <asp:HyperLinkField DataNavigateUrlFields="CustomerID"
    DataNavigateUrlFormatString="~/Default.aspx?id={0}"
    DataTextField="CustomerID" />

    --
    Happy Hacking,
    Gaurav Vaish | [url]www.mastergaurav.com[/url]
    [url]www.edujini-labs.com[/url]
    [url]http://eduzine.edujinionline.com[/url]
    -----------------------------------------


    Gaurav Vaish \(MasterGaurav\) 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