I have a grid with the following column
| <telerik:GridCheckBoxColumn UniqueName="Active" DataField="Active" HeaderText="Active" > |
| </telerik:GridCheckBoxColumn> |
<%
@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucTimeFilter.ascx.cs"
Inherits="PMS.UI.ucTimeFilter" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<
script language="javascript" type="text/javascript">
function ShowTooltip(element) {
if (element.childNodes[2] != null) {
element.title = element.childNodes[2].value;
}
}
var div1 = document.getElementById("dvTreeView");
div1.onclick = StopPropagation;
function StopPropagation(e) {
if (!e) {
e = window.event;
}
e.cancelBubble =
true;
}
function nodeClicking(sender, args) {
var comboBox = $find("<%= rcbTimePath.ClientID %>");
var node = args.get_node()
comboBox.set_text(node.get_text());
comboBox.trackChanges();
comboBox.get_items().getItem(0).set_value(node.get_text());
comboBox.commitChanges();
comboBox.hideDropDown();
}
function comboLoad(sender, eventArgs) {
sender.set_text(sender.get_items().getItem(0).get_value());
}
function OnClientDropDownOpenedHandler(sender, eventArgs) {
var tree = sender.get_items().getItem(0).findControl("rtvTime");
var selectedNode = tree.get_selectedNode();
if (selectedNode) {
selectedNode.scrollIntoView();
}
}
</
script>
<
table width="100%">
<tr>
<td style="width: 20%">
<asp:Label ID="lblYear" Text="<%$Resources:PMS, Year %>" runat="server" CssClass="CssHeader" />
</td>
<td>
<telerik:RadComboBox ID="rcbTimePath" runat="server" Height="140px" Width="215px"
ShowToggleImage="True" Skin="WebBlue" OnClientLoad="comboLoad" OnClientDropDownOpened="OnClientDropDownOpenedHandler"
Style="vertical-align: middle;" EnableViewState="true" EnableItemCaching="false">
<ItemTemplate>
<div id="dvTreeView" runat="server">
<asp:TreeView ID="TreeView1" runat="server" ImageSet="Msdn"
NodeIndent="10" ShowLines="True" DataSource="XMLTimePath">
<ParentNodeStyle Font-Bold="False" />
<HoverNodeStyle BackColor="#CCCCCC" BorderColor="#888888" BorderStyle="Solid" Font-Underline="True" />
<SelectedNodeStyle BackColor="White" BorderColor="#888888" BorderStyle="Solid" BorderWidth="1px"
Font-Underline="False" HorizontalPadding="3px" VerticalPadding="1px" />
<NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" HorizontalPadding="5px"
NodeSpacing="1px" VerticalPadding="2px" />
<DataBindings>
<asp:TreeNodeBinding DataMember="YearName" TextField="text" ValueField="Value" />
<asp:TreeNodeBinding DataMember="HalfYearName" TextField="text" ValueField="Value" />
<asp:TreeNodeBinding DataMember="QuarterName" TextField="text" ValueField="Value" />
</DataBindings>
</asp:TreeView>
<telerik:RadTreeView ID="rtvTime" runat="server" OnClientNodeClicking="nodeClicking"
EnableDragAndDrop="false" DataSourceID='XMLTimePath' OnNodeClick="rtvTime_NodeClick"
MaxDataBindDepth='<%# FileMaxDataBindDepth %>'>
<DataBindings>
<telerik:RadTreeNodeBinding DataMember="YearName" TextField="text" ValueField="Value" />
<telerik:RadTreeNodeBinding DataMember="HalfYearName" TextField="text" ValueField="Value" />
<telerik:RadTreeNodeBinding DataMember="QuarterName" TextField="text" ValueField="Value" />
</DataBindings>
<CollapseAnimation Type="None" Duration="0" />
<ExpandAnimation Type="None" Duration="0" />
</telerik:RadTreeView>
</div>
</ItemTemplate>
<ExpandAnimation Duration="0" Type="None" />
<CollapseAnimation Duration="0" Type="None" />
<Items>
<telerik:RadComboBoxItem Text="" />
</Items>
<CollapseAnimation Type="None" Duration="0"></CollapseAnimation>
</telerik:RadComboBox>
<asp:XmlDataSource ID="XMLTimePath" runat="server" XPath="/Time/YearName" EnableCaching="false">
</asp:XmlDataSource>
</td>
</tr>
</
table>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

