or
private void BuildResultPanel()
{
_mppUserListView = new Telerik.Web.UI.RadListView()
{
ID = "MPPUserResultList",
RegisterWithScriptManager = true,
AllowPaging = true
};
var mainDiv = new HtmlGenericControl("Div");
mainDiv.Attributes.Add("style", "overflow:hidden;border:1px solid black;padding:5px;margin-top:15px");
this.Controls.Add(mainDiv);
mainDiv.Controls.Add(_mppUserListView);
_mppUserListView.LayoutTemplate = new PhotoUploadLayoutTemplate();
var photoUploadResultItemTemplate = new PhotoUploadResultItemTemplate();
var container = new Control();
photoUploadResultItemTemplate.InstantiateIn(container);
var s = RenderControl(container);
//_mppUserListView.ItemTemplate = photoUploadResultItemTemplate;
//_mppUserListView.ItemPlaceholderID = "items";
_mppUserListView.ClientSettings.DataBinding.ItemTemplate = s;
_mppUserListView.ClientSettings.DataBinding.ItemPlaceHolderID = "items";
_mppUserListView.ClientSettings.DataBinding.DataService.Location = "/_layouts/services/MPPusersPhotoBioUpload/MPPUsers.ashx";
_mppUserListView.ClientSettings.DataBinding.DataService.DataPath = "GetMPPUsers";
if (MIAjax != null) MIAjax.AjaxSettings.AddAjaxSetting(_mppUserListView, _mppUserListView, MIAjaxLoader);
}
public void InstantiateIn(Control container)
{
var dataPager = new RadDataPager { PagedControlID = "MPPUserResultList",
ID = "MPPUserResultList_pagerTop", PageSize = 20 };
dataPager.Fields.Add(new RadDataPagerButtonField() { FieldType = PagerButtonFieldType.FirstPrev });
dataPager.Fields.Add(new RadDataPagerButtonField() { FieldType = PagerButtonFieldType.Numeric, PageButtonCount = 5 });
dataPager.Fields.Add(new RadDataPagerButtonField() { FieldType = PagerButtonFieldType.NextLast });
container.Controls.Add(dataPager);
...
}
<telerik:RadCodeBlock ID=
"RadCodeBlock1"
runat=
"server"
>
<script type=
"text/javascript"
>
function
OnClientNodeClicked(sender, args) {
var
currNode = args.get_item();
var
childNodes = currNode.get_childItems();
var
nodeCount = currNode.get_childItems().length;
if
(nodeCount > 0) {
var
isChecked = currNode.get_selected();
UpdateAllChildren(currNode, childNodes, nodeCount, isChecked);
}
}
function
UpdateAllChildren(currNode, nodes, nodecount, checked) {
var
i;
for
(i = 0; i < nodecount; i++) {
if
(checked) {
nodes[i].set_selected(
true
);
}
else
{
nodes[i].set_selected(
false
);
}
}
}
</script>
</telerik:RadCodeBlock>
<
telerik:RadTreeList
ID
=
"rtlBusinessUnit"
runat
=
"server"
DataKeyNames
=
"Business_Unit_ID"
ClientSettings-AllowPostBackOnItemClick
=
"false"
OnNeedDataSource
=
"rtlBusinessUnit_OnNeedDataSource"
ParentDataKeyNames
=
"ParentBUID"
OnItemCreated
=
"rtlBusinessUnit_OnItemCreated"
OnItemDataBound
=
"rtlBusinessUnit_OnItemDataBound"
AutoGenerateColumns
=
"false"
AllowMultiItemSelection
=
"true"
>
<
Columns
>
<
telerik:TreeListSelectColumn
HeaderStyle-Width
=
"38px"
UniqueName
=
"BussinessUnitCheckboxes"
>
</
telerik:TreeListSelectColumn
>
<
telerik:TreeListBoundColumn
DataField
=
"Business_Unit_ID"
HeaderText
=
"Business_Unit_ID"
Visible
=
"false"
UniqueName
=
"Business_Unit_ID"
/>
<
telerik:TreeListBoundColumn
DataField
=
"LegalName"
HeaderText
=
"Name"
UniqueName
=
"LegalName"
/>
<
telerik:TreeListBoundColumn
DataField
=
"Business_Unit_ID"
HeaderText
=
"Business_Unit_ID"
Visible
=
"false"
UniqueName
=
"Business_Unit_ID"
HeaderStyle-Width
=
"80px"
/>
</
Columns
>
<
ClientSettings
>
<
ClientEvents
OnItemSelected
=
"OnClientNodeClicked"
OnItemDeselected
=
"OnClientNodeClicked"
/>
<
Selecting
AllowItemSelection
=
"true"
/>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
SaveScrollPosition
=
"true"
ScrollHeight
=
"300"
/>
</
ClientSettings
>
</
telerik:RadTreeList
>
<telerik:RadComboBox |
ID="ListingState" |
TabIndex="4" |
EnableEmbeddedSkins="true" |
Skin="Black" |
runat="server" |
Width="250px" |
MarkFirstMatch="true" |
Height="200px" |
ToolTip="Select your state/province." |
OnClientSelectedIndexChanging="LoadCities" |
OnItemsRequested="ListingState_ItemsRequested" |
OnClientItemsRequested="ItemsLoaded" |
> |
</telerik:RadComboBox> |
protected void SelectAll_CheckedChangedEvent(object sender, EventArgs e)
{
CheckBox SelectAll = sender as CheckBox;
foreach (GridItem item in grdOnDSelection.Items)
{
if (SelectAll.Checked == true)
{
CheckBox chk = (CheckBox)item.Cells[2].FindControl("chkOnDSelection");
chk.Checked = true;
RadNumericTextBox txtDsicountPercent = (RadNumericTextBox)item.Cells[7].FindControl("txtDsicountPercent");
txtDsicountPercent.Enabled = true;
}
else
{
RadNumericTextBox txtDsicountPercent = (RadNumericTextBox)item.Cells[7].FindControl("txtDsicountPercent");
txtDsicountPercent.Enabled = false;
grdOnDSelection.Rebind();
}
}
}
protected void chkOnDSelection_checkedChangedEvent(object sender, EventArgs e)
{
((sender as CheckBox).NamingContainer as GridItem).Selected = (sender as CheckBox).Checked;
CheckBox chk = sender as CheckBox;
GridItem item = chk.NamingContainer as GridItem;
if (chk.Checked && item.Cells[7].FindControl("txtDsicountPercent") is RadNumericTextBox)
{
RadNumericTextBox txtDsicountPercent = (RadNumericTextBox)item.Cells[7].FindControl("txtDsicountPercent");
txtDsicountPercent.Enabled = true;
}
if (chk.Checked == false && item.Cells[7].FindControl("txtDsicountPercent") is RadNumericTextBox)
{
RadNumericTextBox txtDsicountPercent = (RadNumericTextBox)item.Cells[7].FindControl("txtDsicountPercent");
txtDsicountPercent.Enabled = false;
//grdOnDSelection.Rebind();//all chkboxes will be deselected
}
}
Hi,
I have an issue on rad html chart; I have a page with rad html pie charts (more than one) inside the rad grid. In grid we have button to select the line and will click on that display the rad pop up window.
My issue is when opening that rad window main page rad html pie charts are disappearing. After I close that rad window and refresh page, it will load correctly.
need an answer as soon as possible
cheers
Waruni