By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,682 Members | 1,999 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,682 IT Pros & Developers. It's quick & easy.

why <asp:ButtonColumn> for datagrid doesn't have CausesValidation property like <asp:Button>

P: n/a
Hi,

I'm having an aspx page with a server form.

i have a grid with a delete button and below the grid, another area with
inputs for inserting new values and an "add" button for submiting the lower
area of the form.

on the lower area i have validators for validating input.

my problem is that when the delete button is pressed on a grid item, the
validators fails for invalid input.
all i need to do now is to set the delete button of the grid to not cause
validation ( CausesValidation =False ) , but this property is not there and
i get compilation error if i try to set this property.

how can i get this page to work, and wouldn't you expect the
<asp:ButtonColumn> of the datagrid to have the CausesValidation property
like the regular <asp:Button> that it mimics (not to say inherits - the
sacred word) it's behavior.

TIA, z..

Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
why don't you use
<asp:TemplateColumn>
<ItemTemplate>
<asp:Button runat="server" id='btnSubmit" CauseValidation="False"
Text="Delete" CommandName="DeleteItem"/>
</ItemTemplate>
</asp:TemplateColumn>
or

<asp:TemplateColumn>
<ItemTemplate>
<asp:Button runat="server" id='btnSubmit" CauseValidation="False"
Text='<%# DataBinder.Eval(Container.DataItem, "YourColumn")%>'
CommandName="DeleteItem"/>
</ItemTemplate>
</asp:TemplateColumn>
Regrads
Martin

"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:#j**************@TK2MSFTNGP10.phx.gbl...
Hi,

I'm having an aspx page with a server form.

i have a grid with a delete button and below the grid, another area with
inputs for inserting new values and an "add" button for submiting the lower area of the form.

on the lower area i have validators for validating input.

my problem is that when the delete button is pressed on a grid item, the
validators fails for invalid input.
all i need to do now is to set the delete button of the grid to not cause
validation ( CausesValidation =False ) , but this property is not there and i get compilation error if i try to set this property.

how can i get this page to work, and wouldn't you expect the
<asp:ButtonColumn> of the datagrid to have the CausesValidation property
like the regular <asp:Button> that it mimics (not to say inherits - the
sacred word) it's behavior.

TIA, z..

Nov 18 '05 #2

P: n/a
well, i guess that the dot-net gods don't like your suggestion,
the first gets the page to the browser, but validation upon submit is done,
so i can't continue.
(i tried to put the button definition in the code behind so it might help -
but no)

the second get's a run time compilation error - the error is : The server
tag is not well formed, and when the <%%> tags are removed it does get to
the client, but of-course it's not enough.


"Martin Marinov" <me********@mecrossroad.bg> wrote in message
news:uD****************@TK2MSFTNGP10.phx.gbl...
why don't you use
<asp:TemplateColumn>
<ItemTemplate>
<asp:Button runat="server" id='btnSubmit" CauseValidation="False"
Text="Delete" CommandName="DeleteItem"/>
</ItemTemplate>
</asp:TemplateColumn>
or

<asp:TemplateColumn>
<ItemTemplate>
<asp:Button runat="server" id='btnSubmit" CauseValidation="False"
Text='<%# DataBinder.Eval(Container.DataItem, "YourColumn")%>'
CommandName="DeleteItem"/>
</ItemTemplate>
</asp:TemplateColumn>
Regrads
Martin

"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:#j**************@TK2MSFTNGP10.phx.gbl...
Hi,

I'm having an aspx page with a server form.

i have a grid with a delete button and below the grid, another area with
inputs for inserting new values and an "add" button for submiting the

lower
area of the form.

on the lower area i have validators for validating input.

my problem is that when the delete button is pressed on a grid item, the
validators fails for invalid input.
all i need to do now is to set the delete button of the grid to not cause validation ( CausesValidation =False ) , but this property is not there

and
i get compilation error if i try to set this property.

how can i get this page to work, and wouldn't you expect the
<asp:ButtonColumn> of the datagrid to have the CausesValidation property
like the regular <asp:Button> that it mimics (not to say inherits - the
sacred word) it's behavior.

TIA, z..


Nov 18 '05 #3

P: n/a
Actually i can not understand why the first example is not working :( it is
strange to me
about the second suggestion - excuse my but i've made a typo and put '
instead of " before the btnSubmit
and aslo you can try this

<asp:TemplateColumn>
<ItemTemplate>
<asp:Button runat="server" id='btnSubmit" CauseValidation="false"
CommandName="DeleteItem" > <%# DataBinder.Eval(Container.DataItem,
"YourColumn")%> </asp:Button>
</ItemTemplate>
</asp:TemplateColumn>
Regards
Martin
"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:us**************@TK2MSFTNGP09.phx.gbl...
well, i guess that the dot-net gods don't like your suggestion,
the first gets the page to the browser, but validation upon submit is done, so i can't continue.
(i tried to put the button definition in the code behind so it might help - but no)