| <telerik:RadGrid ID="RadGrid4" runat="server" Skin="WebBlue" Width="95%" |
| AllowPaging="True" AllowSorting="True" |
| OnNeedDataSource="xxxRadGrid1_NeedDataSource" |
| OnUpdateCommand="xxxRadGrid1_UpdateCommand" |
| OnInsertCommand="xxxRadGrid1_InsertCommand" |
| OnDeleteCommand="xxxRadGrid1_DeleteCommand" |
| CommandItemSettings-AddNewRecordText="Add New BMI Measure" |
| OnItemCommand="xxxRadGrid1_ItemCommand" |
| GridLines="Both"> |
| <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> |
| <MasterTableView DataKeyNames="ID" GridLines="Both" Width="100%" |
| CommandItemDisplay="Top" AutoGenerateColumns="False"> |
| <Columns> |
| <telerik:GridEditCommandColumn> |
| </telerik:GridEditCommandColumn> |
| <telerik:GridBoundColumn DataField="ID" HeaderText="" UniqueName="ID" Visible="false"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Height" HeaderText="Height" UniqueName="Height"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Weight" HeaderText="Weight" UniqueName="Weight"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="BMI" HeaderText="BMI" UniqueName="BMI"> |
| </telerik:GridBoundColumn> |
| <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="Delete" ConfirmDialogType="Classic" ConfirmTitle="Deleting BMI Measure" ConfirmText="Are you sure you want to delete the BMI Measure?"> |
| </telerik:GridButtonColumn> |
| </Columns> |
| <EditFormSettings EditFormType="WebUserControl" UserControlName="" ColumnNumber="2" CaptionFormatString="Edit details for the Benchmark" |
| CaptionDataField="ID"> |
| <FormTableItemStyle Wrap="False"></FormTableItemStyle> |
| <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle> |
| <FormMainTableStyle CellSpacing="0" CellPadding="3" Width="100%" /> |
| <FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" CssClass="module" |
| Height="110px" Width="100%" /> |
| <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> |
| <FormStyle Width="100%" BackColor="#EEF2EA"></FormStyle> |
| <EditColumn UpdateText="Update BMI Measure" UniqueName="EditCommandColumn1" CancelText="Cancel Edit"> |
| </EditColumn> |
| <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle> |
| </EditFormSettings> |
| <ExpandCollapseColumn Visible="False"> |
| <HeaderStyle Width="19px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <RowIndicatorColumn Visible="False"> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| </MasterTableView> |
| <FilterMenu Skin="WebBlue" EnableTheming="True"> |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> |
| </FilterMenu> |
| </telerik:RadGrid> |
| protected void xxxRadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e) |
| { |
| RadGrid4.DataSource = bmiMeasures; |
| RadGrid4.DataMember = "BMIMeasures"; |
| } |
| protected void xxxRadGrid1_ItemCommand(object source, GridCommandEventArgs e) |
| { |
| if( e.CommandName == RadGrid.InitInsertCommandName ) |
| { |
| e.Canceled = true; |
| RadGrid4.EditIndexes.Clear(); |
| e.Item.OwnerTableView.EditFormSettings.UserControlName = "DesktopModules\\GCCPopulationEncounters\\InsertBMIMeasure.ascx"; |
| e.Item.OwnerTableView.InsertItem(); |
| } |
| else if( e.CommandName == RadGrid.EditCommandName ) |
| { |
| e.Item.OwnerTableView.IsItemInserted = false; |
| e.Item.OwnerTableView.EditFormSettings.UserControlName = "DesktopModules\\GCCPopulationEncounters\\EditBMIMeasure.ascx"; |
| } |
| } |
|
Protected Sub PriceRulesDetails_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.DataBinding
'Load Status DDL
Dim oValue As Object = DataBinder.Eval(DataItem, "Status").ToString
If oValue.Equals(DBNull.Value) Then
oValue =
""
End If
With Me.rdcmbPRStatus
.Items.Insert(0,
New RadComboBoxItem("", ""))
.Items.Insert(1,
New RadComboBoxItem("Active", "A"))
.Items.Insert(2,
New RadComboBoxItem("Inactive", "I"))
.DataBind()
End With
rdcmbPRStatus.SelectedValue = oValue.ToString
rdcmbPRStatus.DataSource =
Nothing
oValue =
Nothing
'Load Cost Multiplier DDL
oValue = DataBinder.Eval(DataItem,
"CostMultiplier").ToString
If oValue.Equals(DBNull.Value) Then
oValue =
""
End If
With Me.rdcmbPRCostMultiplier
.Items.Insert(0,
New RadComboBoxItem("", ""))
.Items.Insert(1,
New RadComboBoxItem("Program Cost", "P"))
.Items.Insert(2,
New RadComboBoxItem("Retail Cost", "R"))
End With
rdcmbPRCostMultiplier.SelectedValue = oValue.ToString
rdcmbPRCostMultiplier.DataSource =
Nothing
oValue =
Nothing
'' ''Load Reward Pricing Group DDL
' ''Me.rdcmbPRRewardPriceGroup.DataSource = LoadRewardPriceGroupsDDL()
' ''Me.rdcmbPRRewardPriceGroup.DataBind()
' ''oValue = DataBinder.Eval(DataItem, "RewardGroupID").ToString
' ''If oValue.Equals(DBNull.Value) Then
' '' oValue = ""
' ''End If
' ''rdcmbPRRewardPriceGroup.SelectedValue = oValue.ToString
' ''rdcmbPRRewardPriceGroup.DataSource = Nothing
' ''oValue = Nothing
End Sub