Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
117 views
I am using UI for ASP.NET for AJAX Q2 2014 in a web project.

We are using RadEditor for creating content items for HTML email newsletters.

I am using the code below to set the set the editor filters on the Page_Load event but the editor is still rendering and saving styles instead of attributes.

??
protected void SetEditorFilters()
{
    // DISABLE DEFAULT FILTERS
    txtContentHTML.ContentFilters = Telerik.Web.UI.EditorFilters.None;
 
    // SET DESIRED FILTERS
    txtContentHTML.EnableFilter(Telerik.Web.UI.EditorFilters.ConvertInlineStylesToAttributes);
    txtContentHTML.EnableFilter(Telerik.Web.UI.EditorFilters.FixEnclosingP);
    txtContentHTML.EnableFilter(Telerik.Web.UI.EditorFilters.FixUlBoldItalic);
    txtContentHTML.EnableFilter(Telerik.Web.UI.EditorFilters.IndentHTMLContent);
    txtContentHTML.EnableFilter(Telerik.Web.UI.EditorFilters.MakeUrlsAbsolute);
    txtContentHTML.EnableFilter(Telerik.Web.UI.EditorFilters.OptimizeSpans);
    txtContentHTML.EnableFilter(Telerik.Web.UI.EditorFilters.RemoveScripts);
     
}
Marin Bratanov
Telerik team
 answered on 22 Aug 2014
1 answer
191 views
Hello,

We are planning to deploy SharePoint 2013 solution using Telerik Web UI controls (Version: 2011.1.315.35). I have following doubts,

1. Is the specific version 2011.1.315.35 (free/community edition) is any more maintained (discontinued) or supported?
2. Do Telerik recommend version 2011.1.315.35 for SharePoint 2013 deployment?

Regards,
N.
Marin Bratanov
Telerik team
 answered on 22 Aug 2014
2 answers
191 views
Hi Telerik,

I am unable to disable the radsearchbox from javascript. Here is the code I used and cant find what is wrong with it.

var itembox= $find("<%= itemSearchBox.ClientID %>");
itembox.disable();

Thanks,
Freddy.
rajesh
Top achievements
Rank 1
 answered on 22 Aug 2014
2 answers
122 views
Hello everyone,

I am trying to implement a RadGrid that supports Batch editing. The main reason I want to implement this feature (EditMode="Batch") is to be able to add new records inline in the grid. I have been able to get the new record functionality that I desire, but it has broken the functionality that I implemented for both a double click and right click. Inline editing is not a requirement for me. Is there anyway to allow for inline additions of new records, while disabling the inline edit functionality in order to allow for right click and double click functionality of already added records?

RadGrid/MasterTableView ASPX:
<telerik:RadGrid ID="RadGridActionItem" runat="server" AllowSorting="True" AllowPaging="true"
    AllowFilteringByColumn="True" OnNeedDataSource="RadGridActionItem_NeedDataSource"
    OnPageIndexChanged="RadGridActionItem_PageIndexChanged" OnItemCreated="RadGridAction_ItemCreated"
    OnDeleteCommand="RadGridActionItem_DeleteCommand" OnInsertCommand="RadGridActionItem_InsertCommand"
    AllowMultiRowEdit="True" OnItemDataBound="RadGridActionItem_ItemDataBound" Width="80%"
    HorizontalAlign="Center" PageSize="15" EnableViewState="true" Skin="Windows7">
    <GroupingSettings CaseSensitive="false" />
    <MasterTableView AutoGenerateColumns="false" ShowFooter="true" DataKeyNames="Action_Item_Id"
        ClientDataKeyNames="Action_Item_Id" CommandItemDisplay="Top" Width="100%" HorizontalAlign="Center"
        EditMode="Batch">

