Click here to Skip to main content
16,011,475 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: CheckBoxList (ListItem.Selected) Pin
leppie2-Oct-02 9:37
leppie2-Oct-02 9:37 
GeneralRe: CheckBoxList (ListItem.Selected) Pin
Paul Riley2-Oct-02 9:54
Paul Riley2-Oct-02 9:54 
GeneralRe: CheckBoxList (ListItem.Selected) Pin
leppie2-Oct-02 10:17
leppie2-Oct-02 10:17 
GeneralRe: CheckBoxList (ListItem.Selected) Pin
Paul Riley2-Oct-02 10:31
Paul Riley2-Oct-02 10:31 
GeneralRe: CheckBoxList (ListItem.Selected) Pin
leppie2-Oct-02 11:23
leppie2-Oct-02 11:23 
GeneralRe: CheckBoxList (ListItem.Selected) Pin
Paul Riley2-Oct-02 11:55
Paul Riley2-Oct-02 11:55 
GeneralRe: CheckBoxList (ListItem.Selected) Pin
leppie2-Oct-02 12:08
leppie2-Oct-02 12:08 
GeneralRe: CheckBoxList (ListItem.Selected) Pin
Paul Riley2-Oct-02 12:07
Paul Riley2-Oct-02 12:07 
Incidentally, bound datagrids are even cooler. I have one page that needs to display a list of players in a dataset.

The first column needs to contain the name which is also a link to another page, passing the player id as a parameter.

The second column needs to contain the email address which is also a mailto: link.

The third column should be a location. It took me about 15 minutes to knock that together with the following code:
<asp:datagrid id=dgPlayer runat="server" Width="100%" DataMember="Player" DataSource="<%# dsPlayer %>" AutoGenerateColumns="False" DataKeyField="PlayerID">
	<HeaderStyle Font-Bold="True"></HeaderStyle>
	<Columns>
		<asp:TemplateColumn ItemStyle-Width="50%">
			<HeaderTemplate>
				Player <i>(Click to Edit)</i>
			</HeaderTemplate>
			<ItemTemplate>
				<a href='editplay.aspx?guid=<%# DataBinder.Eval(Container.DataItem, "PlayerID" ) %>'>
				<%# DataBinder.Eval(Container.DataItem, "FullName" ) %>
				</a>
			</ItemTemplate>
		</asp:TemplateColumn>
		<asp:TemplateColumn ItemStyle-Width="25%">
			<HeaderTemplate>
				Email
			</HeaderTemplate>
			<ItemTemplate>
				<a href='mailto:<%# DataBinder.Eval(Container.DataItem, "Email" ) %>'>
				<%# DataBinder.Eval(Container.DataItem, "Email" ) %>
				</a>
			</ItemTemplate>
		</asp:TemplateColumn>
		<asp:BoundColumn DataField="Location" HeaderText="Location" ItemStyle-Width="25%"></asp:BoundColumn>
	</Columns>
</asp:datagrid>
It might have taken me a hell of a lot longer to do this using code. DataBinding does seem complicated when you first come to play with it but, like most things in .NET, once you've done it a couple of times it's great.

Paul
GeneralRe: CheckBoxList (ListItem.Selected) Pin
leppie2-Oct-02 12:29
leppie2-Oct-02 12:29 
GeneralRe: CheckBoxList (ListItem.Selected) Pin
Paul Riley2-Oct-02 12:35
Paul Riley2-Oct-02 12:35 
GeneralRe: CheckBoxList (ListItem.Selected) Pin
leppie2-Oct-02 12:59
leppie2-Oct-02 12:59 
GeneralRe: CheckBoxList (ListItem.Selected) Pin
Paul Riley2-Oct-02 13:09
Paul Riley2-Oct-02 13:09 
GeneralIDE for ASP Pin
Sarvesvara (BVKS) Dasa2-Oct-02 0:57
Sarvesvara (BVKS) Dasa2-Oct-02 0:57 
GeneralRe: IDE for ASP Pin
Megan Forbes2-Oct-02 1:02
Megan Forbes2-Oct-02 1:02 
GeneralRe: IDE for ASP Pin
raajsekhar3-Oct-02 2:11
raajsekhar3-Oct-02 2:11 
GeneralRe: IDE for ASP Pin
goddess_spanky3-Oct-02 9:22
goddess_spanky3-Oct-02 9:22 
GeneralJavascript function name Pin
Perica Zivkovic1-Oct-02 23:01
Perica Zivkovic1-Oct-02 23:01 
GeneralRe: Javascript function name Pin
alex.barylski2-Oct-02 12:30
alex.barylski2-Oct-02 12:30 
GeneralControl resizeing... Pin
Ray Cassick1-Oct-02 20:08
Ray Cassick1-Oct-02 20:08 
GeneralRe: Control resizeing... Pin
Paul Watson1-Oct-02 23:05
sitebuilderPaul Watson1-Oct-02 23:05 
GeneralRe: Control resizeing... Pin
Ray Cassick2-Oct-02 4:00
Ray Cassick2-Oct-02 4:00 
GeneralRe: Control resizeing... Pin
Paul Riley2-Oct-02 5:48
Paul Riley2-Oct-02 5:48 
GeneralRe: Control resizeing... Pin
Ray Cassick2-Oct-02 7:16
Ray Cassick2-Oct-02 7:16 
GeneralRe: Control resizeing... Pin
Paul Riley2-Oct-02 7:37
Paul Riley2-Oct-02 7:37 
GeneralClearing Cache in Asp.Net Pin
Jason Weibel1-Oct-02 12:06
Jason Weibel1-Oct-02 12:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.