Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Steven Spits #1
Re: running client side script after an <asp:ButtonColumn> click event
"z. f." wrote
Get a reference to the delete button in the ItemCreated event of your> i have a datagrid with a delete button for each row in the grid.
> when the delete button is clicked i need to ask the user in a "confirm"
> message box if he's sure he wants to delete.
datagrid, then use:
btnDelete.Attributes.Add("onclick", "return confirm('Delete record?');");
Steven
- - -
Steven Spits Guest
-
client side event for grid
This is probably a simple one, but I cannot seem to find an example. I have a datagrid with each row containing Checkbox | Textbox |... -
client side checkbox event
This is probably a simple one, but I cannot seem to find an example. I have a datagrid with each row containing Checkbox | Textbox |... -
Client Side Script interferes with Server Side Script?
I added the form validation script (Java Script) to the head section of my insert records form page which works great when tested but when I submit... -
Server-side event for row click?
Hi, is it possible to get a server-side event when the user clicks on a datagrid row? The user shouldn't be forced to click on a certain column... -
Sending Client Side Event ?
"Genival" <geniobr@hotmail.com> wrote in message news:e1x0bIOdDHA.2804@TK2MSFTNGP11.phx.gbl... You can't quite do this. The only thing your... -
Steven Spits #2
Re: running client side script after an <asp:ButtonColumn> click event
"z. f." wrote:
an> how would you get a reference to the buttoncolumn since it does not haveDim btnDelete As Button = CType(e.Item.Cells(0).Controls(0), Button)> ID attribute
>
> <asp:ButtonColumn Text="del" ButtonType="PushButton"
> CommandName="Delete"></asp:ButtonColumn>
>
> and also the findControl method would not cast to the boundColumn type of
> the button - the following line of code will not compile:
> Dim btn As System.Web.UI.WebControls.ButtonColumn =
> CType(e.Item.FindControl("btnDelIDIDID"), ButtonColumn)
Modify the indexes!
Steven
- - -
Steven Spits Guest
-
z. f. #3
running client side script after an <asp:ButtonColumn> click event
Hi,
i have a datagrid with a delete button for each row in the grid.
when the delete button is clicked i need to ask the user in a "confirm"
message box if he's sure he wants to delete.
the problem is that the
<asp:ButtonColumn ButtonType="PushButton" CommandName="Delete" .... don't
have a property to allow onclick to run client side script . how can this
be,
an i missing here something, cause there must be a way to do this without
implementing the button on my own!
TIA, z.
z. f. Guest
-
Steven Spits #4
Re: running client side script after an <asp:ButtonColumn> click event
"z. f." wrote:
Use a foreach to loop all cells and all controls in each cell to search for> but somewhere i get the feeling that getting
> to the button using it's index (that might change
> tomorrow) and having to take care of this index in
> order that when it changed the code will not fail is
> not the state of the art programming practice,
your button. You could use the CommandName or CommandArgument as a
search-criteria.
Steven
- - -
Steven Spits Guest
-
Steven Spits #5
Re: running client side script after an <asp:ButtonColumn> click event
"Steven Spits" wrote:
*or* you could also use a TemplateColumn and put a normal button in it,> Use a foreach to loop all cells and all controls in each cell to search
> for your button. You could use the CommandName or
> CommandArgument as a search-criteria.
which can be given an ID. That way, you could use FindControl().
Steven
- - -
Steven Spits Guest
-
z. f. #6
Re: running client side script after an <asp:ButtonColumn> click event
how would you get a reference to the buttoncolumn since it does not have an
ID attribute
<asp:ButtonColumn Text="del" ButtonType="PushButton"
CommandName="Delete"></asp:ButtonColumn>
and also the findControl method would not cast to the boundColumn type of
the button - the following line of code will not compile:
Dim btn As System.Web.UI.WebControls.ButtonColumn =
CType(e.Item.FindControl("btnDelIDIDID"), ButtonColumn)
TIA,
"Steven Spits" <steven.spits@servico.be.net> wrote in message
news:um9C4iFWEHA.3740@TK2MSFTNGP12.phx.gbl...> "z. f." wrote
>>> > i have a datagrid with a delete button for each row in the grid.
> > when the delete button is clicked i need to ask the user in a "confirm"
> > message box if he's sure he wants to delete.
> Get a reference to the delete button in the ItemCreated event of your
> datagrid, then use:
>
> btnDelete.Attributes.Add("onclick", "return confirm('Delete record?');");
>
> Steven
>
> - - -
>
>
>
z. f. Guest
-
z. f. #7
Re: running client side script after an <asp:ButtonColumn> click event
the way i did got a reference to the button is:
Dim btn As System.Web.UI.WebControls.Button = e.Item.Cells(4).Controls(0)
btn.Attributes.Add("onclick", "return confirm('Delete record?');")
btn.CausesValidation = False (this doesn't work - how can i do this is another question.)
but somewhere i get the feeling that getting to the button using it's index (that might change tomorrow) and having to take care of this index in order that when it changed the code will not fail is not the state of the art programming practice, i wish someone in this newsgroup will state the microsoft engineers opinion regarding us having to program this way!
"z. f." <zigi@info-scopeREMSPAM.co.il> wrote in message news:%23Id0TpFWEHA.3368@TK2MSFTNGP10.phx.gbl...> how would you get a reference to the buttoncolumn since it does not have an
> ID attribute
>
> <asp:ButtonColumn Text="del" ButtonType="PushButton"
> CommandName="Delete"></asp:ButtonColumn>
>
> and also the findControl method would not cast to the boundColumn type of
> the button - the following line of code will not compile:
> Dim btn As System.Web.UI.WebControls.ButtonColumn =
> CType(e.Item.FindControl("btnDelIDIDID"), ButtonColumn)
>
> TIA,
>
>
>
>
>
> "Steven Spits" <steven.spits@servico.be.net> wrote in message
> news:um9C4iFWEHA.3740@TK2MSFTNGP12.phx.gbl...>> > "z. f." wrote
> >> >> > > i have a datagrid with a delete button for each row in the grid.
> > > when the delete button is clicked i need to ask the user in a "confirm"
> > > message box if he's sure he wants to delete.
> > Get a reference to the delete button in the ItemCreated event of your
> > datagrid, then use:
> >
> > btnDelete.Attributes.Add("onclick", "return confirm('Delete record?');");
> >
> > Steven
> >
> > - - -
> >
> >
> >
>z. f. Guest



Reply With Quote

