Still trying to get my ObjetDataSource project with GridView to work as I would like it to work.I would like the DropDownList to show the value from one of the columns in the GridView?If
the value is 0 = “No” or if the value is 1 = “Yes”I have goolgled this but can’t find any good example.
Do you have a simple example for the DropDownList(or the CheckBox would work fine too).
Thank you again![Yes]
I really appreciate that you took the time to explain this to me (and all the other readers of the forum). This solved my problem and now I can concentrate on other tasks in my project instead of searching for more examples that doesn’t help (I have
searched a lot on different forums).I like your approach when you helped me. Some explanation in text
and code example is very helpful when you are stuck and can’t see clearly at your own code.
Zimbran
Member
9 Points
40 Posts
C#/ObjectDataSource/Gridview DropDownList or CheckBox
Aug 04, 2008 09:58 PM|LINK
pkellner
All-Star
24042 Points
3625 Posts
ASPInsiders
Moderator
MVP
Re: C#/ObjectDataSource/Gridview DropDownList or CheckBox
Aug 04, 2008 10:05 PM|LINK
here is a post I did.
http://peterkellner.net/2007/12/13/gridviewdropdownlistrow/
<asp:DropDownList ID="DropDownListUser" runat="server" AutoPostBack="False" DataSourceID="SqlDataSourceUser"
DataTextField="Username" DataValueField="id" SelectedValue='<%# Bind("TemplateUsersId") %>'>
</asp:DropDownList>
http://peterkellner.net
Microsoft MVP • ASPInsider
Zimbran
Member
9 Points
40 Posts
Re: C#/ObjectDataSource/Gridview DropDownList or CheckBox
Aug 05, 2008 10:17 PM|LINK
I can’t get it to work. In need an example where the DataSource is an ObjectDataSource…
pkellner
All-Star
24042 Points
3625 Posts
ASPInsiders
Moderator
MVP
Re: C#/ObjectDataSource/Gridview DropDownList or CheckBox
Aug 05, 2008 11:58 PM|LINK
OK, Here is a post I just did that should help.
http://peterkellner.net/2008/08/05/assign-dropdownlist-in-aspdotnet-to-gridview-in-objectdatasource/
http://peterkellner.net
Microsoft MVP • ASPInsider
Zimbran
Member
9 Points
40 Posts
Re: C#/ObjectDataSource/Gridview DropDownList or CheckBox
Aug 06, 2008 11:28 AM|LINK
Thank you! [Yes] Your post and code example helped me to solve my problem.
Now I have to try to get the ItemTemplate with a label to show me the “Yes” and “No” for True and False… idea?pkellner
All-Star
24042 Points
3625 Posts
ASPInsiders
Moderator
MVP
Re: C#/ObjectDataSource/Gridview DropDownList or CheckBox
Aug 06, 2008 02:11 PM|LINK
You are most welcome!
Here is another post to explain that.
http://peterkellner.net/2008/08/06/assign-label-in-aspdotnet-to-gridview-in-objectdatasource/
http://peterkellner.net
Microsoft MVP • ASPInsider
Zimbran
Member
9 Points
40 Posts
Re: C#/ObjectDataSource/Gridview DropDownList or CheckBox
Aug 06, 2008 02:43 PM|LINK
julien_h
Member
4 Points
2 Posts
Re: C#/ObjectDataSource/Gridview DropDownList or CheckBox
Jun 15, 2009 09:00 AM|LINK
Hello , I have this task to do and I can't seem to figure it out .
I have to show based on my database the number and title of books that every author has based on his ID .
how can I do that using Gridview ?
thank you for your help and plzzz it's kinda urgent !!!!!!!!!