<asp:Wizard ID="ConnectorWizard" runat="server" ActiveStepIndex="0" |
<WizardSteps> |
<asp:WizardStep Title="Configuration"> |
</asp:WizardStep> |
<asp:WizardStep Title="Devices Configuration"> |
<telerik:RadGrid ID="CTIMonitorGrid" runat="server" AutoGenerateColumns="true"> |
</telerik:RadGrid> |
</WizardSteps> |
</asp:Wizard> |
DataTable dtCTIMonitors = webSess.MasterSystem.CTISystem.SelectCTIMonitorsView(3); |
CTIMonitorGrid.DataSource = dtCTIMonitors; |
Folks, environment: UI for ASP.Net Ajax Q1 2016 With VS 2013. and using below Telerik link as a prototype in my project.
I have a sql table in SQL Server that has 2 columns, 1) Link 2) URL (i.e. https://www.google.com/ or https://www.yahoo.com/) In my edit form,
hyperlink button is pulling data (i.e. URL in Item Databound event. Works fine.
<
table
>
<
tr
>
<
td
style
=
"font-size: 11px"
>Community District: </
td
>
<
td
>
<
asp:TextBox
ID
=
"CDTextBox"
Font-Size
=
"11px"
Text='<%# Bind( "CD") %>'
runat="server" TabIndex="8">
</
asp:TextBox
>
<
asp:HyperLink
ID
=
"HyperLinkCD"
Style
=
"text-decoration: underline; border-color: InfoBackground; margin: inherit; font-size: 12px; color: #228B22; font-family: Calibri; font-weight: 700"
Text
=
"Link"
Target
=
"_blank"
runat
=
"server"
TabIndex
=
"9"
></
asp:HyperLink
>
</
td
>
</
tr
>
</
table
>
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridEditableItem && e.Item.IsInEditMode && e.Item.OwnerTableView.Name == "Master")
{
GridEditableItem editem = (GridEditableItem)e.Item;
TextBox txtcd = (TextBox)editem.FindControl("CDTextBox");
string Stcd = txtcd.Text.ToString().TrimEnd();
SqlCommand cmdcontrol = new SqlCommand("SELECT Link from Cd_Link" +
"WHERE [CD] = '" + Stcd + "'", SqlConnection);
SqlConnection.Open();
SqlDataReader objDR = cmdcontrol.ExecuteReader();
if (objDR.Read())
{
string stnycUrlLink = objDR["Link"].ToString().TrimEnd(); Pulling URL from SQL Column ex: https://www.google.com/ or https://www.yahoo.com/
stnycUrlLink = "" + stnycUrlLink + "";
HyperLink hyperLinkCD = (HyperLink)editem.FindControl("HyperLinkCD");
hyperLinkCD.NavigateUrl = stnycUrlLink;
hyperLinkCD.Attributes["href"] = "#";
hyperLinkCD.Attributes["onclick"] = String.Format("return Show_CDMap('{0}');", stnycUrlLink);
Session["MapSource"] = "Program";
Session["Sturl"] = stnycUrlLink;
}
}
}
function Show_CDMap(seltxt)
{
var seltxtbx = seltxt.value;
alert(seltxt); ex: https://www.google.com/ or https://www.yahoo.com/
var oWind = window.radopen("ShowCDMaps.aspx", "UserListDialog");
oWind.setSize(document.body.scrollWidth - 170, document.body.scrollHeight + 180);
oWind.set_modal(true);
oWind.Center();
oWind.Maximize();
return false;
}
I would like to pass that URL to edit form and open that URL. Another word if hyperlink button is grabing https://www.yahoo.com/ from SQL Table, then open https://www.yahoo.com/
inside edit dialog form.
My codes are below. Any help will be appreciated.
gc_0620
Hi telerik
I have to dinamicy add new row to radgrid without postback and i want to access values of rows (radgrid) in code behind .
How can i immpement it ?
please help me
In my RadGrid, if I set EditMode="EditForms", the checkmark and x for update and cancel disappear and get replaced with text. However, if I set EditMode="InPlace", I get the icons. How can I get the icons with EditForms?
01.
<
telerik:RadGrid
ID
=
"rgPackagesHistory"
AllowSorting
=
"true"
GridLines
=
"Horizontal"
AllowAutomaticDeletes
=
"false"
02.
AllowAutomaticInserts
=
"false"
AllowAutomaticUpdates
=
"false"
runat
=
"server"
PageSize
=
"10"
03.
AllowPaging
=
"true"
AllowFilteringByColumn
=
"false"
ShowStatusBar
=
"true"
AllowMultiRowSelection
=
"true"
04.
OnItemCommand
=
"rgPackagesHistory_ItemCommand"
OnItemDataBound
=
"rgPackagesHistory_ItemDataBound"
05.
OnUpdateCommand
=
"rgPackagesHistory_UpdateCommand"
OnDeleteCommand
=
"rgPackagesHistory_DeleteCommand"
>
06.
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
AlwaysVisible
=
"true"
/>
07.
<
MasterTableView
Width
=
"100%"
CommandItemDisplay
=
"None"
DataKeyNames
=
"Package_ID"
HorizontalAlign
=
"Center"
08.
AutoGenerateColumns
=
"False"
EditMode
=
"EditForms"
>
09.
<
CommandItemSettings
/>
10.
<
NestedViewTemplate
>
11.
<
b
>Any other benefits:</
b
> <%# Eval("Package_AnyOtherBenefit") %><
br
/>
12.
<
b
>Comments:</
b
> <%# Eval("Package_Comments") %><
br
/>
13.
</
NestedViewTemplate
>
14.
<
Columns
>
15.
<
telerik:GridNumericColumn
DataField
=
"Package_MinAge"
UniqueName
=
"Package_MinAge"
ReadOnly
=
"false"
MaxValue
=
"255"
/>
16.
<
telerik:GridNumericColumn
DataField
=
"Package_MaxAge"
UniqueName
=
"Package_MaxAge"
ReadOnly
=
"false"
MaxValue
=
"255"
/>
17.
<
telerik:GridBoundColumn
DataField
=
"Package_DownPayment"
UniqueName
=
"Package_DownPayment"
ReadOnly
=
"false"
MaxLength
=
"50"
/>
18.
<
telerik:GridBoundColumn
DataField
=
"Package_AdminFees"
UniqueName
=
"Package_AdminFees"
ReadOnly
=
"false"
MaxLength
=
"50"
/>
19.
<
telerik:GridBoundColumn
DataField
=
"Package_InterestRate"
UniqueName
=
"Package_InterestRate"
ReadOnly
=
"false"
MaxLength
=
"50"
/>
20.
<
telerik:GridBoundColumn
DataField
=
"Package_InsuranceRate"
UniqueName
=
"Package_InsuranceRate"
ReadOnly
=
"false"
MaxLength
=
"50"
/>
21.
<
telerik:GridNumericColumn
DataField
=
"Package_MaxPeriod"
UniqueName
=
"Package_MaxPeriod"
ReadOnly
=
"false"
MaxValue
=
"255"
/>
22.
<
telerik:GridBoundColumn
DataField
=
"Package_BaloonPayment"
UniqueName
=
"Package_BaloonPayment"
ReadOnly
=
"false"
MaxLength
=
"50"
/>
23.
<
telerik:GridBoundColumn
DataField
=
"Package_AnyOtherBenefit"
UniqueName
=
"Package_AnyOtherBenefit"
ReadOnly
=
"false"
MaxLength
=
"50"
Visible
=
"false"
/>
24.
<
telerik:GridBoundColumn
DataField
=
"Package_Comments"
UniqueName
=
"Package_Comments"
ReadOnly
=
"false"
MaxLength
=
"200"
Visible
=
"false"
/>
25.
<
telerik:GridDateTimeColumn
DataField
=
"Package_Date"
UniqueName
=
"Package_Date"
DataFormatString
=
"{0: dd/MM/yyyy}"
ReadOnly
=
"true"
/>
26.
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
UniqueName
=
"EditCommandColumn"
27.
ItemStyle-HorizontalAlign
=
"Center"
HeaderStyle-Width
=
"50"
ItemStyle-CssClass
=
"MyImageButton"
/>
28.
<
telerik:GridButtonColumn
ButtonType
=
"ImageButton"
CommandName
=
"Delete"
Text
=
"Delete"
29.
EditFormColumnIndex
=
"1"
UniqueName
=
"column1abc"
ConfirmDialogType
=
"RadWindow"
30.
ShowInEditForm
=
"false"
ItemStyle-HorizontalAlign
=
"Center"
HeaderStyle-Width
=
"50"
ItemStyle-CssClass
=
"MyImageButton"
/>
31.
</
Columns
>
32.
<
CommandItemSettings
ShowRefreshButton
=
"false"
ShowAddNewRecordButton
=
"True"
/>
33.
<
PagerStyle
AlwaysVisible
=
"True"
/>
34.
</
MasterTableView
>
35.
<
HeaderStyle
HorizontalAlign
=
"Center"
VerticalAlign
=
"Middle"
/>
36.
<
ClientSettings
EnableRowHoverStyle
=
"true"
>
37.
<
Selecting
AllowRowSelect
=
"true"
EnableDragToSelectRows
=
"true"
/>
38.
<
KeyboardNavigationSettings
EnableKeyboardShortcuts
=
"true"
/>
39.
</
ClientSettings
>
40.
</
telerik:RadGrid
>
I have an EntityDataSource
<
asp:EntityDataSource
ID
=
"InventoryEntityDataSource"
runat
=
"server"
ConnectionString
=
"name=myEntities"
DefaultContainerName
=
"myEntities"
EnableFlattening
=
"False"
EntitySetName
=
"Inventory"
Select="it.[InventoryID],
it.[InventorySalesRepUserID],
it.[SalesRep_Table].[DisplayName] AS SalesRep_DisplayName,
"
EntityTypeFilter
=
""
OrderBy
=
"it.[InventoryID]"
>
</
asp:EntityDataSource
>
And RadGrid
<
telerik:RadGrid
ID
=
"InventoryRadGrid"
runat
=
"server"
AutoGenerateColumns
=
"False"
DataSourceID
=
"InventoryEntityDataSource"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
ShowGroupPanel
=
"True"
Width
=
"100%"
ShowFooter
=
"True"
GroupPanelPosition
=
"Top"
ResolveRenderMode
=
"Classic"
CellSpacing
=
"-1"
GridLines
=
"Both"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
/>
<
GroupingSettings
CaseSensitive
=
"false"
/>
<
MasterTableView
DataSourceID
=
"InventoryEntityDataSource"
DataKeyNames
=
"InventoryID"
EnableViewState
=
"true"
TableLayout
=
"Fixed"
>
<
Columns
>
<
telerik:GridTemplateColumn
DataField
=
"InventoryID"
SortExpression
=
"InventoryID"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter InventoryID column"
HeaderText
=
"Item #"
UniqueName
=
"InventoryID"
Visible
=
"False"
>
<
ItemTemplate
>
<
asp:HyperLink
ID
=
"HyperLink1jkl"
runat
=
"server"
Text='<%# Eval("InventoryID") %>'
</
asp:HyperLink
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"InventorySalesRepUserID"
FilterControlAltText
=
"Filter InventorySalesRepUserID column"
HeaderText
=
"Sales Rep ID"
UniqueName
=
"InventorySalesRepUserID"
Visible
=
"False"
SortExpression
=
"InventorySalesRepUserID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"SalesRep_DisplayName"
FilterControlAltText
=
"Filter InventorySalesRepUserName column"
HeaderText
=
"Sales Rep Name"
UniqueName
=
"InventorySalesRepUserName"
Visible
=
"False"
SortExpression
=
"SalesRep_DisplayName"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
It loads fine and filter on radgrid also works fine when filtering InventoryID and SalesRepID but when i filter for SalesRep_DisplayName give me an error.
'SalesRep_DisplayName' is not a member of type 'myDB_Model.tblInventory' in the currently loaded schemas. Near simple identifier.
Partial Class Testing_Upload
Inherits System.Web.UI.Page
Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
If e.Argument = "Goback" Then
Call SaveData()
End If
End Sub
Protected Sub btnSaveServiceCall_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSaveServiceCall.Click
MsgBox(RadAsyncUpload1.UploadedFiles.Count.ToString + " COUNT IS CORRECT")
If validateServiceCallRequirements() = True Then
Call SaveData()
End If
End Sub
Protected Function validateServiceCallRequirements() As Boolean
RadWindowManager.RadConfirm("My message", "GoTo", 250, 110, Nothing, "Confirm", "")
Return False
Exit Function
End Function
Protected Sub SaveData()
MsgBox(RadAsyncUpload1.UploadedFiles.Count.ToString + " COUNT IS INCORRECT")
End Sub
Protected Sub Testing_Upload_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
End If
End Sub
End Class
<%@ Page Language="VB" MasterPageFile="~/InductoServMasterPage.master" AutoEventWireup="false" CodeFile="Upload.aspx.vb" Inherits="Testing_Upload" title="Untitled Page" %>
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"ContentPlaceHolder1"
Runat
=
"Server"
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
Skin
=
"Windows7"
/>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
DefaultLoadingPanelID
=
"RadAjaxLoadingPanel1"
>
<
AjaxSettings
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
asp:UpdatePanel
ID
=
"UpdatePanelServiceCallRequirements"
runat
=
"server"
EnableViewState
=
"true"
UpdateMode
=
"Conditional"
>
<
ContentTemplate
>
<
telerik:RadAsyncUpload
ID
=
"RadAsyncUpload1"
runat
=
"server"
skin
=
"Windows7"
Font-Names
=
"Arial"
Font-Size
=
"14px"
PostbackTriggers
=
"btnSaveServiceCall"
MultipleFileSelection
=
"Automatic"
Width
=
"300px"
AllowedFileExtensions
=
".jpg,.png,.jpeg,.gif,.bmp,.doc,.docx,.xls,.xlsx,.txt,.pdf,.ppt,.pptx,.pps,.ppsx,.pot,.potx"
Localization-Select
=
"Browse"
>
</
telerik:RadAsyncUpload
>
<
asp:Button
id
=
"btnSaveServiceCall"
runat
=
"server"
Text
=
"Save"
UseSubmitBehavior
=
"False"
CssClass
=
"btnCustom"
></
asp:Button
>
</
ContentTemplate
>
</
asp:UpdatePanel
>
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
></
telerik:RadCodeBlock
>
<
script
type
=
"text/javascript"
language
=
"javascript"
>
function GoTo(arg)
{
if (arg == true )
{
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Goback");
}
}
</
script
>
<
telerik:RadWindowManager
ID
=
"RadWindowManager"
runat
=
"server"
>
<
AlertTemplate
>
<
div
>
<
div
class
=
"rwDialogPopup radalert"
style
=
"padding-left: 0; font-family :Arial ; font-size :14px ; background: url('../Images/icon/Information.png') no-repeat left center !important;"
>
<
div
class
=
"rwDialogText"
style
=
"margin-left: 50px; "
>
{1}
</
div
>
<
div
style
=
"margin-left: 50px; "
>
<
a
onclick
=
"$find('{0}').close();"
class
=
"rwPopupButton"
href
=
"javascript:void(0);"
>
<
span
class
=
"rwOuterSpan"
>
<
span
class
=
"rwInnerSpan"
>##LOC[OK]##
</
span
>
</
span
>
</
a
>
</
div
>
</
div
>
</
div
>
</
AlertTemplate
>
<
ConfirmTemplate
>
<
div
class
=
"rwDialogPopup radconfirm"
style
=
" font-family :Arial ; font-size :14px ; background: url('../Images/icon/Question.png') no-repeat left center !important; "
>
<
div
class
=
"rwDialogText"
>
{1}
</
div
>
<
div
>
<
a
onclick
=
"$find('{0}').close(true);"
class
=
"rwPopupButton"
href
=
"javascript:void(0);"
>
<
span
class
=
"rwOuterSpan"
>
<
span
class
=
"rwInnerSpan"
>Yes</
span
>
</
span
></
a
>
<
a
onclick
=
"$find('{0}').close(false);"
class
=
"rwPopupButton"
href
=
"javascript:void(0);"
>
<
span
class
=
"rwOuterSpan"
>
<
span
class
=
"rwInnerSpan"
>No</
span
></
span
>
</
a
>
</
div
>
</
div
>
</
ConfirmTemplate
>
</
telerik:RadWindowManager
>
</
asp:Content
>