I'm trying to concatenate a first and last name from two fields into one column in a datagrid. I can't seem to find docs on this, nor on how to simply retreive the data from the DataSource.<BR><BR>In ASP it was simply a matter of quoting the recordset in delimiters. This seems a bit more complicated.<BR><BR>If someone can point me to a FAQ post on it I would be grateful.Forgive the newB post...<BR>I'm brand spankin' new at this, but...<BR>can't you do this inside the SQL statement and/or SP so that it comes out alright?<BR>For example:<BR><BR>Dim strSQL as string<BR>strSQL = "SELECT ID, FirstName + ' ' + LastName AS Name, PhoneNum FROM tblOperators ORDER BY LastName"<BR><BR>If this is offbase, forgive the post, if not lemme know if it helped.Thanks, I was able to concatenate in the datagrid, but only in the ItemTemplate section. What I really need to do is to put dynamic data in the HeaderTemplate.<BR><BR>I think I need to set up variables in the code, then assign the data to the properties. Haven't figured out how to do this yet.'Code area<BR>.....<BR> Function GetMyHeader() as string<BR> Return "Their ID"<BR> End Function<BR>......<BR><BR>HTML AREA<BR>......<BR><asp
ataGrid id="dgResults" runat="server"<BR>Autogeneratecolumns="false"><BR> <Columns><BR> <asp:TemplateColumn><BR> <headerTemplate><BR> <%# GetMyHeader() %><BR> </headerTemplate><BR> <itemTemplate><BR> <%# Container.DataItem( "UserID" ) %><BR> </itemTemplate> <BR> </asp:TemplateColumn><BR> </Columns><BR></asp
ataGrid><BR>......<BR><BR>Is this closer?Yes. It's a lot closer. How do I get the value of the database column into the function? (Return DBvalue)What value are you trying to place in the header? More info plz.If you look at http://www.charmsmusic.com/charms/adotest4.aspx?id=3456 you will see the the name "Priscilla Turnover" is in the header. I did this by using two queries rather than one, and a separate datagrid. The name is in the ItemTemplate of the first grid.<BR><BR>Then comes the second grid, with the headers and the data. I would like to be able to build this page with one datagrid and one query. It is very possible and easy to do in ASP, but with the .NET I'm having difficulty with the syntax to reference data row variables.I have NOT had a chance to syntatically <sp> check the following logic. This post assumes that in that ordinal position, that name will always pop up. Before you bind to the datagrid try assigning the value to a variable.<BR>Assume objDataReader is the DataReader<BR><BR>Dim m_strName as string<BR>With objDataReader<BR> m_strName = .item( "fldFName" ) & " " & .item( "fldLName" )<BR>End With<BR>.....<BR>In presentation section set autogenerate to false and set one of the column's header text to.<BR>HeaderText = "<%# m_strName %>"<BR><BR>Now, again, I haven't tested this and their could be problems. For example, since it is firehose in nature, assigning and item to a variable might mess it up, the variable might not be assigned properly, and other problems could pop. Sorry I don't have time to code review it, but give it a try and tell me how it works out. If we can't get this to work for you, are you open to using a DataSet and XML such as I proposed in another post (the one that assigned a column header every five items)?

