or
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!Page.IsPostBack)
{
UpdateFormWithDBData();
}
}
<
telerik:RadComboBox
ID
=
"RadComboState"
runat
=
"server"
Width
=
"250px"
Height
=
"150px"
EmptyMessage
=
"Select a state"
EnableLoadOnDemand
=
"True"
ShowMoreResultsBox
=
"true"
EnableVirtualScrolling
=
"true"
OnItemsRequested
=
"RadComboState_ItemsRequested"
>
</
telerik:RadComboBox
>
<
telerik:RadComboBox
ID
=
"RadComboInstitution"
runat
=
"server"
Width
=
"250px"
Height
=
"150px"
EmptyMessage
=
"Select an institution"
EnableLoadOnDemand
=
"True"
ShowMoreResultsBox
=
"true"
EnableVirtualScrolling
=
"true"
OnItemsRequested
=
"RadComboInstitution_ItemsRequested"
OnClientItemsRequesting
=
"GetSelectedState"
>
</
telerik:RadComboBox
>
function
GetSelectedState(sender, eventArgs) {
var
SelectedState;
var
combo = Telerik.Web.UI.RadComboBox.ComboBoxes[0];
SelectedState = combo.get_value();
var
context = eventArgs.get_context();
context[
"StateId"
] = SelectedState;
}
protected
void
RadComboState_ItemsRequested(
object
o, RadComboBoxItemsRequestedEventArgs e)
{
RadComboState.Items.Clear();
DataSet data = PoulateStates();
if
(data.Tables.Count > 0 && data.Tables[0].Rows[0][0].ToString() ==
"0"
)
{
int
itemOffset = e.NumberOfItems;
int
endOffset = Math.Min(itemOffset + ItemsPerRequest, data.Tables[0].Rows.Count);
e.EndOfItems = endOffset == data.Tables[0].Rows.Count;
for
(
int
i = itemOffset; i < endOffset; i++)
{
RadComboState.Items.Add(
new
RadComboBoxItem(data.Tables[0].Rows[i][
"State_Name"
].ToString(),
data.Tables[0].Rows[i][
"intPkVal"
].ToString()));
}
e.Message = GetStatusMessage(endOffset, data.Tables[0].Rows.Count);
}
else
{
RadComboBoxItem item =
new
RadComboBoxItem();
item.Value =
"-1"
;
if
(Session[
"COUNTRY"
] !=
null
&& Session[
"COUNTRY"
].ToString().ToUpper() ==
"MARSHALL ISLANDS"
)
item.Text =
"No Island Exists"
;
else
item.Text =
"No State Exists"
;
RadComboState.Items.Add(item);
}
}
protected
void
RadComboInstitution_ItemsRequested(
object
o, RadComboBoxItemsRequestedEventArgs e)
{
RadComboInstitution.Items.Clear();
DataSet Institution =
new
DataSet();
try
{
string
StateId = e.Context[
"StateId"
].ToString();
Institution = populateInstitution(StateId);
if
(Institution.Tables[0].Rows[0][0].ToString() ==
"0"
)
{
int
itemOffset = e.NumberOfItems;
int
endOffset = Math.Min(itemOffset + ItemsPerRequest, Institution.Tables[0].Rows.Count);
e.EndOfItems = endOffset == Institution.Tables[0].Rows.Count;
for
(
int
i = itemOffset; i < endOffset; i++)
{
RadComboInstitution.Items.Add(
new
RadComboBoxItem(Institution.Tables[0].Rows[i][
"Institution_Name"
].ToString(),
Institution.Tables[0].Rows[i][
"InstitutionId"
].ToString()));
}
e.Message = GetStatusMessage(endOffset, Institution.Tables[0].Rows.Count);
}
else
{
RadComboBoxItem item =
new
RadComboBoxItem();
item.Value =
"-1"
;
item.Text =
"No Institution Exists"
;
RadComboInstitution.Items.Add(item);
}
}
catch
(Exception ex)
{
}
}
if
(e.CommandName == RadGrid.ExportToExcelCommandName)
{
foreach
(GridFilteringItem filter
in
radGrid.MasterTableView.GetItems(GridItemType.FilteringItem))
{
filter.Visible =
false
;
}
radGrid.MasterTableView.ExportToExcel();
}
Unable to serialize the session state. In 'StateServer' and
'SQLServer' mode, ASP.NET will serialize the session state objects, and
as a result non-serializable objects or MarshalByRef objects are not
permitted. The same restriction applies if similar serialization is done
by the custom session state store in 'Custom' mode.
<
telerik:RadStyleSheetManager
ID
=
"RadStyleSheetManager1"
runat
=
"server"
>
</
telerik:RadStyleSheetManager
>
<
telerik:RadComboBox
ID
=
"RadComboBox1"
Skin
=
"SilverSkin"
EnableEmbeddedSkins
=
"False"
runat
=
"server"
>
<
Items
>
<
telerik:RadComboBoxItem
runat
=
"server"
Text
=
"RadComboBoxItem1"
/>
<
telerik:RadComboBoxItem
runat
=
"server"
Text
=
"RadComboBoxItem2"
/>
<
telerik:RadComboBoxItem
runat
=
"server"
Text
=
"RadComboBoxItem3"
/>
</
Items
>
<
CollapseAnimation
Type
=
"OutQuint"
Duration
=
"200"
></
CollapseAnimation
>
</
telerik:RadComboBox
>
<
telerik:RadComboBox
ID
=
"RadComboBox2"
Skin
=
"Metro"
EnableEmbeddedSkins
=
"True"
runat
=
"server"
>
<
Items
>
<
telerik:RadComboBoxItem
runat
=
"server"
Text
=
"RadComboBox2 Item1"
/>
<
telerik:RadComboBoxItem
runat
=
"server"
Text
=
"RadComboBox2 Item2"
/>
<
telerik:RadComboBoxItem
runat
=
"server"
Text
=
"RadComboBox2 Item3"
/>
</
Items
>
<
CollapseAnimation
Type
=
"OutQuint"
Duration
=
"200"
></
CollapseAnimation
>
</
telerik:RadComboBox
>
// Server Side with RadTreeNode type works fine
var node =
new
RadTreeNode();
node.Attributes.Add(
"id"
,
"folder_"
+ dtrReader[
"folderID"
]);
// Web Service with RadTreeNodeData type and the DestinationHtmlElement is empty
var node =
new
RadTreeNodeData();
node.Attributes.Add(
"id"
,
"folder_"
+ dtrReader[
"folderID"
]);