<ItemTemplate>
<table width="100%">
<tr>
<td style="width:250px;" >
Created by: <%# Eval("created_by")%><br />
Created On: <%# Eval("created_on", "{0: ddd MM/dd/yy hh:mm}")%><br />
<asp:Label ID="lblNoteType" runat="server" Text="" Visible="false" />
<asp:Label ID="lblNoteTypeData" runat="server" Text='<%# Eval("note_type")%>' Visible="false" />
</td>
<td>
<%# Eval("note")%>
</td>
</tr>
</table>
</ItemTemplate>
I am trying to toggle lblNoteType visible and invisible based on permissions as well as change the text property.
I put a name on the detail grid and setup aProtected Sub gvNotes_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs)event, but that didn't work, setting
<telerik:GridTableView Name="gvNotes" OnDataBound="gvNotes_ItemDataBound"on the detail grid didn't launch the event either.
What is the best way to do this?
Thanks
Randy Miller
TransGuardian
function
onCheckBoxClick(chk)
{
var
combo = $find(
"<%= cboPolicyScope.ClientID %>"
);
var
agencylist = $find(
"<%= cboUserAgencies.ClientID %>"
);
//holds the text of all checked items
var
text =
""
;
//holds the values of all checked items
var
values =
""
;
//get the collection of all items
var
items = combo.get_items();
//enumerate all items
for
(
var
i = 0; i < items.get_count(); i++)
{
var
item = items.getItem(i);
var
values = $telerik.findValue(item.get_value(),
"cboScope"
);
//get the checkbox element of the current item
var
chk1 = $get(combo.get_id() +
"_i"
+ i +
"_cboScope"
);
if
(values ==
"*"
)
{
agencylist.enable();
break
;
}
else
{
agencylist.disable();
}
}
}
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadGrid1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
LoadingPanelID
=
"2"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
public void Page_Load(object sender, EventArgs e)
{
RadAjaxManager ajaxManager=new RadAjaxManager();
ajaxManager.ID = "mkn";
AjaxUpdatedControl ajaxUpdatedControl = new AjaxUpdatedControl("RadGrid1", "2");
AjaxSetting see = new AjaxSetting();
see.AjaxControlID = "RadGrid1";
see.UpdatedControls.Add(ajaxUpdatedControl);
ajaxManager.AjaxSettings.Add(see);//.AddAjaxSetting(RadGrid1, RadGrid1,null);
}
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPage.master"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<
asp:Content
ID
=
"Content3"
ContentPlaceHolderID
=
"ContentPlaceHolder1"
runat
=
"server"
>
<
telerik:RadSplitter
ID
=
"RadSplitter1"
runat
=
"server"
Orientation
=
"Horizontal"
PanesBorderSize
=
"0"
BorderSize
=
"0"
>
<
telerik:RadPane
ID
=
"PanelTGDet"
runat
=
"server"
Locked
=
"true"
Height
=
"24"
Scrolling
=
"None"
>
<
telerik:RadTabStrip
ID
=
"tabStripTalkGroupDetails"
OnTabClick
=
"tabStripTalkGroupDetails_OnTabClick"
runat
=
"server"
MultiPageID
=
"mpageTalkGroupDetails"
>
<
Tabs
>
</
Tabs
>
</
telerik:RadTabStrip
>
</
telerik:RadPane
>
<
telerik:RadPane
ID
=
"RadPane3"
runat
=
"server"
Scrolling
=
"Y"
Height
=
"100%"
>
<
telerik:RadMultiPage
ID
=
"mpageTalkGroupDetails"
OnPageViewCreated
=
"mpageTalkGroupDetails_PageViewCreated"
SelectedIndex
=
"0"
runat
=
"server"
>
</
telerik:RadMultiPage
>
</
telerik:RadPane
>
</
telerik:RadSplitter
>
</
asp:Content
>
public
partial
class
_Default : System.Web.UI.Page
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!IsPostBack)
{
AddTab(
"Orango"
);
AddTab(
"OrangoTango"
);
AddTab(
"AnotherOrango"
);
}
}
private
void
AddTab(
string
tabName)
{
RadTab tab =
new
RadTab();
tab.Text = tabName;
tabStripTalkGroupDetails.Tabs.Add(tab);
RadPageView pageView =
new
RadPageView();
pageView.ID = tabName;
mpageTalkGroupDetails.PageViews.Add(pageView);
}
protected
void
tabStripTalkGroupDetails_OnTabClick(
object
sender, RadTabStripEventArgs e)
{
}
protected
void
mpageTalkGroupDetails_PageViewCreated(
object
sender, RadMultiPageEventArgs e)
{
string
userControlName =
string
.Empty;
switch
(e.PageView.ID)
{
case
"Orango"
:
userControlName =
"~/Orango.ascx"
;
break
;
case
"OrangoTango"
:
userControlName =
"~/Orango.ascx"
;
break
;
case
"AnotherOrango"
:
userControlName =
"~/Orango.ascx"
;
break
;
default
:
break
;
}
if
(!
string
.IsNullOrEmpty(userControlName))
{
Control userControl = Page.LoadControl(userControlName);
userControl.ID = e.PageView.ID +
"_userControl"
;
e.PageView.Controls.Add(userControl);
}
}
}
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Orango.ascx.cs" Inherits="Orango" %>
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function MySplitloadedORANGO(sender, args) {
alert("SplitterLoad ORANGO");
}
</
script
>
</
telerik:RadCodeBlock
>
<
telerik:RadSplitter
ID
=
"RadSplitter1"
runat
=
"server"
Orientation
=
"Horizontal"
PanesBorderSize
=
"0"
OnClientLoad
=
"MySplitloadedORANGO"
BorderSize
=
"0"
Height
=
"100%"
>
</
telerik:RadSplitter
>
Hello,
Please, I need help.
I am using treeview inside a combobox, I see the telerik demo about this issue but instead of using static nodes I am using my sql datasource.
The problem is that in the first open dropdown list everything is ok but when I want to open it again it gives me a javascript error in:
function OnClientDropDownOpenedHandler(sender, eventArgs) {
var tree = sender.get_items().getItem(0).findControl("tvCategories");
var selectedNode = tree.get_selectedNode(); ******* here******* null reference
if (selectedNode) {
selectedNode.scrollIntoView();
}
}
that's mean that he don't have data source, I tried to use attribute Autopostback=true to go by ajax using also radajaxmanager to the server and get my data source but it didn't work anyway this is my code and I appreciate.
function nodeClicking(sender, args) {
var comboBox = $find("<%= cboAddRoot.ClientID %>");
var node = args.get_node()
comboBox.set_text(node.get_text());
comboBox.trackChanges();
comboBox.get_items().getItem(0).set_text(node.get_text());
comboBox.commitChanges();
comboBox.hideDropDown();
// Call comboBox.attachDropDown if:
// 1) The RadComboBox is inside an AJAX panel.
// 2) The RadTreeView has a server-side event handler for the NodeClick event, i.e. it initiates a postback when clicking on a Node.
// Otherwise the AJAX postback becomes a normal postback regardless of the outer AJAX panel.
//comboBox.attachDropDown();
}
function OnClientDropDownOpenedHandler(sender, eventArgs) {
var tree = sender.get_items().getItem(0).findControl("tvCategories");
var selectedNode = tree.get_selectedNode();
if (selectedNode) {
selectedNode.scrollIntoView();
}
}
function StopPropagation(e) {
if (!e) {
e = window.event;
}
e.cancelBubble = true;
}
<tr>
<td>
Add Root Category:
</td>
<td>
<telerik:RadComboBox ID="cboAddRoot" runat="server" Width="250px" AutoPostBack="true"
ShowToggleImage="True" Style="vertical-align: middle;" OnClientDropDownOpened="OnClientDropDownOpenedHandler"
EmptyMessage="Choose a Category" ExpandAnimation-Type="None" CollapseAnimation-Type="None">
<ItemTemplate>
<div id="div1">
<telerik:RadTreeView runat="server" ID="tvCategories" DataFieldID="ID" DataSourceID="SqlDataSource1"
DataFieldParentID="ParentID" DataTextField="Name"
DataValueField="ID"
OnClientNodeClicking="nodeClicking" Width="100%" Height="140px">
</telerik:RadTreeView>
</div>
</ItemTemplate>
<Items>
<telerik:RadComboBoxItem Text="" />
</Items>
</telerik:RadComboBox>
<script type="text/javascript">
var div1 = document.getElementById("div1");
div1.onclick = StopPropagation;
</script>
</td>
</tr>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" EnableViewState="true" ConnectionString="<%$ ConnectionStrings:ERPCS %>"
SelectCommand="SELECT * FROM [ProductCategories]"></asp:SqlDataSource>
OnClientNodeClicking="nodeClicking" Width="100%" Height="140px">
</telerik:RadTreeView>
</div>
</ItemTemplate>
<Items>
<telerik:RadComboBoxItem Text="" />
</Items>
</telerik:RadComboBox>
<script type="text/javascript">
var div1 = document.getElementById("div1");
div1.onclick = StopPropagation;
</script>
</td>
</tr>