servicegroup
asked on
GridView bound to Array
Hi,
GridView beginner needs to display an array of strings. I think I will have to use itemtemplates to display some of the strings as hyperlinks, but I am not sure how.
I want to display the grid as:
hyperlink[0,0]
text[0,1] hyperlink[0,2]
hyperlink[1,0]
text[1,1]hyperlink[1,2]
GridView beginner needs to display an array of strings. I think I will have to use itemtemplates to display some of the strings as hyperlinks, but I am not sure how.
I want to display the grid as:
hyperlink[0,0]
text[0,1] hyperlink[0,2]
hyperlink[1,0]
text[1,1]hyperlink[1,2]
Do you mean DataGridView or is this some other object type?
ASKER
I was assigned to use GridView. Is this not possible? What is DataGridView? I can't find it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your help, but I got figured it out. For the next person, and this is probably not the best approach, but here is what I did:
-Filled a datatable with my array, a different column for each "category of data" in my array([0,0] was title, [0,1] was summary, [0,2] was a number - so i made 3 columns: title, summary, and number), with a mydatarow["Title"] = myArray[0,0]; mydatarow["Summary"]= myArray[0,1]... add mydatarow to table)
- made the datatable my gridview source, and bound
-To get the desired format, I made autogenerate columns false, made an item template, then used '<%# Eval("myDataTableColumnNam e")%>' as the value for label text and navigateURLs.
-Filled a datatable with my array, a different column for each "category of data" in my array([0,0] was title, [0,1] was summary, [0,2] was a number - so i made 3 columns: title, summary, and number), with a mydatarow["Title"] = myArray[0,0]; mydatarow["Summary"]= myArray[0,1]... add mydatarow to table)
- made the datatable my gridview source, and bound
-To get the desired format, I made autogenerate columns false, made an item template, then used '<%# Eval("myDataTableColumnNam