Overriding a radgrid row with a sliding popup when i click on delete option - asp.net

I have a problem with radGrid Control..
According to my clients requirement we are displaying data in radGrid. But what my problem is, when we click on delete button, the row which has to be delete should be replace with a sliding popup asking " Are u sure you want to delete this row" and with two buttons.
I have tried a lot, but I didn't get any solution for that..
Can any one please help me..

Well, do you have to have a "sliding" popup? In-built it supports a nice radwindow element for the prompt, which you may be able to programmably slide. Set these properties on the gridcommandcolumn: ConfirmTitle="Delete Medical Home" ConfirmDialogType="RadWindow". Otherwise, you can give the button an OnClientClick value that fires a function to show the prompt, and manually control the postback for the delete. For the latter this requires some research, I'm not exactly sure how that works with the RadGrid (the postback to submit the command).
HTH.
Brian

Related

How to navigate Asp.net GridView with arrow keys as like in winform datagridview

I have a '.aspx' Web Form with Gridview,
and if I press the UP/Down arrow key focus should be on Gridview and the Highlight should move to the next row.
Is there any solution for it ?
Yes that is possible without any third party control. What you need to do is to apply sound logic for this. Check below link for your solution where answer has been posted and marked it as an answer.
gridview to allow keyboard commands

LinkButton in update panel does not even fire client side event

I have a page that if IsPostBack is true, calls a javascript function which gets the size of the screen, passes the width and height to hidden fields and clicks a button to cause a PostBack. So I can retrieve the size of the user's screen and then load the page with default data with tables the right size etc.
Invariably, when the page (having posted back once) displays the data, a gridview is populated. Each row has a 'delete' Link Button in it. Each Link Button is set OnClientClick to call a javascript function to confirm you want to delete.
Above the grid is a row of text boxes / buttons / dropdownlists which allow you to search for, or filter the data showing. The Gridview is in an update panel. When the page first loads its data, and shows the list of projects, the delete Link Buttons all work okay. In every row, no problem. The Confirm box is displayed and, if Okay is selected, the asynchronous postback occurs.
If, after the initial data is displayed (which is already after one postback) you then use the search box and button, or use a dropdownlist to filter the data (the Search button and filter DropDownList are async triggers for the UpdatePanel) the data refreshes okay (always) but, then, sometimes, the 'delete' LinkButton in each row of the GridView does nothing. It doesn't even fire the ClientSide function. It's as if it is dead.
I had a similar problem a while ago with ImageButtons and the received wisdom seems to be 'change them to LinkButtons'. But I have dozens of grids with 'delete' LinkButtons that work okay, but this one has decided to stop working - sometimes.
I have to say, since moving to Framework 4.0, I'm thinking of giving up on UpdatePanels. Seem to have nothing but problems with sites that worked reliably for years in Framework 2.0
Any ideas please? Is this anything to do with the order in which controls are loaded on the second postbacks?
Edit: There is a twist to this. When this situation occurs, i.e. clicking on the Delete link does not even trigger the Client Side event - if you click on an area of the page outside the Gridview (i.e. outside the UpdatePanel) - and then click back on the Delete link - it works!
Regarding ImageButtons: There is a bug with IE10: ASP.NET fails to detect IE10 causing _doPostBack is undefined JavaScript error or maintain FF5 scrollbar position ( http://www.hanselman.com/blog/BugAndFixASPNETFailsToDetectIE10CausingDoPostBackIsUndefinedJavaScriptErrorOrMaintainFF5ScrollbarPosition.aspx ). Just upgrade to .NET 4.5.
Regarding LinkButtons: Do you have "ID" property? I remember I had a similar issue because my linkButton didn't have an ID.
Could you post some code? It would help.

TextChange event loose focus in asp.net

I am trying a very simple thing. I have 3 textboxes and 3 labels. On text change i am setting the content of label.
The issue is when i insert some value in 1st textbox(e.g 50) change the focus to another textbox the values in label is reflected perfectly.
But the focus which i setted on 2nd textbox is lost. And the focus is lost somewhere.
I need to click again on 2nd textbox to get focus.
The same issue is reproduced if TAB is clicked to change focus.
I have made a small demo project for the same and attached. You can avail that from the below link
https://skydrive.live.com/redir?resid=A716D678775EEF95!115&authkey=!ABp6kAon_ZNDLBU
Please someone help me...what am i doing wrong??
Thanks in advance...
This is a rather common issue in ASP.NET, as described here: http://www.codeproject.com/Articles/17571/Maintain-focus-between-postbacks-in-ASP-NET-2-0-al or here: How do I maintain focus position in UpdatePanel after page partial post back. Those links also contain some suggestion on how to solve this issue.
One of the possible solutions is to keep track of control with focus, put information about it into a hidden field and manually restore the focus after postback. This method is described in the first link mentioned.

Alert on moving to a different page of a grid when user changes contents of textboxes in a Grid

In a ASP.NET application I have a paging RadGrid which shows up textbox in each row. Outside the grid, there is an OK button to save the content of all the textbox. If user changes text in any one or more of the textbox and without clicking on the "OK" button, tries to move to a different page number (of the grid by clicking on the page number), he should be prompted for confirmation of save or cancel the changes.
I am guessing that one can write a Javascript function which would look for any form input control (textbox in my case) and detect changes and If there are changes, would prompt the user. However, I am not sure where I can call this function from? Any suggestion on this or a better way to achieve this would be appreciated.
I am using RadGrid but I guess this should be applicable to GridView as well.
I am not sure if this will help exactly but it might at least give you an idea:http://www.codeproject.com/KB/ajax/ajaxdirtypanelextender.aspx

Why do I need to bind GridView on every postback to make click events from columns to work

Ok, i have a gridview and on page load, i dynamically add a column to it that contains a link control. this link control has a onclick event associated with it so that when its clicked, i want to do some processing. Now I have noticed that if I just bind the grid the first time (i.e. if(!IsPostBack) and have enableviewstate for the grid to be true, clicking the link in that column, doesnt trigger the onclick event. But if I bind the grid on every postback, everything seems to be working..does anyone know the reasoning behind it?
It happens because you're dynamically adding the column, so on every postback the column has to be created. What you may want to do is to look at Creating a Custom Column.
May be creating the row Id solves your problem. Check out this link and the post marked as answer.
http://forums.asp.net/p/1471128/3408069.aspx#3408069
Regards
Vinay

Resources