I am using the following combobox to select cities from a view with 30000 rows.
<telerik:RadComboBox ID="ddlCityO" TabIndex="1" runat="server" EmptyMessage="City, State" EnableItemCaching="True" DataSourceID="SqlDataSource1" MarkFirstMatch="True" EnableAutomaticLoadOnDemand="True" MinFilterLength="1" DataTextField="CityState" DataValueField="ID" DropDownAutoWidth="Enabled" Filter="Contains" Skin="MetroTouch" Placeholder="Destination" Width="300px"/>
Is there a better way to approach this?
I have tried to push the data into a datatable:
db.Open()
cmd = New SqlCommand("SELECT ID, CityState FROM v_City", db)
cmd.CommandType = CommandType.Text
Dim da As SqlDataAdapter = New SqlDataAdapter()
da.SelectCommand = cmd
Dim ds As New DataTable
da.Fill(ds)
db.Close()
ddlCityO.DataSourceID = "datatable"
ddlCityO.DataSource = ds
ddlCityO.DataTextField = "CityState"
ddlCityO.DataValueField = "ID"
ddlCityO.DataBind()
This returns an error of "There is no assigned datasource. Unable to complete the callback request"
Any ideas?
I have my Master & Child grid code setup as below.
The problem is I want to refresh my child grid when users clicks on row & at the same time allow users to do batch edits in the master grid (& later in Child Grid also).
In line23 below:
If I add, EnablePostBackOnRowClick="true" in order to rebind the child grid then the cursor lose the position in Master Grid.
If I remove the EnablePostBackOnRowClick then Child Grid do not show up.
01.
<
body
>
02.
<
form
id
=
"form1"
runat
=
"server"
>
03.
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"RadScriptManager1"
/>
04.
<
telerik:RadSkinManager
ID
=
"RadSkinManager1"
runat
=
"server"
ShowChooser
=
"true"
/>
05.
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
EnableAJAX
=
"false"
>
06.
<
AjaxSettings
>
07.
<
telerik:AjaxSetting
AjaxControlID
=
"RadGrid1"
>
08.
<
UpdatedControls
>
09.
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
10.
<
telerik:AjaxUpdatedControl
ControlID
=
"grdMySearches"
/>
11.
</
UpdatedControls
>
12.
</
telerik:AjaxSetting
>
13.
</
AjaxSettings
>
14.
</
telerik:RadAjaxManager
>
15.
<
telerik:RadAjaxLoadingPanel
runat
=
"server"
ID
=
"RadAjaxLoadingPanel1"
></
telerik:RadAjaxLoadingPanel
>
16.
<
telerik:RadFormDecorator
RenderMode
=
"Lightweight"
ID
=
"RadFormDecorator1"
runat
=
"server"
DecorationZoneID
=
"demo"
DecoratedControls
=
"All"
EnableRoundedCorners
=
"false"
/>
17.
<
div
id
=
"demo"
class
=
"demo-container no-bg"
>
18.
<
h3
>WorkPack Header:</
h3
>
19.
<
telerik:RadGrid
RenderMode
=
"Lightweight"
ID
=
"RadGrid1"
GridLines
=
"None"
runat
=
"server"
AllowAutomaticDeletes
=
"True"
20.
AllowAutomaticInserts
=
"True"
PageSize
=
"10"
OnItemDeleted
=
"RadGrid1_ItemDeleted"
21.
OnItemUpdated
=
"RadGrid1_ItemUpdated"
OnPreRender
=
"RadGrid1_PreRender"
AllowAutomaticUpdates
=
"True"
AllowPaging
=
"True"
22.
AutoGenerateColumns
=
"False"
OnBatchEditCommand
=
"RadGrid1_BatchEditCommand"
DataSourceID
=
"SqlDataSource1"
>
23.
<
ClientSettings
AllowKeyboardNavigation
=
"true"
EnablePostBackOnRowClick
=
"true"
>
24.
<
Selecting
AllowRowSelect
=
"true"
></
Selecting
>
25.
</
ClientSettings
>
26.
<
MasterTableView
DataKeyNames
=
"ID"
EditMode
=
"Batch"
CommandItemDisplay
=
"Top"
>
27.
<
BatchEditingSettings
EditType
=
"Cell"
/>
28.
<
Columns
>
29.
<
telerik:GridBoundColumn
DataField
=
"WP_Name"
HeaderStyle-Width
=
"210px"
HeaderText
=
"WP_Name"
SortExpression
=
"WP_Name"
UniqueName
=
"WP_Name"
>
30.
<
ColumnValidationSettings
EnableRequiredFieldValidation
=
"true"
>
31.
<
RequiredFieldValidator
ForeColor
=
"Red"
Text
=
"*This field is required"
Display
=
"Dynamic"
>
32.
</
RequiredFieldValidator
>
33.
</
ColumnValidationSettings
>
34.
</
telerik:GridBoundColumn
>
35.
<
telerik:GridBoundColumn
DataField
=
"Status"
HeaderStyle-Width
=
"210px"
HeaderText
=
"Name"
SortExpression
=
"Status"
UniqueName
=
"Status"
>
36.
<
ColumnValidationSettings
EnableRequiredFieldValidation
=
"true"
>
37.
<
RequiredFieldValidator
ForeColor
=
"Red"
Text
=
"*This field is required"
Display
=
"Dynamic"
>
38.
</
RequiredFieldValidator
>
39.
</
ColumnValidationSettings
>
40.
</
telerik:GridBoundColumn
>
41.
<
telerik:GridButtonColumn
ConfirmText
=
"Delete this ID?"
ConfirmDialogType
=
"RadWindow"
ConfirmTitle
=
"Delete"
HeaderText
=
"Delete"
HeaderStyle-Width
=
"50px"
42.
CommandName
=
"Delete"
Text
=
"Delete"
UniqueName
=
"DeleteColumn"
>
43.
</
telerik:GridButtonColumn
>
44.
</
Columns
>
45.
</
MasterTableView
>
46.
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
></
PagerStyle
>
47.
</
telerik:RadGrid
>
48.
<
br
/>
49.
<
h3
>WorkPack Details:</
h3
>
50.
<
telerik:RadGrid
ID
=
"grdMySearches"
DataSourceID
=
"dsMySearches"
runat
=
"server"
Skin
=
"Windows7"
AutoGenerateColumns
=
"False"
51.
OnItemCommand
=
"grdMySearches_ItemCommand"
OnItemDeleted
=
"grdMySearches_ItemDeleted"
OnItemDataBound
=
"grdMySearches_ItemDataBound"
AllowPaging
=
"True"
AllowSorting
=
"True"
GridLines
=
"None"
>
52.
<
MasterTableView
DataSourceID
=
"dsMySearches"
HierarchyDefaultExpanded
=
"true"
CommandItemDisplay
=
"None"
AllowAutomaticInserts
=
"false"
AllowAutomaticUpdates
=
"True"
AllowAutomaticDeletes
=
"True"
PageSize
=
"25"
Width
=
"100%"
>
53.
<
CommandItemSettings
ShowExportToWordButton
=
"false"
ShowExportToExcelButton
=
"false"
ShowAddNewRecordButton
=
"false"
ShowRefreshButton
=
"false"
/>
54.
<
NoRecordsTemplate
>
55.
No documents were selected for this package
56.
</
NoRecordsTemplate
>
57.
<
Columns
>
58.
<
telerik:GridBoundColumn
DataField
=
"ID"
HeaderText
=
"ID"
SortExpression
=
"ID"
UniqueName
=
"ID"
AllowFiltering
=
"false"
Visible
=
"false"
/>
59.
<
telerik:GridBoundColumn
DataField
=
"GUID"
HeaderText
=
"FileNet Unique ID"
UniqueName
=
"GUID"
/>
60.
<
telerik:GridEditCommandColumn
UniqueName
=
"EditCommandColumn"
ButtonType
=
"ImageButton"
></
telerik:GridEditCommandColumn
>
61.
<
telerik:GridButtonColumn
CommandName
=
"Delete"
Text
=
"Delete"
ConfirmText
=
"Do you want to remove this search?"
UniqueName
=
"DeleteCommandColumn"
ButtonType
=
"ImageButton"
/>
62.
</
Columns
>
63.
</
MasterTableView
>
64.
<
ClientSettings
AllowKeyboardNavigation
=
"true"
EnablePostBackOnRowClick
=
"true"
>
65.
<
Selecting
AllowRowSelect
=
"true"
></
Selecting
>
66.
</
ClientSettings
>
67.
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
></
PagerStyle
>
68.
</
telerik:RadGrid
>
69.
70.
</
div
>
71.
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
ConnectionString="<%$ appSettings:DBConnectionString %>"
72.
DeleteCommand="DELETE FROM [Products] WHERE [ID] = @ID"
73.
SelectCommand="SELECT [ID], [WP_Path], [WP_Name], [Status], [WP_Type], [WP_DT] FROM OxyDocs_WorkPack_Header where UserID like '%haldanks%'"
74.
UpdateCommand="UPDATE [OxyDocs_WorkPack_Header] SET [WP_Name] = @WP_Name, [Status] = @Status WHERE [ID] = @ID">
75.
<
DeleteParameters
>
76.
<
asp:Parameter
Name
=
"ID"
Type
=
"Int32"
></
asp:Parameter
>
77.
</
DeleteParameters
>
78.
<
UpdateParameters
>
79.
<
asp:Parameter
Name
=
"WP_Name"
Type
=
"String"
></
asp:Parameter
>
80.
<
asp:Parameter
Name
=
"Status"
Type
=
"String"
></
asp:Parameter
>
81.
<
asp:Parameter
Name
=
"ID"
Type
=
"Int32"
></
asp:Parameter
>
82.
</
UpdateParameters
>
83.
</
asp:SqlDataSource
>
84.
<
asp:SqlDataSource
ID
=
"dsMySearches"
runat
=
"server"
85.
ConnectionString="<%$ appSettings:DBConnectionString %>"
86.
DeleteCommand="DELETE FROM OxyDocs_WorkPack_Detail WHERE [ID] = @ID"
87.
SelectCommand="SELECT ID, GUID, FolderPath, Message from OxyDocs_WorkPack_Detail where Header_ID = @ID">
88.
<
DeleteParameters
>
89.
<
asp:Parameter
Name
=
"ID"
Type
=
"Int32"
/>
90.
</
DeleteParameters
>
91.
<
SelectParameters
>
92.
<
asp:ControlParameter
ControlID
=
"RadGrid1"
Name
=
"ID"
PropertyName
=
"SelectedValue"
Type
=
"String"
></
asp:ControlParameter
>
93.
</
SelectParameters
>
94.
</
asp:SqlDataSource
>
95.
</
form
>
96.
</
body
>
Hello,
I have a bit of a unique situation that I am hoping to get some help with. We use the editor control to create HTML that gets saved and used elsewhere. Because of this, it's really important that every element has a font-family and font-size style associated with it in the html. Is there any way I can ensure this happens?
For example, when I press enter and start typing, the html produced will be <p>some text</p>. Is there any way I can make whatever font is specified in my toolbar drop downs automatically be applied? Such as: <span style="font-family: Arial; font-size: 16pt;">some text</span>.
I do execute some javascript when the editor loads to set the font properties intially:
editor.fire('FontName', { value: 'Arial' });
editor.fire('RealFontSize', { value: '9pt' });
This gives me a proper span when the editor is blank, but the editor doesn't always keep those properties for new lines are entered which results in some mismatched HTML when I need to use it elsewhere.
Thank you for your help!
Had an issue where a column converted from a text column to a dropdownlist column would display fine and update/insert fine as a text column but when converted to a dropdownlist (for the edit/insert form), the renderd 'grid' would not reflect the underlying value in the database, but would allow selection and would update the underlying database when in the edit/insert mode. Other fields converted from text to dropdown list in the same grid would behave fine. I traced this error back to the underlying column definition in the database. The misbehaving column was defined as char(10) and the working columns were varchar(10). When I converted the underlying column with the issue to varchar(10), the issue was resolved.
Just an FYI.
Greetings,
As per a previous ticket, in a page we're disabling the ability for users to change the expressions in a radfilter, other than the values and the condition type (contains, starts with, etc).
To do that, we're using, as suggested, in the ExpressionItemCreated event the code:
if (e.Item is RadFilterGroupExpressionItem)
{
RadFilterGroupExpressionItem groupItem = e.Item as RadFilterGroupExpressionItem;
groupItem.RemoveButton.Visible = (sender as RadFilter) == FilterChoice;
groupItem.AddExpressionButton.Visible = (sender as RadFilter) == FilterChoice;
groupItem.AddGroupExpressionButton.Visible = (sender as RadFilter) == FilterChoice;
groupItem.GroupOperationChooserLink.Enabled = (sender as RadFilter) == FilterChoice;
}
if (e.Item is RadFilterSingleExpressionItem)
{
RadFilterSingleExpressionItem singleItem = e.Item as RadFilterSingleExpressionItem;
singleItem.FieldNameChooserLink.Enabled = (sender as RadFilter) == FilterChoice;
singleItem.RemoveButton.Visible = (sender as RadFilter) == FilterChoice;
}
This was working perfectly until we've upgraded to the latest version (due to the security warning you sent). Since then, the dropdown to select the field name and to select And/Or are enabled, even though the code suffered no changes.
We really need to disable these options. Please advise. Thank you.
Best Regards,
Nuno Cabrinha
<
telerik:GridTemplateColumn
UniqueName
=
"tcAxis"
HeaderText
=
"Axis"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblAxis"
runat
=
"server"
></
asp:Label
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
asp:DropDownList
ID
=
"ddlAxis"
runat
=
"server"
>
<
asp:ListItem
Text
=
"--Select--"
Value
=
"--Select--"
></
asp:ListItem
>
<
asp:ListItem
Text
=
"PrimaryB"
Value
=
"PrimaryB"
></
asp:ListItem
>
<
asp:ListItem
Text
=
"PrimaryT"
Value
=
"PrimaryT"
></
asp:ListItem
>
<
asp:ListItem
Text
=
"SecondaryT"
Value
=
"SecondaryT"
></
asp:ListItem
>
<
asp:ListItem
Text
=
"SecondaryB"
Value
=
"SecondaryB"
></
asp:ListItem
>
</
asp:DropDownList
>
<
asp:RequiredFieldValidator
ID
=
"rfvAxis"
runat
=
"server"
ErrorMessage
=
"*"
ControlToValidate
=
"ddlAxis"
InitialValue
=
"--Select--"
></
asp:RequiredFieldValidator
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"tcIsSameAxis"
HeaderText
=
"Is Same Axis"
>
<
ItemTemplate
>
<
asp:CheckBox
ID
=
"cbIsSameAxisDisplay"
runat
=
"server"
Enabled
=
"false"
/>
</
ItemTemplate
>
<
EditItemTemplate
>
<
asp:CheckBox
ID
=
"cbIsSameAxis"
runat
=
"server"
/>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>