| <%@ Control Language="C#" AutoEventWireup="true" CodeFile="ToolTipTest.ascx.cs" Inherits="ToolTipTest" %> |
| <%@ Register Assembly="Telerik.Web.UI, Version=2009.2.826.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <script type="text/javascript"> |
| function closeToolTip(strToolTipID) |
| { |
| var ToolTip = $find(strToolTipID); |
| if (ToolTip.isVisible()) |
| { |
| ToolTip.hide(); |
| } |
| } |
| function showToolTip(strToolTipID) |
| { |
| var ToolTip = $find(strToolTipID); |
| if (!ToolTip.isVisible()) |
| { |
| ToolTip.show(); |
| } |
| } |
| var tipToolTip = '<%= tipToolTip.ClientID %>'; |
| </script> |
| <div style="height: 200px; width: 400px; text-align: center; border: solid 1px #000;"> |
| This is body text. <a href="#" onclick="showToolTip(tipToolTip); return false;">Click here</a> to display the tooltip. |
| </div> |
| <telerik:RadToolTip id="tipToolTip" runat="server" Modal="True" |
| Position="Center" RelativeTo="BrowserWindow" AutoCloseDelay="0" HideDelay="0" |
| RenderInPageRoot="True" ShowDelay="0" ShowEvent="FromCode" |
| > |
| This is my tooltip. <a href="#" onclick="closeToolTip(tipToolTip); return false;">Click here</a> to close the tooltip. |
| </telerik:RadToolTip> |
<
script type="text/javascript">
function
KeyPress(sender, eventArgs)
{
var grid;
var table;
grid = sender;
table = grid.get_masterTableView();
//CTRL+Shift+I
if (eventArgs._keyCode == 73 && eventArgs._isCtrlPressed && eventArgs._isShiftPressed)
{
eventArgs.set_cancel(
true);
if (table.get_isItemInserted())
{
table.fireCommand(
"PerformInsert", "");
//alert("now insert another empty row");
table.fireCommand("PerformInsert", "");
}
}
</
script>

DisplayRecurrenceActionDialogOnMove="false"
Protected
Sub RadGrid1_InsertCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) Handles RadGrid1.InsertCommand
Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
Dim userControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)
Dim newRow As DataRow = Me.Ntable.NewRow
Dim newValues As Hashtable = New Hashtable
newValues(
"N") = CType(userControl.FindControl("NTextBox"), RadTextBox).Text
newValues(
"DNumber") = CType(userControl.FindControl("PNUMBER"), RadTextBox).Text.Take(13)
newValues(
"PNUMBER") = CType(userControl.FindControl("PNUMBER"), RadTextBox).Text
newValues(
"Title") = CType(userControl.FindControl("Title"), RadTextBox).Text
newValues(
"worder") = 0
newValues(
"SMRB") = CType(userControl.FindControl("SMRB"), RadTextBox).Text
newValues(
"SCAR") = CType(userControl.FindControl("SCAR"), RadTextBox).Text
newValues(
"Dposition") = CType(userControl.FindControl("Dposition"), RadTextBox).Text
newValues(
"LItems") = CType(userControl.FindControl("LItems"), RadTextBox).Text
newValues(
"QTY") = CType(userControl.FindControl("QTY"), RadTextBox).Text
newValues(
"AffectedA") = CType(userControl.FindControl("AffectedA"), RadTextBox).Text
newValues(
"Slier") = CType(userControl.FindControl("Slier"), RadTextBox).Text
newValues(
"Parer") = CType(userControl.FindControl("Parer"), RadTextBox).Text
newValues(
"QApp") = CType(userControl.FindControl("QApp"), RadTextBox).Text
newValues(
"Eer") = CType(userControl.FindControl("Eer"), RadTextBox).Text
newValues(
"Lon") = CType(userControl.FindControl("Lon"), RadTextBox).Text
newValues(
"Stus") = CType(userControl.FindControl("Stus"), RadTextBox).Text
newValues(
"Dancy") = CType(userControl.FindControl("Dancy"), RadTextBox).Text
newValues(
"cause") = 0
newValues(
"CAction") = CType(userControl.FindControl("CAction"), RadTextBox).Text
newValues(
"Subtion") = CType(userControl.FindControl("Subtion"), RadTextBox).Text
newValues(
"actiondate") = Date.Now
newValues(
"compsn") = CType(userControl.FindControl("compsn"), RadTextBox).Text
newValues(
"drcode") = 0
newValues(
"reworkordno") = CType(userControl.FindControl("reworkordno"), RadTextBox).Text
newValues(
"corractionreqyes") = CType(userControl.FindControl("corractionreqyes"), CheckBox).Checked
newValues(
"corractionreqno") = CType(userControl.FindControl("corractionreqno"), CheckBox).Checked
newValues(
"purchsig") = CType(userControl.FindControl("purchsig"), RadTextBox).Text
newValues(
"shipperno") = CType(userControl.FindControl("shipperno"), RadTextBox).Text
newValues(
"shop1") = CType(userControl.FindControl("shop1"), RadTextBox).Text
newValues(
"qainsp1") = CType(userControl.FindControl("qainsp1"), RadTextBox).Text
newValues(
"shop2") = CType(userControl.FindControl("shop2"), RadTextBox).Text
newValues(
"rqainsp2") = CType(userControl.FindControl("qainsp2"), RadTextBox).Text
newValues(
"reworkinst") = CType(userControl.FindControl("reworkinst"), RadTextBox).Text
newValues(
"min") = CType(userControl.FindControl("min"), CheckBox).Checked
newValues(
"maj") = CType(userControl.FindControl("maj"), CheckBox).Checked
newValues(
"N_ID") = (CType(Me.Ntable.Rows((Me.Ntable.Rows.Count - 1))("N_ID"), Integer) + 1001)
Try
For Each entry As DictionaryEntry In newValues
newRow(
CType(entry.Key, String)) = entry.Value
Next
Me.Ntable.Rows.Add(newRow)
Me.Ntable.AcceptChanges()
Catch ex As Exception
Dim lblError As Label = New Label()
lblError.Text =
"Unable to insert N. Reason: " + ex.Message
lblError.ForeColor = System.Drawing.Color.Red
RadGrid1.Controls.Add(lblError)
e.Canceled =
True
End Try
End Sub