Right Click Functionality (C#):
protected void RadMenu1_ItemClick(object sender, RadMenuEventArgs e)
{
    // Right click context menu selection event.
 
    int radGridClickRowIndex;
    string actionItemId;
    bool copied = true;
 
    // Get row index and Action_Item_Id associated with row
    radGridClickRowIndex = Convert.ToInt32(Request.Form["radGridClickedRowIndex"]);
    actionItemId = RadGridActionItem.MasterTableView.DataKeyValues[radGridClickRowIndex]["Action_Item_Id"].ToString();
 
    switch (e.Item.Text)
    {
        case "Copy":
            Response.Redirect("NewActionItem.aspx?ActionId=" + actionItemId + "&IsCopied=" + copied);
            break;
    }
}

DoubleClick Functionality (JS):
<script type="text/javascript">
    function RowDblClick(sender, args) {
        var dblClick;
        dblClick = true;
        var index = args.get_itemIndexHierarchical();
        var updateActionId = args.getDataKeyValue("Action_Item_Id");
        window.location.href = "NewActionItem.aspx?DblClick=" + dblClick + "&UpdateActionId=" + updateActionId;
    }
</script>

Once again, my main goal is to be able to add new records inline within the RadGrid while maintaining already implemented rightclick and doubleclick functionality. Any help I can get would be greatly appreciated. Thanks!

-Matt
Angel Petrov
Telerik team
 answered on 22 Aug 2014
11 answers
1.7K+ views
I have a grid which has 7 fixed width columns and I have enabled the ability to group these. However when I add a grouping by dragging the column to the Group header row, additional columns are added at the beginning of my grid, pushing my grid and data out to the right.

Id like to be able to prevent these columns from being added and just the group headers be shown as additional rows, either with or without the ability to expand or collapse.

I have attached an image of what is happening. The red section highlights the newly added column when I group, and the green section highlights the grid and its data being forced out to the right.

I have to set the width of the rows or they all come out the same size making the header row twice as tall as I want it. If there is an easy way to have the entire grid set to a width and the columns size automatically then please tell me how.
Eyup
Telerik team
 answered on 22 Aug 2014
3 answers
111 views
Does the RadRating in any way support Googles rich Snippets out of the box'

https://support.google.com/webmasters/answer/146645#aggregate

Markus
Marin Bratanov
Telerik team
 answered on 22 Aug 2014
3 answers
235 views
Hi, I have a dynamic gridview in which i need to add the RadContextMenu to the gridview cell dynamically.
Every RadContextMenu may has one or two or more RadMenuItem added to it based on situation.

I am able to capture which RadContextMenu cause postback in the web pages  ( Request.Form("__EVENTTARGET") ) , however, i need to access to the text of the RadMenuItem then only i can decide whether some control need to be generated based on the RadMenuItem click in the Page load event.
The purpose of doing so is to avoid the the dynamic control item is generated once in pageload event where postback =true  and generated again on the RadMenuItemClick event.


Does anyone has idea on this?
Dimitar
Telerik team
 answered on 22 Aug 2014
4 answers
445 views
Hi,
I currently have a Grid using batch edit mode (working quite nicely thanks to Telerik support) but I need to add a couple of features that are proving quite troublesome for me to implement.

The first is that the Save command in the grid is fine but I also have an ASP button on the page called "Post", which changes the status of the records entered (via SQL run from the codebehind). However, I would like the "Post" button to also save any changed/new/deleted records before it does its own thing.

I found client-side code (see below) that I thought would do the trick but its effects are overridden by the postback from the "Post" button.
var grid = $find("<%=RadGrid1.ClientID%>");
grid.get_batchEditingManager().saveChanges(grid.get_masterTableView());

Is there a way I can do this?

I have a similar problem with deleting records. Basically, I'm using a GridButtonColumn to provide a delete option but the deletes don't apply unless the user presses the save button. Our users keep missing this because once they see that the row has gone, they think the delete operation is complete. Is it possible to save the changes when the user either navigates away (using a control on the screen) or presses the "Post" button?

Regards

Geoff Scott

Maria Ilieva
Telerik team
 answered on 22 Aug 2014
2 answers
345 views
I have a grid that is bound to a SQL DataSource control. There are 6 GridBoundColumns displayed. I have a CommandItemTemplate for editing the records. When I click the edit selected row button, a custom edit form displays below the row displaying 30 different fields. This is a FormTemplate. Once I am done editing, I click the update button and SQL DataSource Updating event is kicked off where I need to set the values for the parameters of the SQL DataSource . This is a stored proc that gets executed by the datasource.

How do I access the templated fields inside the SQL DataSource Updating event?

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="NTA_PLAN_MASTER.aspx.cs" Inherits="NTA_Tables.NTA_PLAN_MASTER" %>
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
 
<%--    <style type="text/css">
        .rbPrimaryIcon.rbToggleCheckbox {
            background-image: none !important;
        }
    </style>
--%>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <telerik:RadAjaxManagerProxy runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="divMsgs"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <p id="divMsgs" runat="server">
        <asp:Label ID="Label1" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#FF8080" />
        <asp:Label ID="Label2" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#00C000" />
    </p>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadGrid ID="RadGrid1" runat="server" CssClass="RadGrid" GridLines="None"
        AllowPaging="True" PageSize="10" AllowSorting="True" AutoGenerateColumns="False"
        ShowStatusBar="true" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
        AllowAutomaticUpdates="True" DataSourceID="sdsNTA_PLAN_MASTER" OnItemDeleted="RadGrid1_ItemDeleted"
        OnItemInserted="RadGrid1_ItemInserted" OnItemUpdated="RadGrid1_ItemUpdated" OnItemCommand="RadGrid1_ItemCommand"
        OnPreRender="RadGrid1_PreRender">
        <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
        <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataSourceID="sdsNTA_PLAN_MASTER"
            DataKeyNames="COMPANY,PLAN_CODE,PRODUCT_CODE,PLAN_LEVEL,STATE_CODE,EFFECTIVE_DATE">
            <CommandItemTemplate>
                <div style="padding: 5px 5px;">
                         
                    <asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected" Visible='<%# RadGrid1.EditIndexes.Count == 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Edit.png"/>Edit selected</asp:LinkButton>  
                    <asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# RadGrid1.EditIndexes.Count > 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Update.png"/>Update</asp:LinkButton>  
                    <asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" Visible='<%# RadGrid1.EditIndexes.Count > 0 || RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Cancel.png"/>Cancel editing</asp:LinkButton>  
                    <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# !RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/AddRecord.png"/>Add new</asp:LinkButton>  
                    <asp:LinkButton ID="LinkButton3" runat="server" CommandName="PerformInsert" Visible='<%# RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Insert.gif"/> Add this Plan</asp:LinkButton>  
                    <asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete all selected plans?')"
                        runat="server" CommandName="DeleteSelected"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Delete.png"/>Delete selected plans</asp:LinkButton>  
                    <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Refresh.png"/>Refresh plan list</asp:LinkButton>
                </div>
            </CommandItemTemplate>
            <Columns>
                <telerik:GridBoundColumn UniqueName="COMPANY" HeaderText="Company Code" DataField="COMPANY">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="PLAN_CODE" HeaderText="Plan Code" DataField="PLAN_CODE">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="PRODUCT_CODE" HeaderText="Product Code" DataField="PRODUCT_CODE">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="PLAN_LEVEL" HeaderText="Plan Level" DataField="PLAN_LEVEL">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="STATE_CODE" HeaderText="State Code" DataField="STATE_CODE" >
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="EFFECTIVE_DATE" HeaderText="Effective Date" DataField="EFFECTIVE_DATE">
                </telerik:GridBoundColumn>
            </Columns>
            <EditFormSettings EditFormType="Template">
                <FormTemplate>
                    <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"
                        style="border-collapse: collapse;">
                        <tr class="EditFormHeader">
                            <td colspan="6" style="font-size: small">
                                <b>Plan Details</b>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="6">
                                <table id="Table3" cellspacing="1" cellpadding="1" width="100%" border="0" class="module">
                                    <tr>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            Company:
                                        </td>
                                        <td>
                                             <telerik:RadComboBox ID="cboCompany" runat="server" DropDownAutoWidth="Enabled"
                                                  Filter="Contains" MarkFirstMatch="true" ChangeTextOnKeyBoardNavigation="false"
                                                  DataSourceID="sdsNTA_COMPANY" DataTextField="COMPANY_NAME" DataValueField="COMPANY_CODE"
                                                  selectedValue='<%# Bind("COMPANY") %>' >
                                             </telerik:RadComboBox>
                                        </td>
                                        <td>
                                            Plan Code:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("PLAN_CODE") %>'>
                                            </asp:TextBox>
                                        </td>
                                        <td>
                                            Product Code:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("PRODUCT_CODE") %>'>
                                            </asp:TextBox>
                                        </td>
                                    </tr>  
                                    <tr>
                                        <td>
                                            Plan Level:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("PLAN_LEVEL") %>'>
                                            </asp:TextBox>
                                        </td>
                                        <td>
                                            State Code:
                                        </td>
                                        <td>
                                             <telerik:RadComboBox ID="cboSTATE_CODE" runat="server"
                                                  Filter="Contains" MarkFirstMatch="true" ChangeTextOnKeyBoardNavigation="false"
                                                  DataSourceID="sdsNTA_USA_STATES" DataTextField="StateName" DataValueField="StateAbbrev"
                                                  selectedValue='<%# Bind("STATE_CODE") %>' >
                                             </telerik:RadComboBox>
 
                                        </td>
                                        <td>
                                            Effective Date:
                                        </td>
                                        <td>
                                            <telerik:RadDatePicker ID="txtEFFECTIVE_DATE" runat="server" AutoPostBack="false" SelectedDate='<%# Bind("EFFECTIVE_DATE") %>'
                                                 DateInput-SelectedDate='<%# Bind("EFFECTIVE_DATE") %>' MinDate="1899-12-31" DBSelectedDate='<%# Bind("EFFECTIVE_DATE") %>'>
                                                <Calendar ID="Calendar1" runat="server">
                                                </Calendar>
                                            </telerik:RadDatePicker>
                                        </td>
                                    </tr>  
                                    <tr>
                                        <td>
                                            Termination Date:
                                        </td>
                                        <td>
                                            <telerik:RadDatePicker ID="txtTERMINATION_DATE" runat="server" AutoPostBack="false" SelectedDate='<%# Bind("TERMINATION_DATE") %>'
                                                 DateInput-SelectedDate='<%# Bind("TERMINATION_DATE") %>' MinDate="1899-12-31">
                                                <Calendar ID="Calendar2" runat="server">
                                                </Calendar>
                                            </telerik:RadDatePicker>
                                        </td>
                                        <td>
                                            Plan Type:
                                        </td>
                                        <td>
                                            <telerik:RadCombobox ID="cboPLAN_TYPE" runat="server"
                                                Filter="Contains" MarkFirstMatch="true" ChangeTextOnKeyBoardNavigation="false"
                                                DataSourceID="sdsNTA_PLAN_TYPES" DataTextField="PLAN_DESC" DataValueField="PLAN_CODE"                                            
                                                SelectedValue ='<%# Bind("PLAN_TYPE") %>' >
                                            </telerik:RadCombobox>
 
                                        </td>
                                        <td>
                                            Coverage Type:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("COVERAGE_TYPE") %>'>
                                            </asp:TextBox>
                                        </td>
                                    </tr>  
                                    <tr>
                                        <td>
                                            Coverage Code:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox10" runat="server" Text='<%# Bind("COVERAGE_CODE") %>'>
                                            </asp:TextBox>
                                        </td>
                                        <td>
                                            Line Of Business:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("LINE_OF_BUSINESS") %>'>
                                            </asp:TextBox>
                                        </td>
                                        <td>
                                            Specific Form:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox12" runat="server" Text='<%# Bind("SPECIFIC_FORM") %>'>
                                            </asp:TextBox>
                                        </td>
                                    </tr>  
                                    <tr>
                                        <td>
                                            Plan Code Desc:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox13" runat="server" Text='<%# Bind("PLAN_CODE_DESCR") %>'>
                                            </asp:TextBox>
                                        </td>
                                        <td>
                                            Generic Form Desc:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox14" runat="server" Text='<%# Bind("GENERIC_FORM_DESCR") %>'>
                                            </asp:TextBox>
                                        </td>
                                        <td>
                                            Schedule Page Desc:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox15" runat="server" Text='<%# Bind("SCHEDULE_PAGE_DESCR") %>'>
                                            </asp:TextBox>
                                        </td>
                                    </tr>  
                                    <tr>
                                        <td>
                                            Plan Code Abbrev:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox16" runat="server" Text='<%# Bind("PLAN_CODE_ABRV_DESCR") %>'>
                                            </asp:TextBox>
                                        </td>
                                        <td>
                                            Endorsement Exists?:
                                        </td>
                                        <td>
                                            <telerik:RadButton ID="chkENDORSEMENT_EXIST" runat="server" AutoPostBack="false" ButtonType="ToggleButton" ToggleType="CheckBox"
                                                Checked='<%# Eval("ENDORSEMENT_EXIST").ToString()=="Y" %>'>
                                                <ToggleStates>
                                                        <telerik:RadButtonToggleState PrimaryIconCssClass="rbCancel" />
                                                        <telerik:RadButtonToggleState PrimaryIconCssClass="rbOk" />
                                                </ToggleStates>                                           
                                            </telerik:RadButton>                                           
                                        </td>
                                        <td>
                                            Sold Resident State Only?:
                                        </td>
                                        <td>
                                            <telerik:RadButton ID="chkSOLD_RES_STATE_ONLY" runat="server" AutoPostBack="false" ButtonType="ToggleButton" ToggleType="CheckBox"
                                                Checked='<%# Eval("SOLD_RES_STATE_ONLY").ToString()=="Y" %>'>
                                                <ToggleStates>
                                                        <telerik:RadButtonToggleState PrimaryIconCssClass="rbCancel" />
                                                        <telerik:RadButtonToggleState PrimaryIconCssClass="rbOk" />
                                                </ToggleStates>                                           
                                            </telerik:RadButton>                                           
                                        </td>
                                    </tr>  
                                    <tr>
                                        <td>
                                           Print Surrender Cost Index Page?:
                                        </td>
                                        <td>
                                            <telerik:RadButton ID="chkPRINT_SURR_COST_IDX" runat="server" AutoPostBack="false" ButtonType="ToggleButton" ToggleType="CheckBox"
                                                Checked='<%# Eval("PRINT_SURR_COST_IDX").ToString()=="Y" %>'>
                                                <ToggleStates>
                                                        <telerik:RadButtonToggleState PrimaryIconCssClass="rbCancel" />
                                                        <telerik:RadButtonToggleState PrimaryIconCssClass="rbOk" />
                                                </ToggleStates>                                           
                                            </telerik:RadButton>                                           
                                        </td>
                                        <td>
                                            Extended Benefits Exists?:
                                        </td>
                                        <td>
                                            <telerik:RadButton ID="chkEXT_BENF_STATE_SPEC" runat="server" AutoPostBack="false" ButtonType="ToggleButton" ToggleType="CheckBox"
                                                Checked='<%# Eval("EXT_BENF_STATE_SPEC").ToString()=="Y" %>'>
                                                <ToggleStates>
                                                        <telerik:RadButtonToggleState PrimaryIconCssClass="rbCancel" />
                                                        <telerik:RadButtonToggleState PrimaryIconCssClass="rbOk" />
                                                </ToggleStates>                                           
                                            </telerik:RadButton>                                           
                                        </td>
                                        <td>
                                            Print Policy Fee on Schedule Page?:
                                        </td>
                                        <td>
                                            <telerik:RadButton ID="chkPRINT_POLICY_FEE" runat="server" AutoPostBack="false" ButtonType="ToggleButton" ToggleType="CheckBox"
                                                Checked='<%# Eval("PRINT_POLICY_FEE").ToString()=="Y" %>'>
                                                <ToggleStates>
                                                        <telerik:RadButtonToggleState PrimaryIconCssClass="rbCancel" />
                                                        <telerik:RadButtonToggleState PrimaryIconCssClass="rbOk" />
                                                </ToggleStates>                                           
                                            </telerik:RadButton>                                           
                                        </td>
                                    </tr>  
                                    <tr>
                                        <td>
                                           Print Insured or Primary Insured?:
                                        </td>
                                        <td>
                                            <telerik:RadButton ID="chkREQUIRED_PLAN" runat="server" AutoPostBack="false" ButtonType="ToggleButton" ToggleType="CheckBox"
                                                Checked='<%# Eval("REQUIRED_PLAN").ToString()=="Y" %>'>
                                                <ToggleStates>
                                                        <telerik:RadButtonToggleState PrimaryIconCssClass="rbCancel" />
                                                        <telerik:RadButtonToggleState PrimaryIconCssClass="rbOk" />
                                                </ToggleStates>                                           
                                            </telerik:RadButton>                                           
                                        </td>
                                        <td>
                                            NTA Plan Code:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox23" runat="server" Text='<%# Bind("NTA_PLAN_CODE") %>'>
                                            </asp:TextBox>
                                        </td>
                                        <td>
                                            NTA Generic Form:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox24" runat="server" Text='<%# Bind("NTA_GENERIC_FORM") %>'>
                                            </asp:TextBox>
                                        </td>
                                    </tr>  
                                    <tr>
                                        <td>
                                           NTA Generic Sub Form:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox25" runat="server" Text='<%# Bind("NTA_SUB_FORM") %>'>
                                            </asp:TextBox>
                                        </td>
                                        <td>
                                            Record Status:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox26" runat="server" Text='<%# Bind("RECORD_STATUS") %>'>
                                            </asp:TextBox>
                                        </td>
                                        <td>
                                            Last Updated By:
                                        </td>
                                        <td>
                                            <asp:TextBox ID="TextBox27" runat="server" Text='<%# Bind("OPERATOR_ID") %>'>
                                            </asp:TextBox>
                                        </td>
                                    </tr>  
                                </table>                        
                            </td>
                        </tr>
                    </table>
                </FormTemplate>
            </EditFormSettings>
        </MasterTableView>
        <ClientSettings>
            <Selecting AllowRowSelect="True" EnableDragToSelectRows="True"></Selecting>
        </ClientSettings>
    </telerik:RadGrid>
    <asp:SqlDataSource ID="sdsNTA_PLAN_MASTER" runat="server" ConnectionString="<%$ ConnectionStrings:NTAConnectionString %>"
        DeleteCommand="NTA_PLAN_MASTER_DELETE" DeleteCommandType="StoredProcedure" InsertCommand="NTA_PLAN_MASTER_INSERT"
        InsertCommandType="StoredProcedure" SelectCommand="NTA_PLAN_MASTER_SELECT_ALL"
        SelectCommandType="StoredProcedure" UpdateCommand="NTA_PLAN_MASTER_UPDATE" UpdateCommandType="StoredProcedure"
        OnUpdating="sdsNTA_PLAN_MASTER_Updating">
        <DeleteParameters>
            <asp:Parameter Name="COMPANY" Type="String"></asp:Parameter>
            <asp:Parameter Name="PLAN_CODE" Type="String"></asp:Parameter>
            <asp:Parameter Name="PRODUCT_CODE" Type="String"></asp:Parameter>
            <asp:Parameter Name="PLAN_LEVEL" Type="String"></asp:Parameter>
            <asp:Parameter Name="STATE_CODE" Type="String"></asp:Parameter>
            <asp:Parameter Name="EFFECTIVE_DATE" Type="String"></asp:Parameter>
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="COMPANY" Type="String"></asp:Parameter>
            <asp:Parameter Name="PLAN_CODE" Type="String"></asp:Parameter>
            <asp:Parameter Name="PRODUCT_CODE" Type="String"></asp:Parameter>
            <asp:Parameter Name="PLAN_LEVEL" Type="String"></asp:Parameter>
            <asp:Parameter Name="STATE_CODE" Type="String"></asp:Parameter>
            <asp:Parameter Name="EFFECTIVE_DATE" Type="String"></asp:Parameter>
            <asp:Parameter Name="TERMINATION_DATE" Type="String"></asp:Parameter>
            <asp:Parameter Name="PLAN_TYPE" Type="String"></asp:Parameter>
            <asp:Parameter Name="COVERAGE_TYPE" Type="String"></asp:Parameter>
            <asp:Parameter Name="COVERAGE_CODE" Type="String"></asp:Parameter>
            <asp:Parameter Name="LINE_OF_BUSINESS" Type="String"></asp:Parameter>
            <asp:Parameter Name="SPECIFIC_FORM" Type="String"></asp:Parameter>
            <asp:Parameter Name="PLAN_CODE_DESCR" Type="String"></asp:Parameter>
            <asp:Parameter Name="GENERIC_FORM_DESCR" Type="String"></asp:Parameter>
            <asp:Parameter Name="SCHEDULE_PAGE_DESCR" Type="String"></asp:Parameter>
            <asp:Parameter Name="PLAN_CODE_ABRV_DESCR" Type="String"></asp:Parameter>
            <asp:Parameter Name="ENDORSEMENT_EXIST" Type="String"></asp:Parameter>
            <asp:Parameter Name="SOLD_RES_STATE_ONLY" Type="String"></asp:Parameter>
            <asp:Parameter Name="PRINT_SURR_COST_IDX" Type="String"></asp:Parameter>
            <asp:Parameter Name="EXT_BENF_STATE_SPEC" Type="String"></asp:Parameter>
            <asp:Parameter Name="PRINT_POLICY_FEE" Type="String"></asp:Parameter>
            <asp:Parameter Name="REQUIRED_PLAN" Type="String"></asp:Parameter>
            <asp:Parameter Name="NTA_PLAN_CODE" Type="String"></asp:Parameter>
            <asp:Parameter Name="NTA_GENERIC_FORM" Type="String"></asp:Parameter>
            <asp:Parameter Name="NTA_SUB_FORM" Type="String"></asp:Parameter>
            <asp:Parameter Name="RECORD_STATUS" Type="String"></asp:Parameter>
            <asp:Parameter Name="OPERATOR_ID" Type="String" DefaultValue=""></asp:Parameter>
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="ORIGCOMPANY" Type="String"></asp:Parameter>
            <asp:Parameter Name="ORIGPLAN_CODE" Type="String"></asp:Parameter>
            <asp:Parameter Name="ORIGPRODUCT_CODE" Type="String"></asp:Parameter>
            <asp:Parameter Name="ORIGPLAN_LEVEL" Type="String"></asp:Parameter>
            <asp:Parameter Name="ORIGSTATE_CODE" Type="String"></asp:Parameter>
            <asp:Parameter Name="ORIGEFFECTIVE_DATE" Type="String"></asp:Parameter>
            <asp:Parameter Name="COMPANY" Type="String"></asp:Parameter>
            <asp:Parameter Name="PLAN_CODE" Type="String"></asp:Parameter>
            <asp:Parameter Name="PRODUCT_CODE" Type="String"></asp:Parameter>
            <asp:Parameter Name="PLAN_LEVEL" Type="String"></asp:Parameter>
            <asp:Parameter Name="STATE_CODE" Type="String"></asp:Parameter>
            <asp:Parameter Name="EFFECTIVE_DATE" Type="String"></asp:Parameter>
            <asp:Parameter Name="TERMINATION_DATE" Type="String"></asp:Parameter>
            <asp:Parameter Name="PLAN_TYPE" Type="String"></asp:Parameter>
            <asp:Parameter Name="COVERAGE_TYPE" Type="String"></asp:Parameter>
            <asp:Parameter Name="COVERAGE_CODE" Type="String"></asp:Parameter>
            <asp:Parameter Name="LINE_OF_BUSINESS" Type="String"></asp:Parameter>
            <asp:Parameter Name="SPECIFIC_FORM" Type="String"></asp:Parameter>
            <asp:Parameter Name="PLAN_CODE_DESCR" Type="String"></asp:Parameter>
            <asp:Parameter Name="GENERIC_FORM_DESCR" Type="String"></asp:Parameter>
            <asp:Parameter Name="SCHEDULE_PAGE_DESCR" Type="String"></asp:Parameter>
            <asp:Parameter Name="PLAN_CODE_ABRV_DESCR" Type="String"></asp:Parameter>
            <asp:Parameter Name="ENDORSEMENT_EXIST" Type="String"></asp:Parameter>
            <asp:Parameter Name="SOLD_RES_STATE_ONLY" Type="String"></asp:Parameter>
            <asp:Parameter Name="PRINT_SURR_COST_IDX" Type="String"></asp:Parameter>
            <asp:Parameter Name="EXT_BENF_STATE_SPEC" Type="String"></asp:Parameter>
            <asp:Parameter Name="PRINT_POLICY_FEE" Type="String"></asp:Parameter>
            <asp:Parameter Name="REQUIRED_PLAN" Type="String"></asp:Parameter>
            <asp:Parameter Name="NTA_PLAN_CODE" Type="String"></asp:Parameter>
            <asp:Parameter Name="NTA_GENERIC_FORM" Type="String"></asp:Parameter>
            <asp:Parameter Name="NTA_SUB_FORM" Type="String"></asp:Parameter>
            <asp:Parameter Name="RECORD_STATUS" Type="String"></asp:Parameter>
            <asp:Parameter Name="OPERATOR_ID" Type="String" DefaultValue=""></asp:Parameter>
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsNTA_USA_STATES" runat="server" ConnectionString="<%$ ConnectionStrings:NTAConnectionString %>"
        SelectCommand="NTA_USA_STATES_SELECT_ALL" SelectCommandType="StoredProcedure">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsNTA_COMPANY" runat="server" ConnectionString="<%$ ConnectionStrings:NTAConnectionString %>"
        SelectCommand="NTA_COMPANY_SELECT_EXCLUDE_AllCOMPANY_CODE" SelectCommandType="StoredProcedure">
        <SelectParameters>
            <asp:Parameter Name="RecordType" Type="String" DefaultValue="A"></asp:Parameter>
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsNTA_PLAN_TYPES" runat="server" ConnectionString="<%$ ConnectionStrings:NTAConnectionString %>"
        SelectCommand="NTA_PLAN_TYPES_SELECT" SelectCommandType="StoredProcedure">
    </asp:SqlDataSource>
     
</asp:Content>


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;
 
namespace NTA_Tables
{
    public partial class NTA_PLAN_MASTER : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
 
        protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
        {
            if (e.Exception != null)
            {
                e.KeepInEditMode = true;
                e.ExceptionHandled = true;
                DisplayMessage(true, "Plan cannot be updated. Reason: " + e.Exception.Message);
            }
            else
            {
                DisplayMessage(false, "Plan updated");
            }
        }
  
        protected void RadGrid1_ItemInserted(object source, GridInsertedEventArgs e)
        {
            if (e.Exception != null)
            {
                e.ExceptionHandled = true;
                e.KeepInInsertMode = true;
                DisplayMessage(true, "New plan cannot be inserted. Reason: " + e.Exception.Message);
            }
            else
            {
                DisplayMessage(false, "New plan inserted");
            }
        }
  
        protected void RadGrid1_ItemDeleted(object source, GridDeletedEventArgs e)
        {
            if (e.Exception != null)
            {
                e.ExceptionHandled = true;
                DisplayMessage(true, "Plan cannot be deleted. Reason: " + e.Exception.Message);
            }
            else
            {
                DisplayMessage(false, "Plan deleted");
            }
        }
  
        private void DisplayMessage(bool isError, string text)
        {
            Label label = (isError) ? this.Label1 : this.Label2;
            label.Text = text;
        }
 
        protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
        {
            switch (e.CommandName)
            {
                case "ExpandCollapse":
                    foreach (GridItem item in RadGrid1.MasterTableView.Items)
                    {
                        item.Expanded = false;
                    }
                    break;
            }
        }
        protected void RadGrid1_PreRender(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                RadGrid1.EditIndexes.Add(0);
                RadGrid1.Rebind();
            }
        }
 
        protected void sdsNTA_PLAN_MASTER_Updating(object sender, SqlDataSourceCommandEventArgs e)
        {
 
            foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
            {
                if (item.EditFormItem.IsInEditMode)
                {
                     
 
                    e.Command.Parameters["@ORIGCOMPANY"].Value = item.GetDataKeyValue("COMPANY").ToString();
                    e.Command.Parameters["@ORIGPLAN_CODE"].Value = item.GetDataKeyValue("PLAN_CODE").ToString();
                    e.Command.Parameters["@ORIGPRODUCT_CODE"].Value = item.GetDataKeyValue("PRODUCT_CODE").ToString();
                    e.Command.Parameters["@ORIGPLAN_LEVEL"].Value = item.GetDataKeyValue("PLAN_LEVEL").ToString();
                    e.Command.Parameters["@ORIGSTATE_CODE"].Value = item.GetDataKeyValue("STATE_CODE").ToString();
                    e.Command.Parameters["@ORIGEFFECTIVE_DATE"].Value = item.GetDataKeyValue("EFFECTIVE_DATE").ToString();
                    e.Command.Parameters["@COMPANY"].Value = ((RadComboBox)item.FindControl("COMPANY")).SelectedValue.ToString();
                    e.Command.Parameters["@PLAN_CODE"].Value = ((RadTextBox)item.FindControl("PLAN_CODE")).Text.ToString();
                    e.Command.Parameters["@PRODUCT_CODE"].Value = ((RadTextBox)item.FindControl("PRODUCT_CODE")).Text.ToString();
                    e.Command.Parameters["@PLAN_LEVEL"].Value = ((RadTextBox)item.FindControl("PLAN_LEVEL")).Text.ToString();
                    e.Command.Parameters["@STATE_CODE"].Value = ((RadComboBox)item.FindControl("STATE_CODE")).SelectedValue.ToString();
                    e.Command.Parameters["@EFFECTIVE_DATE"].Value = ((RadDatePicker)item.EditFormItem.FindControl("EFFECTIVE_DATE")).SelectedDate.ToString();
                    e.Command.Parameters["@TERMINATION_DATE"].Value = ((RadDatePicker)item.FindControl("TERMINATION_DATE")).SelectedDate.ToString();
                    e.Command.Parameters["@PLAN_TYPE"].Value = ((RadComboBox)item.FindControl("PLAN_TYPE")).SelectedValue.ToString();
                    e.Command.Parameters["@COVERAGE_TYPE"].Value = ((RadTextBox)item.FindControl("COVERAGE_TYPE")).Text.ToString();
                    e.Command.Parameters["@COVERAGE_CODE"].Value = ((RadTextBox)item.FindControl("COVERAGE_CODE")).Text.ToString();
                    e.Command.Parameters["@LINE_OF_BUSINESS"].Value = ((RadTextBox)item.FindControl("LINE_OF_BUSINESS")).Text.ToString();
                    e.Command.Parameters["@SPECIFIC_FORM"].Value = ((RadTextBox)item.FindControl("SPECIFIC_FORM")).Text.ToString();
                    e.Command.Parameters["@PLAN_CODE_DESCR"].Value = ((RadTextBox)item.FindControl("PLAN_CODE_DESCR")).Text.ToString();
                    e.Command.Parameters["@GENERIC_FORM_DESCR"].Value = ((RadTextBox)item.FindControl("GENERIC_FORM_DESCR")).Text.ToString();
                    e.Command.Parameters["@SCHEDULE_PAGE_DESCR"].Value = ((RadTextBox)item.FindControl("SCHEDULE_PAGE_DESCR")).Text.ToString();
                    e.Command.Parameters["@PLAN_CODE_ABRV_DESCR"].Value = ((RadTextBox)item.FindControl("PLAN_CODE_ABRV_DESCR")).Text.ToString();
                    if (((RadButton)item.FindControl("ENDORSEMENT_EXIST")).Checked)
                        e.Command.Parameters["@ENDORSEMENT_EXIST"].Value = "Y";
                    else
                        e.Command.Parameters["@ENDORSEMENT_EXIST"].Value = "N";
 
                    if (((RadButton)item.FindControl("SOLD_RES_STATE_ONLY")).Checked)
                        e.Command.Parameters["@SOLD_RES_STATE_ONLY"].Value = "Y";
                    else
                        e.Command.Parameters["@SOLD_RES_STATE_ONLY"].Value = "N";
 
                    if (((RadButton)item.FindControl("PRINT_SURR_COST_IDX")).Checked)
                        e.Command.Parameters["@PRINT_SURR_COST_IDX"].Value = "Y";
                    else
                        e.Command.Parameters["@PRINT_SURR_COST_IDX"].Value = "N";
 
                    if (((RadButton)item.FindControl("EXT_BENF_STATE_SPEC")).Checked)
                        e.Command.Parameters["@EXT_BENF_STATE_SPEC"].Value = "Y";
                    else
                        e.Command.Parameters["@EXT_BENF_STATE_SPEC"].Value = "N";
 
                    if (((RadButton)item.FindControl("PRINT_POLICY_FEE")).Checked)
                        e.Command.Parameters["@PRINT_POLICY_FEE"].Value = "Y";
                    else
                        e.Command.Parameters["@PRINT_POLICY_FEE"].Value = "N";
 
                    if (((RadButton)item.FindControl("REQUIRED_PLAN")).Checked)
                        e.Command.Parameters["@REQUIRED_PLAN"].Value = "Y";
                    else
                        e.Command.Parameters["@REQUIRED_PLAN"].Value = "N";
 
                    e.Command.Parameters["@NTA_PLAN_CODE"].Value = ((RadTextBox)item.FindControl("NTA_PLAN_CODE")).Text.ToString();
                    e.Command.Parameters["@NTA_GENERIC_FORM"].Value = ((RadTextBox)item.FindControl("NTA_GENERIC_FORM")).Text.ToString();
                    e.Command.Parameters["@NTA_SUB_FORM"].Value = ((RadTextBox)item.FindControl("NTA_SUB_FORM")).Text.ToString();
                    e.Command.Parameters["@RECORD_STATUS"].Value = ((RadTextBox)item.FindControl("RECORD_STATUS")).Text.ToString();
                    e.Command.Parameters["@OPERATOR_ID"].Value = ((RadTextBox)item.FindControl("OPERATOR_ID")).Text.ToString();
                }
            }
             
        }
 
        private Control FindControlRecursive(Control root,string Id)
        {
            if (root.ID == Id)
                return root;
 
            foreach (Control Ctrl in root.Controls)
            {
                Control FoundCtl = FindControlRecursive(Ctrl,Id);
 
                if ( FoundCtl !=null)
                    return FoundCtl;
            }
            return null;
        }
    }
}

Steve
Top achievements
Rank 1
 answered on 22 Aug 2014
17 answers
1.3K+ views

I'm having trouble getting the popup window to look like what I want it to. First of all, the content is bleeding outside the window (I'm using a fixed height for the window and Scrollbars="Auto"). I'd like some control over the way the caption/header looks, as well as over the content/body. There are properties of an edit form for FormCaptionStyle, FormStyle, FormMainTableStyle, etc., but these don't appear to apply to the PopupForm.

I checked into this post, but unless I'm using an older version of the control, there is no <FormTemplate> beneath <PopUpSettings>. I'm using 2008_2_286.

Lastly, I can't seem to get any CssClass property to override the default settings.

Here's a simplified version of what my code currently looks like. Does anyone have any suggestions on how to style up the popup a bit more?

<EditFormSettings  CaptionDataField="ID" EditFormType="webUserControl" UserControlName="myControl.ascx">
  <FormCaptionStyle Font-Bold="true" HorizontalAlign="right" />
  <PopUpSettings ScrollBars="Auto" Modal="true" Width="650" Height="500" />
</EditFormSettings>
Eyup
Telerik team
 answered on 22 Aug 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?