You said "classic asp", which is not asp.net, which is what led to Yang Shen's question, although you did mention web forms which is not classic asp.
You need to show us your code. How are you getting "multple templates" into the gridview now? The answer will be to add a button with each template, but not knowing what you are doing now means I can't tell you how.
Sorry for the confusion. I don’t have code yet. I am trying to determine the approach first. I am using asp.net.
I confused the issue by using the word “template”. Here I used the word to refer to my 2nd column.
if you go to my test site “emailgen.co” you will a grid where for the one category in column 1 I need 3 rows to accommodate 3 buttons for different template types.
what I am trying to do is to eliminate the need for 3 rows. I want to put the 3 buttons in the first row.
a different category might have 5 different buttons in its row.
hope this clears things up
i do have code for my test site, but it is the standard method for adding buttons to a gridview with bound columns. I can provide it but didn’t think relevant.
It's hard to tell what you should do without the code. But mgebhard's suggestion is helpful, in my opinion, you can try the nested repeater which is very flexible and easy to operate.
Member
105 Points
533 Posts
How do I add a variable number of buttons to a gridview
Jan 23, 2020 09:23 PM|sg48asp|LINK
I have a 2 column gridview in a classic asp web form.
column 1 is called categories, column 2 is called templates.
a category may have a variable number of templates.
in column 2 I want a button for each template associated with the category in column 1
How do I go about getting a variable number of buttons into column 2?
thanks in advance. I prefer vb but can translate c# if I have to.
Contributor
3140 Points
983 Posts
Re: How do I add a variable number of buttons to a gridview
Jan 24, 2020 02:59 AM|Yang Shen|LINK
Hi sg48asp,
Is this project coded with vb script and are you trying to convert it to vb .net?
Best Regard,
Yang Shen
Member
105 Points
533 Posts
Re: How do I add a variable number of buttons to a gridview
Jan 24, 2020 01:50 PM|sg48asp|LINK
It is a vb.net project already.
Contributor
6041 Points
2507 Posts
Re: How do I add a variable number of buttons to a gridview
Jan 24, 2020 03:36 PM|KathyW|LINK
You said "classic asp", which is not asp.net, which is what led to Yang Shen's question, although you did mention web forms which is not classic asp.
You need to show us your code. How are you getting "multple templates" into the gridview now? The answer will be to add a button with each template, but not knowing what you are doing now means I can't tell you how.
Member
105 Points
533 Posts
Re: How do I add a variable number of buttons to a gridview
Jan 24, 2020 04:08 PM|sg48asp|LINK
Sorry for the confusion. I don’t have code yet. I am trying to determine the approach first. I am using asp.net.
I confused the issue by using the word “template”. Here I used the word to refer to my 2nd column.
if you go to my test site “emailgen.co” you will a grid where for the one category in column 1 I need 3 rows to accommodate 3 buttons for different template types.
what I am trying to do is to eliminate the need for 3 rows. I want to put the 3 buttons in the first row.
a different category might have 5 different buttons in its row.
hope this clears things up
i do have code for my test site, but it is the standard method for adding buttons to a gridview with bound columns. I can provide it but didn’t think relevant.
All-Star
53631 Points
23984 Posts
Re: How do I add a variable number of buttons to a gridview
Jan 24, 2020 04:35 PM|mgebhard|LINK
It sounds like you need a different type of data bound control like a FormView or Repeater.
Contributor
3140 Points
983 Posts
Re: How do I add a variable number of buttons to a gridview
Jan 27, 2020 02:05 AM|Yang Shen|LINK
Hi sg48asp,
It's hard to tell what you should do without the code. But mgebhard's suggestion is helpful, in my opinion, you can try the nested repeater which is very flexible and easy to operate.
You can refer to Implement Nested Repeater (Repeater inside Repeater) with example in ASP.Net using C# and VB.Net for more information.
Best Regard,
Yang Shen