<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
Runat
=
"server"
>
</
telerik:RadScriptManager
>
<
asp:Label
ID
=
"Label1"
runat
=
"server"
Text
=
"Label"
></
asp:Label
>
<
br
/>
<
telerik:RadFilter
ID
=
"RadFilter1"
runat
=
"server"
FilterContainerID
=
"RadGrid1"
onapplyexpressions
=
"RadFilter1_ApplyExpressions"
>
<
FieldEditors
>
<
telerik:RadFilterTextFieldEditor
FieldName
=
"field1"
DataType
=
"System.String"
/>
<
telerik:RadFilterTextFieldEditor
FieldName
=
"field2"
DataType
=
"System.String"
/>
</
FieldEditors
>
</
telerik:RadFilter
>
<
br
/>
<
br
/>
</
div
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
CellSpacing
=
"0"
GridLines
=
"None"
AllowAutomaticInserts
=
"True"
DataSourceID
=
"SqlDataSource1"
ShowGroupPanel
=
"True"
>
<
HeaderContextMenu
CssClass
=
"GridContextMenu GridContextMenu_Default"
></
HeaderContextMenu
>
<
MasterTableView
AutoGenerateColumns
=
"False"
DataSourceID
=
"SqlDataSource1"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
></
CommandItemSettings
>
<
RowIndicatorColumn
FilterControlAltText
=
"Filter RowIndicator column"
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
FilterControlAltText
=
"Filter ExpandColumn column"
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"MachineName"
FilterControlAltText
=
"Filter MachineName column"
HeaderText
=
"MachineName"
SortExpression
=
"MachineName"
UniqueName
=
"MachineName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"OperatingSystem"
FilterControlAltText
=
"Filter OperatingSystem column"
HeaderText
=
"OperatingSystem"
SortExpression
=
"OperatingSystem"
UniqueName
=
"OperatingSystem"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Location"
FilterControlAltText
=
"Filter Location column"
HeaderText
=
"Location"
SortExpression
=
"Location"
UniqueName
=
"Location"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"IPAddress"
FilterControlAltText
=
"Filter IPAddress column"
HeaderText
=
"IPAddress"
SortExpression
=
"IPAddress"
UniqueName
=
"IPAddress"
Visible
=
false
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Site_Name"
FilterControlAltText
=
"Filter Site_Name column"
HeaderText
=
"Site_Name"
SortExpression
=
"Site_Name"
UniqueName
=
"Site_Name"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Status_ID"
FilterControlAltText
=
"Filter Status_ID column"
HeaderText
=
"Status_ID"
SortExpression
=
"Status_ID"
UniqueName
=
"Status_ID"
Visible
=
false
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
></
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
ClientSettings
AllowDragToGroup
=
"True"
>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
/>
</
ClientSettings
>
<
FilterMenu
EnableImageSprites
=
"False"
DataValueField
=
"Location"
></
FilterMenu
>
</
telerik:RadGrid
>
<
telerik:RadAjaxManager
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadGrid1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:sitemgrConnectionString %>"
SelectCommand="TELRIK" SelectCommandType="StoredProcedure">
</
asp:SqlDataSource
>
</
form
>
</
body
>
</
html
>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
public partial class _Default : System.Web.UI.Page
{
string conStr = ConfigurationManager.ConnectionStrings["conn44"].ConnectionString;
protected void Page_Load(object sender, EventArgs e)
{
RadGrid1.GroupingSettings.CaseSensitive = false;
RadGrid1.ShowGroupPanel = true;
RadGrid1.ClientSettings.AllowDragToGroup = true;
RadFilterTextFieldEditor editor1 = new RadFilterTextFieldEditor();
RadFilter1.FieldEditors.Add(editor1);
editor1.FieldName = "field1";
editor1.DataType = typeof(string);
editor1.DisplayName = "field1";
RadFilterTextFieldEditor editor2 = new RadFilterTextFieldEditor();
RadFilter1.FieldEditors.Add(editor2);
editor2.FieldName = "field2";
editor2.DataType = typeof(string);
editor2.DisplayName = "field2";
}
protected void RadFilter1_ApplyExpressions(object sender, RadFilterApplyExpressionsEventArgs e)
{
RadFilterSqlQueryProvider provider = new RadFilterSqlQueryProvider();
provider.ProcessGroup(e.ExpressionRoot);
Label1.Text = provider.Result;
}
}
<
telerik:RadGrid
ID
=
"grdMyProcesses"
runat
=
"server"
AllowPaging
=
"False"
AutoGenerateColumns
=
"False"
AllowCustomPaging
=
"False"
BackColor
=
"White"
Height
=
"600px"
>
<
GroupingSettings
ExpandTooltip
=
"Expand"
CollapseTooltip
=
"Collapse"
/>
<
ClientSettings
AllowExpandCollapse
=
"True"
AllowGroupExpandCollapse
=
"True"
>
<
Selecting
AllowRowSelect
=
"True"
/>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
/>
</
ClientSettings
>
<
MasterTableView
DataKeyNames
=
"ProcessID"
NoDetailRecordsText
=
"No Processes."
NoMasterRecordsText
=
"No Processes."
ShowHeadersWhenNoRecords
=
"False"
AllowCustomPaging
=
"False"
HierarchyLoadMode
=
"ServerBind"
BackColor
=
"White"
>
<
ExpandCollapseColumn
Resizable
=
"False"
>
<
HeaderStyle
Width
=
"20px"
/>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ID"
UniqueName
=
"colID"
Visible
=
"False"
/>
<
telerik:GridTemplateColumn
HeaderText
=
"Process"
SortExpression
=
"ProcessName"
ItemStyle-Width
=
"459px"
HeaderStyle-Width
=
"459px"
>
<
ItemTemplate
>
<
asp:HyperLink
ID
=
"lnkProcessName"
runat
=
"server"
NavigateUrl='<%# Eval("ProcessSummaryURL") %>' Text='<%# Eval("ProcessName") %>' ToolTip='<%# Eval("ProcessDefinition") %>'></
asp:HyperLink
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Process Owner"
SortExpression
=
"ProcessOwnerName"
ItemStyle-Width
=
"100px"
HeaderStyle-Width
=
"100px"
>
<
ItemTemplate
>
<
asp:HyperLink
ID
=
"lnkProcessOwner"
runat
=
"server"
NavigateUrl='<%# Eval("EmailToProcessOwnerURL") %>' Text='<%# Eval("ProcessOwnerName") %>' ToolTip="Send a message to the Process Owner about this Process."></
asp:HyperLink
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
<
SortExpressions
>
<
telerik:GridSortExpression
FieldName
=
"ProcessDisplayOrder"
/>
</
SortExpressions
>
<
GroupByExpressions
>
<
telerik:GridGroupByExpression
>
<
SelectFields
>
<
telerik:GridGroupByField
HeaderText
=
"Group"
FieldAlias
=
"Group"
FieldName
=
"GroupName"
FormatString
=
""
/>
</
SelectFields
>
<
GroupByFields
>
<
telerik:GridGroupByField
FieldAlias
=
"GroupID"
FieldName
=
"GroupID"
/>
</
GroupByFields
>
</
telerik:GridGroupByExpression
>
<
telerik:GridGroupByExpression
>
<
SelectFields
>
<
telerik:GridGroupByField
HeaderText
=
"Enterprise Process"
FieldAlias
=
"EP"
FieldName
=
"EnterpriseProcessName"
FormatString
=
""
/>
</
SelectFields
>
<
GroupByFields
>
<
telerik:GridGroupByField
FieldAlias
=
"EnterpriseProcessDisplayOrder"
FieldName
=
"EnterpriseProcessDisplayOrder"
/>
<
telerik:GridGroupByField
FieldAlias
=
"EnterpriseProcessID"
FieldName
=
"EnterpriseProcessID"
/>
</
GroupByFields
>
</
telerik:GridGroupByExpression
>
</
GroupByExpressions
>
</
MasterTableView
>
</
telerik:RadGrid
>
Hi,
protected
void
Page_Load(
object
sender, EventArgs e)
{
ClientScriptManager cm = Page.ClientScript;
cbReference = cm.GetCallbackEventReference(
this
,
"arg"
,
"ReceiveServerData"
,
""
,
"errorData"
,
false
);
String callbackScript =
"function CallServer(arg, context) {"
+
cbReference +
"; WebForm_InitCallback(); }"
;
cm.RegisterClientScriptBlock(
this
.GetType(),
"CallServer"
, callbackScript,
true
);
}
public
void
RaiseCallbackEvent(String eventArgument)
{
//fetch some data
}
public
string
GetCallbackResult()
{
return
strJSON;
}
<
telerik:RadAjaxPanel
ID
=
"RadAjaxPanel1"
runat
=
"server"
EnableAJAX
=
"False"
HorizontalAlign
=
"NotSet"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
CellSpacing
=
"0"
GridLines
=
"None"
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"True"
DataSourceID
=
"SqlDataSource1"
ShowGroupPanel
=
"True"
AllowSorting
=
"True"
Skin
=
"Office2010Blue"
Height
=
"100%"
Width
=
"100%"
GroupLoadMode
=
"Server"
OnItemInserted
=
"RadGrid1_ItemInserted"
OnInsertCommand
=
"RadGrid1_InsertCommand"
OnItemCommand
=
"RadGrid1_ItemCommand"
onitemdatabound
=
"RadGrid1_ItemDataBound"
>
...
<
DetailTables
>
<
telerik:GridTableView
Name
=
"Detail"
DataKeyNames
=
"ExamID"
AllowSorting
=
"false"
DataSourceID
=
"SqlDataSource2"
Width
=
"100%"
PageSize
=
"10"
ShowHeader
=
"False"
RetrieveAllDataFields
=
"false"
runat
=
"server"
CommandItemDisplay
=
"Top"
EditMode
=
"EditForms"
NoDetailRecordsText
=
"No records to display."
AutoGenerateColumns
=
"false"
AllowAutomaticUpdates
=
"true"
AllowAutomaticDeletes
=
"false"
AllowAutomaticInserts
=
"false"
CommandItemSettings-AddNewRecordText
=
"New exam"
>
<
ParentTableRelation
>
<
telerik:GridRelationFields
DetailKeyField
=
"CertificationID"
MasterKeyField
=
"CertificationID"
/>
</
ParentTableRelation
>
<
AlternatingItemStyle
/>
<
NoRecordsTemplate
>
<
asp:Label
runat
=
"server"
Text
=
"No records."
></
asp:Label
>
</
NoRecordsTemplate
>
<
EditFormSettings
ColumnNumber
=
"1"
CaptionDataField
=
"Exam"
InsertCaption
=
"New exam"
CaptionFormatString
=
"Edit properties of exam {0}"
>
<
FormTableItemStyle
Width
=
"100%"
Height
=
"29px"
/>
<
FormTableStyle
GridLines
=
"None"
CellPadding
=
"2"
CellSpacing
=
"0"
/>
<
FormStyle
Width
=
"100%"
BackColor
=
"#eef2ea"
/>
<
EditColumn
ButtonType
=
"ImageButton"
CancelText
=
"Cancel"
UpdateText
=
"Update"
InsertText
=
"Add"
/>
</
EditFormSettings
>
<
CommandItemSettings
AddNewRecordText
=
"New exam"
ExportToPdfText
=
"Export to PDF"
/>
<
RowIndicatorColumn
FilterControlAltText
=
"Filter RowIndicator column"
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
FilterControlAltText
=
"Filter ExpandColumn column"
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"LinkButton"
ItemStyle-Width
=
"50px"
UniqueName
=
"EditCommandColumn"
>
<
ItemStyle
Width
=
"50px"
/>
</
telerik:GridEditCommandColumn
>
<
telerik:GridButtonColumn
ButtonType
=
"ImageButton"
CommandName
=
"Delete"
Text
=
"Delete2"
UniqueName
=
"DeleteColumn"
>
</
telerik:GridButtonColumn
>
<
telerik:GridTemplateColumn
></
telerik:GridTemplateColumn
>
<%--<
telerik:GridBoundColumn
DataField
=
"CertificationID"
FilterControlAltText
=
"Filter exam number column"
HeaderText
=
"Certification ID"
UniqueName
=
"CertificationID"
ReadOnly
=
"true"
/>
<
telerik:GridBoundColumn
DataField
=
"ExamID"
FilterControlAltText
=
"Filter exam number column"
HeaderText
=
"Exam ID"
UniqueName
=
"ExamID"
ReadOnly
=
"true"
>
</
telerik:GridBoundColumn
>--%>
<
telerik:GridBoundColumn
DataField
=
"Exam"
DataType
=
"System.String"
FilterControlAltText
=
"Filter exam number column"
HeaderText
=
"Exam number"
UniqueName
=
"Exam"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Name"
FilterControlAltText
=
"Filter Name column"
HeaderText
=
"Exam name"
UniqueName
=
"Name"
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"ArrowColumn"
>
<
ItemTemplate
>
dsds
<
asp:ImageButton
BorderStyle
=
"Solid"
ID
=
"ImageButton1"
AlternateText
=
"Delete4"
runat
=
"server"
CommandName
=
"Delete4"
ImageUrl
=
"~/_layouts/Images/Delete.GIF"
OnClientClick
=
"ConfirmDelete;"
/>
</
ItemTemplate
>
<
HeaderStyle
Width
=
"30px"
/>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"ArrowColumn2"
>
<
ItemTemplate
>
<
input
type
=
"button"
id
=
"buttondel"
value
=
"Callback"
runat
=
"server"
onclick
=
"CallServer(1,1);"
/>
</
ItemTemplate
>
<
HeaderStyle
Width
=
"30px"
/>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
telerik:GridTableView
>
</
DetailTables
>
function
ReceiveServerData(arg, context) {
var
c = eval(arg);
for
(
var
i
in
c) {
$(
"#ResultsTable2 tr:last"
).after(
"<tr><td>"
+ c[i][0] +
" - "
+ c[i][1] +
"</td><td>"
);
}
}
"function CallServer(arg, context) {"
+
cbReference +
"; WebForm_InitCallback(); }"
;
called after cbreference and not clearing
__theFormPostData and __theFormPostCollection viewstate variables.
ClientScriptManager cm = Page.ClientScript;
cbReference = cm.GetCallbackEventReference(
this
,
"arg"
,
"ReceiveServerData"
,
""
,
"errorData"
,
false
);
String callbackScript =
"function CallServer(arg, context) { __theFormPostData = ''; __theFormPostCollection = new Array(); WebForm_InitCallback();"
+
cbReference +
"; }"
;
<telerik:RadComboBox ID="RadComboBox1" AllowCustomText="true" runat="server" Width="289px"
Height="200px" DataSourceID="SqlDataSource1" DataTextField="UserName"
EmptyMessage="Search for people...">
</telerik:RadComboBox>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:FingertipsConnectionString %>"
SelectCommand="SELECT [UserName] FROM [AuditTrail] Order By UserName"></asp:SqlDataSource>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadComboBox2">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadComboBox1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
</td> </tr>
this is the 2nd combobox for database. this combobox i want to connect to database to get the content from column "database"
<td>
<asp:Label runat="server" ID="databaseLabel" AssociatedControlID="RadComboBox3">Database:</asp:Label>
</td>
<td>
<telerik:RadComboBox ID="RadComboBox3" AllowCustomText="true" runat="server" Width="289px"
Height="200px" DataSourceID="SqlDataSource2"
EmptyMessage="Search for database...">
</telerik:RadComboBox>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:FingertipsConnectionString %>"
SelectCommand="SELECT [Database] FROM [AuditTrail]"></asp:SqlDataSource>
</td>