 |
|
|
Hi, After clicking, is that possible to redirect to another web page? (such as an HyperLinkField & to recover the Id of the selected row with the Request.QueryString)
best regards
bruno
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
this it supposed to fire the _ItemCommand event, but it doesnt.
any ideas?
ImageButton imbSave = (ImageButton)e.Item.FindControl("imbSave"); if (imbSave != null) { imbSave.Attributes.Add("onclick", "javascript:" + "document.getElementById('" + imbSave.ClientID + "')" + ".disabled=true;" + Page.ClientScript.GetPostBackEventReference(AccountCategoryGrid, "Select$" + AccountCategoryGrid.EditItemIndex));
}
|
| Sign In·View Thread·PermaLink | 2.00/5 (3 votes) |
|
|
|
 |
|
|
Hello, I would like to disable the onclick event from occuring on a row after the user clicks the edit button and is trying to edit a boundcolumn. I was able to disable the onclick event from occuring when the user clicked the edit button by adding an additional onclick attribute to the cell containing the edit button: event.cancelBubble=true;. However, I tried using the OnRowEditing command and adding this same onclick attribute to the row being edited but have been unsuccessful thus far. Any ideas?
Thanks, Mike.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
can't you make one flag for editing and put that check in rowdatabound event whether to add onclick code or not. Pls tell me if i understood nething wrong.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
when i click the edit button, rowdatabound event is not executed; rowediting is executed. once you are in edit mode, the onclick event will still occur due to the underlying onclick event for that cell. so i need to disable the the onclick event from occuring when rowediting is occuring.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Use the following code. Let me know if it cant be understood.
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.DataItemIndex == -1) return;
if (GridView1.EditIndex < 0) { e.Row.Attributes.Add("onMouseOver", "this.style.cursor='hand';"); e.Row.Attributes.Add("onclick", this.GetPostBackClientEvent(GridView1, "Select$" + e.Row.RowIndex.ToString())); } } protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) { GridView1.EditIndex = e.NewEditIndex; GridView1.DataSource = Supplier.FetchAll(); GridView1.DataBind(); } protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e) { GridView1.EditIndex = -1; GridView1.DataSource = Supplier.FetchAll(); GridView1.DataBind(); } protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { GridView1.EditIndex = -1; GridView1.DataSource = Supplier.FetchAll(); GridView1.DataBind(); }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
|
Hello,
See, basically, i didn't get exactly wat is ur problem. But check the following thing. - R u getting calendar1 object outside of the grid. Means is the script file included. - Now, check whether u geting exactly same textbox id as shown in the getElementById function.
Please let me know in detail with above checks
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi! i want on clicking any row of grid view, the form should post back & on server side a specific method get executed. just like on clicking on a button, form is post back & button's click method is called on server side. please help me
Thanks & Regards, SAMir Nigam, Software Developer, STPL, Lucknow, India.
|
| Sign In·View Thread·PermaLink | 1.60/5 (4 votes) |
|
|
|
 |
|
|
In this functionality, if you implement the functionality to select the record then selectedindexchanged of grid is fired and i think that is your solution.
Please let me know if it helps.
Thank you,
|
| Sign In·View Thread·PermaLink | 1.67/5 (2 votes) |
|
|
|
 |
|
|
This is a very simple and usefull method, but with firefox the hand do not appear.
Do you have any idea or solution ?
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
i believe there is different setting for firefox. That is cursor=pointer. Please search in google and you can find it.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Yes, cursor=pointer seems to display the hand for IE (IE7) as well as in FireFox, so it would seem to be a worthwhile improvement.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
If it is such then then great. But still we need to support IE5 and IE6 as their userbase is still considerable. Right. Thanks for info.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
|
I have been using this method to select a gridview row with a gridview that was added to my page at design time. I had to change to adding the gridview control dynamically at runtime and adding it to a placeholder control. The control is built and bound before page_load event fires, but is added to the page upon page_load. Now, when running this code, I get a "object reference not set to an instace of an object" error. I changed my code to this:
oCell.Attributes.Add("onClick", Page.GetPostBackClientEvent(sender, "Select$" & e.Row.RowIndex.ToString()))
during debug, i've checked that 'sender' is my gridview object. any ideas?
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
I recently sent the error msg and was interested to know if you had a chance to check to see the problem Dean
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Here, is the error I am getting: I tried to set enableEventValidation to false but I still get an error
Dean McIntire Thanks for your help!!
Server Error in '/VE2007sced2' Application. --------------------------------------------------------------------------------
Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.] System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +358 System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) +108 System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +29 System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +172
dpmvpa@comcast.net Dean McIntire
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
I had that same problem as well, and solved it with this: //replace gridviewmessages with the name of your gridview
protected override void Render(System.Web.UI.HtmlTextWriter writer) { if ((GridViewMessages.Rows.Count > 0)) { foreach (GridViewRow row in GridViewMessages.Rows) { if ((row.RowType == DataControlRowType.DataRow)) { row.Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(GridViewMessages, ("Select$" + row.RowIndex), true)); } } } base.Render(writer); }
------------------------------------ Hope that helps.
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
I had problems with the following statement
this.GetPostBackClientEvent(GridView1, "Select$" + e.Row.RowIndex.ToString()));
I got an error stating the this.GetPostBackClientEvent was obsolete and to use ClientScript.GetPostBackEventReference(GridView1, "Select$" + e.Row.RowIndex.ToString()));
When I do I get a validation error.
Can you help me.
Dean
dpmvpa@comcast.net
Thank you!!!
Dean dpmvpa@comcast,net
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
Could you post me exact validation error here. Sorry for late reply as i was sick and could not check the mail.
Thanks
|
| Sign In·View Thread·PermaLink | 2.00/5 (2 votes) |
|
|
|
 |
|
|
It was a great soloution and I'm thankfull of it.but I have a question.please help me if anyone konw the way, because I search alot but I could'nt find any soloution? in this way we must have a select buton that must have been visibe.how can I select gridview rows by clicking anywhere without select button or invisible select button?
|
| Sign In·View Thread·PermaLink | 2.60/5 (4 votes) |
|
|
|
 |