Datagrid and Hyperlinks,,,

Discussion in 'ASP .Net Web Controls' started by Steve Randall, Jan 6, 2004.

  1. I have a bound datagrid in which I want the first column
    to be a hyperlink column. The column value is in my
    dataset used to populate the grid and is called "Student
    ID" which I specify in the "Text field" property of the
    hyperlink column (that I manually add).

    This all works fine except the Student ID column which is
    in my dataset appears TWICE, once as the hyperlink column
    and once as the dataset column. How can I allow the
    hyperlinked "Student ID" column and hide the
    bound "Student ID" column? I have tried the .Visible
    property but it only returns 0 (zero) as the number of
    columns after the BindData() even though the grid contains
    4 columns.

    Many thanks.
    Steve
     
    Steve Randall, Jan 6, 2004
    #1
    1. Advertising

  2. Steve Randall

    Jos Branders Guest

    "Steve Randall" <> wrote in message
    news:0b4f01c3d47a$8e3fcb70$...
    > I have a bound datagrid in which I want the first column
    > to be a hyperlink column. The column value is in my
    > dataset used to populate the grid and is called "Student
    > ID" which I specify in the "Text field" property of the
    > hyperlink column (that I manually add).
    >
    > This all works fine except the Student ID column which is
    > in my dataset appears TWICE, once as the hyperlink column
    > and once as the dataset column. How can I allow the
    > hyperlinked "Student ID" column and hide the
    > bound "Student ID" column? I have tried the .Visible
    > property but it only returns 0 (zero) as the number of
    > columns after the BindData() even though the grid contains
    > 4 columns.
    >
    > Many thanks.
    > Steve


    Set AutoGenerateColumns=False on the DataGrid.
    Then add all your columns as BoundColumn, except the Student ID column.

    --

    Jos
     
    Jos Branders, Jan 7, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jay
    Replies:
    0
    Views:
    486
  2. Alex
    Replies:
    2
    Views:
    531
  3. Grant

    Datareader, Datagrid and hyperlinks

    Grant, Dec 17, 2004, in forum: ASP .Net Building Controls
    Replies:
    5
    Views:
    150
    Ben Strackany
    Dec 22, 2004
  4. Richard Jonker

    dynamically add hyperlinks and buttons to a datagrid

    Richard Jonker, Oct 2, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    728
    Niraj Ranka
    Oct 3, 2006
  5. Grant

    Datareader, Datagrid and hyperlinks

    Grant, Dec 17, 2004, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    240
    Ben Strackany
    Dec 22, 2004
Loading...

Share This Page