How to validate grdiview item template field is editable mode or not before submit the data to db(gridview is like basket customer can add any number of items and they can edit quanty field from basket).
I have tried with iscontentEditable but its not working except IE.
the article in the following link demonstrates how to use Quantity Validation and Total Calculation in ASP.NET Gridview Shopping Cart with jQuery, please check it. hope this will give you some help on your issue.
If your gridview is in editable mode there will be some control in the gridview like textbox and so on. Before submitting to db you can check in the button's clientclick whether the control exists in gridview with code like-
if($("table[id*=gridviewid] input").length>0)
edit mode
else
not in edit mode
Thanks & Regards
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog
Marked as answer by anj1212 on Feb 04, 2013 12:00 PM
Suppose you have a textbox while in edit mode. Then if you are in edit mode
$("table[id*=gridviewid] input").length will find the count of the textbox. In edit mode jquery will fine more than one input box(text box) inside the
gridview.
Thanks & Regards
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog
Marked as answer by anj1212 on Feb 04, 2013 12:00 PM
anj1212
Member
333 Points
74 Posts
check Gridview item template is editable mode or not before submit
Feb 01, 2013 02:20 PM|LINK
Hi Every one,
How to validate grdiview item template field is editable mode or not before submit the data to db(gridview is like basket customer can add any number of items and they can edit quanty field from basket).
I have tried with iscontentEditable but its not working except IE.
Please help.
Regards,
Anj
Yanping Wang...
Star
14859 Points
1525 Posts
Microsoft
Re: check Gridview item template is editable mode or not before submit
Feb 04, 2013 04:56 AM|LINK
Hi anj1212,
the article in the following link demonstrates how to use Quantity Validation and Total Calculation in ASP.NET Gridview Shopping Cart with jQuery, please check it. hope this will give you some help on your issue.
http://techbrij.com/gridview-shopping-cart-jquery-total
thanks.
Feedback to us
Develop and promote your apps in Windows Store
asteranup
All-Star
30184 Points
4906 Posts
Re: check Gridview item template is editable mode or not before submit
Feb 04, 2013 05:00 AM|LINK
Hi,
If your gridview is in editable mode there will be some control in the gridview like textbox and so on. Before submitting to db you can check in the button's clientclick whether the control exists in gridview with code like-
if($("table[id*=gridviewid] input").length>0) edit mode else not in edit modeAnup Das Gupta
Mark as Answer if you feel so. Visit My Blog
anj1212
Member
333 Points
74 Posts
Re: check Gridview item template is editable mode or not before submit
Feb 04, 2013 09:16 AM|LINK
Thanks for your reply asteranup, But my issue still has not solved becuase with your code its only checking the gridrows length. Its not
checking column itemtemplate textbox mode(editable or not). If you have clear explanation please provide me.
Regards,
Anj.
asteranup
All-Star
30184 Points
4906 Posts
Re: check Gridview item template is editable mode or not before submit
Feb 04, 2013 11:25 AM|LINK
Hi,
Suppose you have a textbox while in edit mode. Then if you are in edit mode $("table[id*=gridviewid] input").length will find the count of the textbox. In edit mode jquery will fine more than one input box(text box) inside the gridview.
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog
anj1212
Member
333 Points
74 Posts
Re: check Gridview item template is editable mode or not before submit
Feb 04, 2013 12:00 PM|LINK
Thank you very much asteranup. You are great boss!
I did just small amendment
it solved my issue-