Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
raghunath #1
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 want to change imageurl of image button.
thanks in advance,
Raghunath.
raghunath 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. ... -
Changing an image in a datagrid column in the ItemDataBound event
Hi, I have a datagrid that is bound to a datatable, I'm using TemplateColumns. The heading of two columns of the datagrid fire the... -
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... -
Changing the binding of a template column
I have a datagrid that is bound to different datasources. The datagrid contains a templated column (dropdown list). How do I change the... -
Template Column with button in header
Hi, usually Button clicks inside DataGrid are managed by handling ItemCommand event of the grid. Button is given a CommandName that is checked in... -
Michael Tkachev #2
Re: Changing ImageURL of Image Button which is added in template column of datagrid
You have to find this control (ImageButton) in the datagrid and then change
value of property in this control.
For this method don't use OnClick and OnCommand events for this buttton.
protected void myItemCommand(... e) // Event OnItemCommand for Datagrid
{
ImageButton ib = ((ImageButton)e.Item.Cells[0].Controls[1]);
ib.ImageUrl = "...";
}
that's all :)
Michael
----- Original Message -----
From: "raghunath" <raghunath.mn@majoris.com>
Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
Sent: Wednesday, April 28, 2004 11:03 AM
Subject: 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 want to change imageurl of image button.
>
>
>
> thanks in advance,
> Raghunath.
>
>
>
Michael Tkachev Guest
-
Kubuli John #3
Re: Changing ImageURL of Image Button which is added in template column of datagrid
How do you know to use Cells[0] and Controls[1]? Is this documented
somewhere? I have had lots of problems trying to get an indexed
reference to a specific control in a DataGrid, particularly in a
template column custom header with multiple controls in it.
Thanks,
John H.
"Michael Tkachev" <m_tkachev@hotmail.com> wrote in message news:<u4V$eidLEHA.3292@TK2MSFTNGP11.phx.gbl>...> You have to find this control (ImageButton) in the datagrid and then change
> value of property in this control.
> For this method don't use OnClick and OnCommand events for this buttton.
>
> protected void myItemCommand(... e) // Event OnItemCommand for Datagrid
> {
> ImageButton ib = ((ImageButton)e.Item.Cells[0].Controls[1]);
> ib.ImageUrl = "...";
> }
>
> that's all :)
>
> Michael
>
>
> ----- Original Message -----
> From: "raghunath" <raghunath.mn@majoris.com>
> Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridc ontrol
> Sent: Wednesday, April 28, 2004 11:03 AM
> Subject: 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 want to change imageurl of image button.
> >
> >
> >
> > thanks in advance,
> > Raghunath.
> >
> >
> >Kubuli John Guest



Reply With Quote

