Sadiya Lubna
Top achievements
Rank 1
Sadiya Lubna
asked on 12 Jun 2008, 08:37 AM
Hi,
I am using a user control as edit form for RadGrid. How do I hook on to the click event of a button on the user control (the button is not Insert/Update/Cancel) while still keeping the grid in edit mode?
When I click the button, the grid goes out of edit mode. I want to pop up a dialogue box on click of the button while still keeping the edit form displayed. How do I achieve this?
Thanks,
Sadiya.
I am using a user control as edit form for RadGrid. How do I hook on to the click event of a button on the user control (the button is not Insert/Update/Cancel) while still keeping the grid in edit mode?
When I click the button, the grid goes out of edit mode. I want to pop up a dialogue box on click of the button while still keeping the edit form displayed. How do I achieve this?
Thanks,
Sadiya.
4 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 12 Jun 2008, 11:04 AM
Hi,
Try the following code snippet.
ASCX:
Thanks
Shinu.
Try the following code snippet.
ASCX:
| <%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %> |
| <script type="text/javascript"> |
| function ClientClick() |
| { |
| alert('Do you wish to continue ?'); |
| } |
| </script> |
| <asp:Button ID="Button3" runat="server" Text="Button" OnClientClick="ClientClick" /> |
Thanks
Shinu.
0
Sadiya Lubna
Top achievements
Rank 1
answered on 12 Jun 2008, 10:45 PM
Hi,
Thanks. I want to show a dialogue box which is another user control. Irrespective of what I want to do, I want to know how to handle the click event of the button server side while still keeping the grid in edit mode.
Thanks,
Sadiya
Thanks. I want to show a dialogue box which is another user control. Irrespective of what I want to do, I want to know how to handle the click event of the button server side while still keeping the grid in edit mode.
Thanks,
Sadiya
0
Princy
Top achievements
Rank 2
answered on 13 Jun 2008, 05:02 AM
Hi Sadiya,
Try setting the CommandName for the button in the UserControl as shown below.
ASCX:
CS:
Thanks
Princy.
Try setting the CommandName for the button in the UserControl as shown below.
ASCX:
| <%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %> |
| <asp:Button ID="Button1" runat="server" Text="PerformAction" CommandName="PerformAction" /> |
CS:
| protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) |
| { |
| if (e.CommandName == "PerformAction") |
| { |
| } |
| } |
Thanks
Princy.
0
Sadiya Lubna
Top achievements
Rank 1
answered on 13 Jun 2008, 06:40 AM
Hi,
Thanks. The ItemCommand and buttons click event handlers were not getting fired due to some other AJAX issues in applications. Its all working fine now.
Thanks,
Sadiya.
Thanks. The ItemCommand and buttons click event handlers were not getting fired due to some other AJAX issues in applications. Its all working fine now.
Thanks,
Sadiya.