Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: RE: Datagrid, two fields into one column


Message #1 by "Kieran Dundon" <kierandundon@e...> on Sun, 25 Nov 2001 19:41:02
goto http://www.aspalliance.com/dotnetsolutions
enter keyword Combined Columns

----- Original Message -----
From: "Kieran Dundon" <kierandundon@e...>
To: "ASPX_Professional" <aspx_professional@p...>
Sent: Sunday, November 25, 2001 7:41 PM
Subject: [aspx_professional] RE: Datagrid, two fields into one column


> Bob,
>
> I'm very interested in achieving this (2 fields in 1 Column) however I
> can't seem to make any sense of your example, why are you adding a label
> to the page and what does this have to do with the data grid ? Maybe you
> could add the rest of the code for the page and this would give us a bot
> more of an idea what you did.
>
> Thanks
>
> Kieran
>
>
>
>
>
>
> > Finally found the solution I was looking for !  The solution is to use a
> > TemplateColumn, with an ItemTemplate and label.  It is actually quite
> easy.
> > Lou, suggested having the sql concatenate the fields, but unfortunately
> I
> > was using a common stored procedue and didn't want to change it, but if
> I
> > hadn't found this solution then changing the sql would have worked.
> Here
> > it is:
> >
> > <asp:TemplateColumn HeaderText="test">
> >  <ItemTemplate>
> >   <asp:Label Runat="server"
> >    text='<%# DataBinder.Eval(Container.DataItem,"lastname") + _
> >     " " + _
> >     DataBinder.Eval(Container.DataItem,"firstName") %>'>
> >   </asp:Label>
> >  </ItemTemplate>
> > </asp:TemplateColumn>
> >
> > thanks
> > Bob Horkay
> ---
> VBug Winter Conference 2001
>
> Make no mistake - there's a great learning curve
> for developers moving from COM to .NET.  So why
> would you want to be a pioneer and cross the bridges
> first?  Attend the .NET Developer's Conference
> (28th to 30th November 2001) In London and realise
> the benefits of adopting the technology early.  By
> attending you'll understand the key challenges and
> be left with a thorough understanding of the major
> .NET fundamentals.   If you're already working
> with .NET this is a must-attend event.
>
> http://www.vbug.co.uk/redirect.asp?url=39&id=17
>
> ---
> You are currently subscribed to
> aspx_professional as: westdh@h...
> $subst('Email.Unsub')


  Return to Index