J
John Straumann
Hello all:
I am trying to populate a GridView with data being read from a call to a web
service. I have seen plenty of examples that simply execute a SQL data
reader, set the Grid data source to the reader, and then call DataBind(),
but I cannot seem to figure out how to build the GridView row by row with
anything except text. I need the 2nd column of the Grid to be a hyperlink or
a button, and this is where I am having an issue. I can build the Grid by
creating a new data table, adding to the data table column by column and
then row by row, and then binding the Grid to the new Data table, but this
only shows plain text.
Using the designer I also tried creating 3 columns in the Grid, the first
one as text, the 2nd as a ButtonField (I also tried a hyperlink), and the
3rd as text, but when I ran the page I ended up with 6 columns, and the ones
I had created in the designer were empty.
I also tried creating a HyperlinkField and also a ButtonField and setting
the cells in the 2nd column to that, but that did not work either.
Any and all advice is greatly appreciated.
John.
I am trying to populate a GridView with data being read from a call to a web
service. I have seen plenty of examples that simply execute a SQL data
reader, set the Grid data source to the reader, and then call DataBind(),
but I cannot seem to figure out how to build the GridView row by row with
anything except text. I need the 2nd column of the Grid to be a hyperlink or
a button, and this is where I am having an issue. I can build the Grid by
creating a new data table, adding to the data table column by column and
then row by row, and then binding the Grid to the new Data table, but this
only shows plain text.
Using the designer I also tried creating 3 columns in the Grid, the first
one as text, the 2nd as a ButtonField (I also tried a hyperlink), and the
3rd as text, but when I ran the page I ended up with 6 columns, and the ones
I had created in the designer were empty.
I also tried creating a HyperlinkField and also a ButtonField and setting
the cells in the 2nd column to that, but that did not work either.
Any and all advice is greatly appreciated.
John.