or
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function GetSelectedItems() {
alert($find("<%= grdAllContacts.MasterTableView.ClientID %>").get_selectedItems().length);
}
</
script
>
</
telerik:RadCodeBlock
>
<
br
/>
<!-- content start -->
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
OnAjaxRequest
=
"RadAjaxManager1_AjaxRequest"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadAjaxManager1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"grdAllContacts"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"grdAllContacts"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"grdAllContacts"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
asp:Button
ID
=
"Button2"
CssClass
=
"button"
Text
=
"Get Selected Items Count"
OnClientClick
=
"GetSelectedItems(); return false;"
runat
=
"server"
/>
<
br
/>
<
telerik:RadGrid
ID
=
"grdAllContacts"
Width
=
"97%"
AllowPaging
=
"True"
PageSize
=
"20"
runat
=
"server"
ShowGroupPanel
=
"false"
OnNeedDataSource
=
"grdAllContacts_NeedDataSource"
GridLines
=
"None"
AutoGenerateColumns
=
"false"
AllowMultiRowSelection
=
"true"
>
<
PagerStyle
Mode
=
"NextPrev"
/>
<
GroupHeaderItemStyle
BorderColor
=
"Black"
Font-Bold
=
"true"
></
GroupHeaderItemStyle
>
<
MasterTableView
Width
=
"100%"
GroupLoadMode
=
"Server"
TableLayout
=
"Fixed"
AllowPaging
=
"True"
PageSize
=
"20"
AllowFilteringByColumn
=
"true"
>
<
GroupByExpressions
>
<
telerik:GridGroupByExpression
>
<
SelectFields
>
<
telerik:GridGroupByField
FieldAlias
=
"FamilyName"
FieldName
=
"FamilyName"
></
telerik:GridGroupByField
>
</
SelectFields
>
<
GroupByFields
>
<
telerik:GridGroupByField
FieldName
=
"FamilyName"
></
telerik:GridGroupByField
>
</
GroupByFields
>
</
telerik:GridGroupByExpression
>
</
GroupByExpressions
>
<
Columns
>
<
telerik:GridClientSelectColumn
UniqueName
=
"ClientSelectColumn"
/>
<
telerik:GridBoundColumn
SortExpression
=
"FamilyName"
HeaderText
=
"Family Name"
HeaderButtonType
=
"TextButton"
DataField
=
"FamilyName"
HeaderStyle-HorizontalAlign
=
"Center"
Visible
=
"false"
AutoPostBackOnFilter
=
"true"
>
<
HeaderStyle
Width
=
"15%"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"Context"
HeaderText
=
"Contact Type"
HeaderButtonType
=
"TextButton"
DataField
=
"Context"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"OrganisationName"
HeaderText
=
"Organisation Name"
HeaderButtonType
=
"TextButton"
DataField
=
"OrganisationName"
>
<
HeaderStyle
Width
=
"32%"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"RoleTitle"
HeaderText
=
"Role Title"
HeaderButtonType
=
"TextButton"
DataField
=
"RoleTitle"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"Phone"
HeaderText
=
"Phone"
HeaderButtonType
=
"TextButton"
DataField
=
"Phone"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"Mobile"
HeaderText
=
"Mobile"
HeaderButtonType
=
"TextButton"
DataField
=
"Mobile"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"Fax"
HeaderText
=
"Fax"
AutoPostBackOnFilter
=
"true"
HeaderButtonType
=
"TextButton"
DataField
=
"Fax"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"ID"
HeaderText
=
"ID"
HeaderButtonType
=
"TextButton"
DataField
=
"ID"
Visible
=
"false"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
AllowGroupExpandCollapse
=
"True"
ReorderColumnsOnClient
=
"false"
AllowDragToGroup
=
"false"
AllowColumnsReorder
=
"false"
EnableRowHoverStyle
=
"false"
>
<
Selecting
AllowRowSelect
=
"True"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
Dim
choices
As
Dictionary(Of
String
,
String
) =
New
Dictionary(Of
String
,
String
)()
choices.Add(
"Yes"
,
"Yes"
)
choices.Add(
"No"
,
"No"
)
Dim
field
As
RadFilterCustomEditors.RadFilterDropDownEditor =
New
RadFilterCustomEditors.RadFilterDropDownEditor()
field.DataSourceID = "????" 'What would go here?
field.DataValueField =
"Key"
field.DataTextField =
"Value"
QuestionFilter.FieldEditors.Add(field)
field.FieldName = question.Id
field.DisplayName = question.Description
RadFilterCustomEditors.RadFilterDropDownEditor
at run time without being tied to a grid?
<
telerik:radeditor
runat
=
"server"
ID
=
"radEditor"
AllowScripts
=
"false"
OnClientCommandExecuting
=
"OnClientCommandExecuting"
OnClientLoad
=
"OnClientLoad"
AutoResizeHeight
=
false
EnableResize
=
"false"
Skin
=
"Vista"
DialogHandlerUrl
=
"~/Telerik.Web.UI.DialogHandler.axd"
>
<
Tools
>
<
telerik:EditorToolGroup
>
<
telerik:EditorTool
Name
=
"Print"
/>
<
telerik:EditorTool
Name
=
"Cut"
/>
<
telerik:EditorTool
Name
=
"Copy"
/>
<
telerik:EditorTool
Name
=
"Paste"
/>
<
telerik:EditorTool
Name
=
"Undo"
/>
<
telerik:EditorTool
Name
=
"Redo"
/>
<
telerik:EditorSeparator
/>
<
telerik:EditorTool
Name
=
"Bold"
/>
<
telerik:EditorTool
Name
=
"Italic"
/>
<
telerik:EditorTool
Name
=
"Underline"
/>
<
telerik:EditorTool
Name
=
"Strikethrough"
/>
<
telerik:EditorTool
Name
=
"Superscript"
/>
<
telerik:EditorTool
Name
=
"Subscript"
/>
<
telerik:EditorSeparator
/>
<
telerik:EditorTool
Name
=
"ImageManager"
/>
<
telerik:EditorTool
Name
=
"InsertLink"
/>
</
telerik:EditorToolGroup
>
<
telerik:EditorToolGroup
>
<
telerik:EditorTool
Name
=
"JustifyLeft"
/>
<
telerik:EditorTool
Name
=
"JustifyCenter"
/>
<
telerik:EditorTool
Name
=
"JustifyRight"
/>
<
telerik:EditorTool
Name
=
"JustifyFull"
/>
<
telerik:EditorSeparator
/>
<
telerik:EditorTool
Name
=
"InsertUnorderedList"
/>
<
telerik:EditorTool
Name
=
"InsertOrderedList"
/>
<
telerik:EditorTool
Name
=
"Indent"
/>
<
telerik:EditorTool
Name
=
"Outdent"
/>
</
telerik:EditorToolGroup
>
</
Tools
>
</
telerik:radeditor
>
setTimeout(function() { GetRadWindow().autoSize(true) }, 500); |
<style type="text/css"> |
html, body, form |
{ |
padding: 0; |
margin: 0; |
height: 100%; |
background-color: #f2f2de; |
} |
fieldset |
{ |
height: 581px; |
} |
* + html fieldset |
{ |
height: 585px; |
width: 840px; |
} |
</style> |
<div style="width: 850px; height: 600px;"> |
I am having trouble accessing the value typed into the textbox on click of a submit button. the control is found however the text property is always empty. Please assist.
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
For Each item As RadListBoxItem In lbAssignedComponents.Items
Dim tbxPageComponentName As TextBox = item.FindControl("tbxPageComponentName")
Next
End Sub
<
telerik:RadAjaxPanel
runat
=
"server"
ID
=
"RadAjaxPanel1"
>
<
telerik:RadListBox
runat
=
"server"
ID
=
"lbAvailableComponents"
Height
=
"200px"
Width
=
"342px"
TransferMode
=
"Copy"
AllowTransfer
=
"true"
AllowTransferDuplicates
=
"true"
TransferToID
=
"lbAssignedComponents"
AutoPostBackOnTransfer
=
"true"
>
<
ItemTemplate
>
Component: <%# DataBinder.Eval(Container, "Text")%><
br
/>
</
ItemTemplate
>
</
telerik:RadListBox
>
<
telerik:RadListBox
runat
=
"server"
ID
=
"lbAssignedComponents"
Height
=
"200px"
Width
=
"342px"
AllowReorder
=
"true"
AllowDelete
=
"true"
AllowTransfer
=
"false"
>
<
ItemTemplate
>
Component: <%# DataBinder.Eval(Container, "Text")%><
br
/>
Unique Name: <
asp:TextBox
ID
=
"tbxPageComponentName"
runat
=
"server"
></
asp:TextBox
>
</
ItemTemplate
>
</
telerik:RadListBox
>
</
telerik:RadAjaxPanel
>
<
mastertableview
autogeneratecolumns
=
"False"
datakeynames
=
"AccountId"
datasourceid
=
"SqlDataSource1"
groupsdefaultexpanded
=
"False"
><
telerik:CommandItemSettings
ShowExportToExcelButton
=
"true"
/>
<
DetailTables
>
<
telerik:GridTableView
runat
=
"server"
DataKeyNames
=
"StatementId"
DataSourceID
=
"SqlDataSource2"
Font-Bold
=
"False"
Font-Italic
=
"False"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
>
<
DetailTables
>
<
telerik:GridTableView
runat
=
"server"
DataSourceID
=
"SqlDataSource3"
Font-Bold
=
"False"
Font-Italic
=
"False"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
GroupsDefaultExpanded
=
"False"
ShowFooter
=
"True"
ShowGroupFooter
=
"True"
AllowMultiColumnSorting
=
"True"
GridLines
=
"None"
>
<
ParentTableRelation
>
<
telerik:GridRelationFields
DetailKeyField
=
"StatementId"
MasterKeyField
=
"StatementId"
/>
</
ParentTableRelation
>
<
AlternatingItemStyle
BackColor
=
"White"
Font-Bold
=
"False"
Font-Italic
=
"False"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
Wrap
=
"True"
/>
<
HeaderStyle
Font-Bold
=
"False"
Font-Italic
=
"False"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
Wrap
=
"True"
/>
<
FooterStyle
BackColor
=
"Yellow"
Font-Bold
=
"False"
Font-Italic
=
"False"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
Wrap
=
"True"
/>
</
telerik:GridTableView
>
</
DetailTables
>
<
ParentTableRelation
>
<
telerik:GridRelationFields
DetailKeyField
=
"AccountId"
MasterKeyField
=
"AccountId"
/>
</
ParentTableRelation
>
<
CommandItemSettings
ExportToPdfText
=
"Export to Pdf"
/>
<
ExpandCollapseColumn
Visible
=
"True"
>
</
ExpandCollapseColumn
>
</
telerik:GridTableView
>
</
DetailTables
>
<
ParentTableRelation
>
<
telerik:GridRelationFields
DetailKeyField
=
"AccountId"
MasterKeyField
=
"AccountId"
/>
</
ParentTableRelation
>
<
ExpandCollapseColumn
Visible
=
"True"
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ACCOUNTID"
DataType
=
"System.Int32"
HeaderText
=
"ACCOUNTID"
SortExpression
=
"ACCOUNTID"
UniqueName
=
"ACCOUNTID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ACCOUNTREF"
HeaderText
=
"ACCOUNTREF"
SortExpression
=
"ACCOUNTREF"
UniqueName
=
"ACCOUNTREF"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CUSTOMERID"
DataType
=
"System.Int32"
HeaderText
=
"CUSTOMERID"
SortExpression
=
"CUSTOMERID"
UniqueName
=
"CUSTOMERID"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
mastertableview
>
protected
void
Button4_Click(
object
sender, System.EventArgs e)
{
//ConfigureExport();
RadGrid1.Rebind();
RadGrid1.MasterTableView.HierarchyDefaultExpanded =
true
;
//RadGrid1.MasterTableView.DetailTables[0].HierarchyDefaultExpanded = true;
RadGrid1.ExportSettings.IgnorePaging =
true
;
RadGrid1.ExportSettings.ExportOnlyData =
true
;
RadGrid1.ExportSettings.FileName =
"RadGridExportToCSV"
;
RadGrid1.ExportSettings.OpenInNewWindow =
true
;
RadGrid1.MasterTableView.ExportToCSV();
}