Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
David A. Coursey #1
Refrence image in template column
I am trying to change the image in my column depending on the status of the
db field. All of the data is being populated correctly, I just haven't been
able to get the image path to work.
aspx page:
<asp:boundcolumn visible="False" datafield="success" />
<asp:templatecolumn headertext="Status" >
<itemtemplate>
<asp:image id="imgWebStatus" runat="server" imageurl="" />
</itemtemplate>
</asp:templatecolumn>
aspx.cs codebehind page:
if(e.Item.ItemType.Equals(System.Web.UI.WebControl s.ListItemType.Item) ||
e.Item.ItemType.Equals(System.Web.UI.WebControls.L istItemType.AlternatingItem))
{
switch(Convert.ToInt32(e.Item.Cells[0].Text))
{
case 0:
{
e.Item.Cells[1].WHAT_GOES_HERE = Request.ApplicationPath +
"/images/no.gif";
break;
}
Thanks for looking.
David A. Coursey
David A. Coursey Guest
-
Need to change image of imagebutton in datagrid template column
I'm going nuts.. I've got a template column with an imagebutton in it. I would like to change the image on the button when the button is clicked. ... -
Template column base on another column value
Hello .net expert, I would like to change the color a a column "Name" base on the value of another column "tel" . Is it possible ??? Thanks in... -
Template Column
If you handle DDL's SelectedIndexChanged event, you get the DDL instance itself from the first parameter of event handler method. Ok, in the control... -
Changing ImageURL of Image Button which is added in template column of datagrid
hello, I have a template column in my datagrid. To the header of template colum, i have added imagebutton. On click of the imagebutton , i... -
Bound Column or Template Column (w dAdapater?) in DataGrid
I am able to get the data using DataAdapter and the DataReader. I am more inclined to use DataAdapter because I want to update the data on the SQL... -
Michael Tkachev #2
Re: Refrence image in template column
Image i = (Image)e.Item.Cells[1].Controls[0];
i.ImageUrl = yourPath;
"David A. Coursey" <dcoursey@gmail.com> wrote in message
news:OaiJ7FlqEHA.376@TK2MSFTNGP14.phx.gbl...the> I am trying to change the image in my column depending on the status ofbeen> db field. All of the data is being populated correctly, I just haven'te.Item.ItemType.Equals(System.Web.UI.WebControls.L istItemType.AlternatingIte> able to get the image path to work.
>
> aspx page:
>
> <asp:boundcolumn visible="False" datafield="success" />
> <asp:templatecolumn headertext="Status" >
> <itemtemplate>
> <asp:image id="imgWebStatus" runat="server" imageurl="" />
> </itemtemplate>
> </asp:templatecolumn>
>
>
>
> aspx.cs codebehind page:
>
>
> if(e.Item.ItemType.Equals(System.Web.UI.WebControl s.ListItemType.Item) ||
>
m))> {
> switch(Convert.ToInt32(e.Item.Cells[0].Text))
> {
> case 0:
> {
> e.Item.Cells[1].WHAT_GOES_HERE = Request.ApplicationPath +
> "/images/no.gif";
> break;
> }
>
>
>
> Thanks for looking.
>
> David A. Coursey
>
>
Michael Tkachev Guest



Reply With Quote

