Hi,
I need to show two value (one is image and another is text) in Grid column. How can do it?
/Fakhrul
Yes, I see no reasons for this not to work - I just tested it again locally and it worked great. Just make sure you replace "FirstName" and "LastName" with the respective field names (column names) from your datasource.
Are you still having problems with that?
Thanks. I did it some other way. can you please tell me how i can show 2 value in a single column.
<igtbl:TemplatedColumn> <CellTemplate> <%# Eval("FirstName") %> <%# Eval("LastName") %>
</CellTemplate> </igtbl:TemplatedColumn>
will it work???
Hello Fakhrul,
I am trying to reproduce the problem, and it is working prefectly fine for me. Here is my approach (different Eval syntax): DataBase is Noethwind
<igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" DataSourceID="AccessDataSource1" Height="200px" Width="325px"> <bands> <igtbl:UltraGridBand> <Columns> <igtbl:TemplatedColumn> <CellTemplate> <img src="<%# Eval("FirstName") %> <%# Eval("LastName") %>" /> </CellTemplate> </igtbl:TemplatedColumn> <igtbl:UltraGridColumn BaseColumnName="EmployeeID" DataType="System.Int32" IsBound="True" Key="EmployeeID"> <Header Caption="EmployeeID"> </Header> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="LastName" IsBound="True" Key="LastName" > <Header Caption="LastName"> <RowLayoutColumnInfo OriginX="1" /> </Header> <Footer> <RowLayoutColumnInfo OriginX="1" /> </Footer> </igtbl:UltraGridColumn> <igtbl:UltraGridColumn BaseColumnName="FirstName" IsBound="True" Key="FirstName"> <Header Caption="FirstName"> <RowLayoutColumnInfo OriginX="2" /> </Header> <Footer> <RowLayoutColumnInfo OriginX="2" /> </Footer> </igtbl:UltraGridColumn> </Columns> <addnewrow view="NotSet" visible="NotSet"> </addnewrow> </igtbl:UltraGridBand> </bands> <displaylayout bordercollapsedefault="Separate" name="UltraWebGrid1" rowheightdefault="20px" version="4.00"> <framestyle borderstyle="Solid" borderwidth="1px" font-names="Verdana" font-size="8pt" height="200px" width="325px"> </framestyle> <pager> <PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px"> <borderdetails colorleft="White" colortop="White" /> </PagerStyle> </pager> <editcellstyledefault borderstyle="None" borderwidth="0px"> </editcellstyledefault> <headerstyledefault backcolor="LightGray" borderstyle="Solid"> <borderdetails colorleft="White" colortop="White" /> </headerstyledefault> <rowstyledefault backcolor="White" bordercolor="Gray" borderstyle="Solid" borderwidth="1px" font-names="Verdana" font-size="8pt"> <padding left="3px" /> <borderdetails colorleft="White" colortop="White" /> </rowstyledefault> <addnewbox> <boxstyle backcolor="LightGray" borderstyle="Solid" borderwidth="1px"> <borderdetails colorleft="White" colortop="White" /> </boxstyle> </addnewbox> <activationobject bordercolor="" borderwidth=""> </activationobject> </displaylayout> </igtbl:UltraWebGrid> </div> <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb" SelectCommand="SELECT [EmployeeID], [LastName], [FirstName] FROM [Employees]"> </asp:AccessDataSource>
Thanks for your reply. I tried it previously, but it doest work. Image path and text both will come from a datasource.
My Code is Bellow: which show some error
<CellTemplate>
<img src= <%# DataBinder.Eval(Container,"DataItem.S_U_Img")%> /> <%# DataBinder.Eval(Container,"DataItem.Description")%>
</CellTemplate>
regards,
Fakhrul
Hello,
UltraWebGrid support HTML .You can use the TemplatedColumn tag and set some link to image and text afther that image.
You can take a look sample code below.
<igtbl:TemplatedColumn>
<img src="http://forums.infragistics.com/Themes/leanandgreen/images/user_IsOnline.gif" /> some text
</igtbl:TemplatedColumn>
Hopes this helps.