the second get's a run time compilation error - the error is : The server
tag is not well formed, and when the <%%> tags are removed it does get to
the client, but of-course it's not enough.


"Martin Marinov" <me********@mecrossroad.bg> wrote in message
news:uD****************@TK2MSFTNGP10.phx.gbl...
why don't you use
<asp:TemplateColumn>
<ItemTemplate>
<asp:Button runat="server" id='btnSubmit" CauseValidation="False"
Text="Delete" CommandName="DeleteItem"/>
</ItemTemplate>
</asp:TemplateColumn>
or

<asp:TemplateColumn>
<ItemTemplate>
<asp:Button runat="server" id='btnSubmit" CauseValidation="False" Text='<%# DataBinder.Eval(Container.DataItem, "YourColumn")%>'
CommandName="DeleteItem"/>
</ItemTemplate>
</asp:TemplateColumn>
Regrads
Martin

"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:#j**************@TK2MSFTNGP10.phx.gbl...
Hi,

I'm having an aspx page with a server form.

i have a grid with a delete button and below the grid, another area with inputs for inserting new values and an "add" button for submiting the

lower
area of the form.

on the lower area i have validators for validating input.

my problem is that when the delete button is pressed on a grid item, the validators fails for invalid input.
all i need to do now is to set the delete button of the grid to not cause validation ( CausesValidation =False ) , but this property is not there and
i get compilation error if i try to set this property.

how can i get this page to work, and wouldn't you expect the
<asp:ButtonColumn> of the datagrid to have the CausesValidation

property like the regular <asp:Button> that it mimics (not to say inherits - the sacred word) it's behavior.

TIA, z..



Nov 18 '05 #4

P: n/a
man,

you can not put <%%> server tags inside a server control - please try to run
your example before posting.

"Martin Marinov" <me********@mecrossroad.bg> wrote in message
news:OK**************@tk2msftngp13.phx.gbl...
Actually i can not understand why the first example is not working :( it is strange to me
about the second suggestion - excuse my but i've made a typo and put '
instead of " before the btnSubmit
and aslo you can try this

<asp:TemplateColumn>
<ItemTemplate>
<asp:Button runat="server" id='btnSubmit" CauseValidation="false"
CommandName="DeleteItem" > <%# DataBinder.Eval(Container.DataItem,
"YourColumn")%> </asp:Button>
</ItemTemplate>
</asp:TemplateColumn>
Regards
Martin
"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:us**************@TK2MSFTNGP09.phx.gbl...
well, i guess that the dot-net gods don't like your suggestion,
the first gets the page to the browser, but validation upon submit is

done,
so i can't continue.
(i tried to put the button definition in the code behind so it might

help -
but no)

the second get's a run time compilation error - the error is : The server
tag is not well formed, and when the <%%> tags are removed it does get to the client, but of-course it's not enough.


"Martin Marinov" <me********@mecrossroad.bg> wrote in message
news:uD****************@TK2MSFTNGP10.phx.gbl...
why don't you use
<asp:TemplateColumn>
<ItemTemplate>
<asp:Button runat="server" id='btnSubmit"

CauseValidation="False" Text="Delete" CommandName="DeleteItem"/>
</ItemTemplate>
</asp:TemplateColumn>
or

<asp:TemplateColumn>
<ItemTemplate>
<asp:Button runat="server" id='btnSubmit" CauseValidation="False" Text='<%# DataBinder.Eval(Container.DataItem, "YourColumn")%>'
CommandName="DeleteItem"/>
</ItemTemplate>
</asp:TemplateColumn>
Regrads
Martin

"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:#j**************@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> I'm having an aspx page with a server form.
>
> i have a grid with a delete button and below the grid, another area with > inputs for inserting new values and an "add" button for submiting the lower
> area of the form.
>
> on the lower area i have validators for validating input.
>
> my problem is that when the delete button is pressed on a grid item, the > validators fails for invalid input.
> all i need to do now is to set the delete button of the grid to not

cause
> validation ( CausesValidation =False ) , but this property is not there and
> i get compilation error if i try to set this property.
>
> how can i get this page to work, and wouldn't you expect the
> <asp:ButtonColumn> of the datagrid to have the CausesValidation property > like the regular <asp:Button> that it mimics (not to say inherits - the > sacred word) it's behavior.
>
> TIA, z..
>
>
>



Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.