How can I get gridview and detailsview to show up when there are no records. I need this for my edit's
View Complete Post
I have a textbox and a gridview which is bound to a table
what I want to achieve is a solution where lets say there are two records - e.g. "1. Book and 2. Red", i want a user to type in those words and the gridview shows the results as followed;
I have set up the sql data source and everything and my like operator is this...
LIKE '%' + @record + '%'
how can I solve this problem?
OK, what is the problem here?
I do a gridview code that when displaying the information that come from the database is not showing any error at all, but is not displaying the right picture.
The problem, I think, is that the (Eval("....") is not reading the values that are coming from the DataKeysNames. Due to this the right pictures are not displayed. But in another column, just for testing purposes I was able to display the values from DataKeysNames with the Eval. So I do not know what is going on and to make worse browser is not giving me any error.
So, this is the line that is not processing, reading or executing well:
ImageUrl='<%# IIF( (Eval("TUDTIWasItemUpgraded")) = "Yes", string.Format("~/Images/ItemUpgradedTo.gif"), string.Format("~/Images/ItemNoUpgradedYet.gif") ) %>'
And this is the complete code for the GridView
<form id="form1" runat="server">
<asp:DropDownList ID="DropDownList9" runat="server" DataSourceID="SC" DataTextField="ItemNo"
DataValueField="ItemNo" Style=" left: 131px; position: absolute;
top: 41px; z-index: 104;" OnSelectedIndexChanged="DropDownList9_SelectedIndexChanged" TabIndex="12" AutoPostBack="True" OnDataBound="DropDownList9_DataBound">
<asp:GridView style="Z-INDEX: 101; LEFT: 14px; POSITION: absolute; TOP: 183px; width: 953px;"
id="Gridview1" runat="server" Height="127px" ForeColor="Teal" Font-Size="12pt"
Font-Names="Palatino Linotype" Font-Bold="True" Visible="False"
ShowFooter="True" SelectedIndex="5" OnRowCreated="Gridview1_RowCreated"
GridLines="None" CellSpacing="2" AutoGenerateColumns="False"><Columns>
how to show image in gridview from sql database