Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
449 views
Hello... I'm migrating over from a Winforms JanusGrid to an ASP RadGrid.... so I'm struggling a bit with syntax and methodology. 

I've got a large collection of base classes instantiated by an ASP page... all of my radgrids are 'server side'.

Basically, the user does what they are going to do with the radgrids (selects rows, etc), then hits a submit button.

The entire RadGrid is passed by reference into the corresponding base class so that the functions can iterate through the entire RadGrid, pull out the necessary data from the cells in selected rows (or the entire grid), and then perform whatever logic is necessary.

I see posted examples on how to intercept specific rows as part of the ItemBound method... but I don't see anything that just takes an entire ByRef RadGrid... iterates through the entire items collection (or selecteditems collection), reads in data from specific cells, and then continues.  

Ive got something like this:

 For Each Row As DataGridItem In lstEmployees.SelectedItems
    ClockInEmployee(Row("_ID").text)
 Next

But the syntax isn't correct... 

Can someone point me in the right direction?


Jay
Jay
Top achievements
Rank 1
 answered on 04 Jun 2013
2 answers
117 views
I currently have a 3 level hierarchical grid that for the most part works fine. However, when I try to add a second GridRelationField between my 2nd and 3rd levels, I get the following error:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Syntax error in the expression.

The front-side code (starting from the 2nd level) is below. I've bolded the GridRelationField that's giving the error. If I take that out and just have the MasterLogID as a GridRelationField, that works fine. The grid itself is bound to a dataset that has three datatables, one for each level of the hierarchy. Is there something that I'm missing in the Telerik code or the dataset that's causing this?

<telerik:GridTableView DataKeyNames="MasterLogID" DataMember="LogMaster" Width="100%" AutoGenerateColumns="false" runat="server" PagerStyle-Visible="false">
<ParentTableRelation>
<telerik:GridRelationFields MasterKeyField="MasterLogID" DetailKeyField="MasterLogID" />
</ParentTableRelation>
<DetailTables>
<telerik:GridTableView DataKeyNames="MasterLogID" DataMember="LogDetails" Width="100%" AutoGenerateColumns="false" runat="server" PagerStyle-Visible="false">
<ParentTableRelation>
<telerik:GridRelationFields MasterKeyField="MasterLogID" DetailKeyField="MasterLogID" />
<telerik:GridRelationFields MasterKeyField="ProcessType" DetailKeyField="ProcessType" />
</ParentTableRelation>
<Columns>
<telerik:GridBoundColumn Visible="false" DataField="MasterLogID" UniqueName="LDMasterLogID"></telerik:GridBoundColumn>
<telerik:GridBoundColumn Visible="true" DataField="ProcessType" UniqueName="LDProcessType"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Source" DataField="ProcessSource" UniqueName="LDProcessSource" SortExpression="ProcessSource"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Success" DataField="IsProcessSuccess" UniqueName="LDIsProcessSuccess" SortExpression="IsProcessSuccess"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Reference" DataField="ProcessReference" UniqueName="LDProcessReference" SortExpression="ProcessReference"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Description" DataField="ProcessDesc" UniqueName="LDProcessDesc" SortExpression="ProcessDesc"></telerik:GridBoundColumn>
</Columns>
</telerik:GridTableView>
</DetailTables>
<Columns>
<telerik:GridBoundColumn Visible="false" DataField="MasterLogID" UniqueName="LMMasterLogID"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Type" DataField="ProcessType" UniqueName="LMProcessType" SortExpression="ProcessType"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Process" DataField="ProcessName" UniqueName="LMProcessName" SortExpression="ProcessName"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Date" DataField="ProcessDate" UniqueName="LMProcessDate" SortExpression="ProcessDate" DataFormatString="{0:G}"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Status" DataField="ProcessStatus" UniqueName="LMProcessStatus" SortExpression="ProcessStatus"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Reference" DataField="ProcessReference" UniqueName="LMProcessReference" SortExpression="ProcessReference"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Description" DataField="ProcessDesc" UniqueName="LMProcessDesc" SortExpression="ProcessDesc"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Records" DataField="ProcessRecords" UniqueName="LMProcessRecords" SortExpression="ProcessRecords"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Success" DataField="ProcessSuccess" UniqueName="LMProcessSuccess" SortExpression="ProcessSuccess"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Failed" DataField="ProcessFailed" UniqueName="LMProcessFailed" SortExpression="ProcessFailed"></telerik:GridBoundColumn>
</Columns>
</telerik:GridTableView>
Ben
Top achievements
Rank 1
 answered on 03 Jun 2013
1 answer
121 views
Help! I can successfully open, close and rebind the Grid after the RadWindow is opened and closed but the group by expressions do not appear until I refresh the page.

How do I get the rebind to include the grid group by fields? The online demos don't mention it and I can't find any solutions...

Thanks.

JavaScript...
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function ShowInsertForm() {
            window.radopen("newrp.aspx", "RW_RP");
            return false;
        }
 
        function refreshGrid(arg) {
            if (!arg) {
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
            }
 
            else {
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
            }
        }
 
        function RowDblClick(sender, eventArgs) {
            window.radopen("newrp.aspx?nbid=" + eventArgs.getDataKeyValue("nbid") + "&cocc=" + eventArgs.getDataKeyValue("cocc") + "&tm=" + eventArgs.getDataKeyValue("teammate") + "&dot7=" + eventArgs.getDataKeyValue("dot7"), "RW_RP");
        }
    </script>
</telerik:RadCodeBlock>

ASPX...
<telerik:RadGrid ID="RG_RP" runat="server" CellSpacing="0" GridLines="None" style="margin:10px">
    <MasterTableView AutoGenerateColumns="False" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" AlternatingItemStyle-HorizontalAlign="Center" CommandItemDisplay="Top" ClientDataKeyNames="nbid, cocc, teammate, dot7">
        <GroupByExpressions>
            <telerik:GridGroupByExpression>
                <SelectFields>
                    <telerik:GridGroupByField FieldName="Teammate" FieldAlias="Teammate" HeaderValueSeparator=": " />
                </SelectFields>
                <GroupByFields>
                    <telerik:GridGroupByField FieldName="Teammate" FieldAlias="Teammate" SortOrder="Ascending" />
                </GroupByFields>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
        <Columns>
... SOME COLUMNS ...
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
        </EditFormSettings>
        <CommandItemSettings ExportToPdfText="Export to PDF" AddNewRecordText="Add new preferences"></CommandItemSettings>
        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
        <CommandItemTemplate>
            <div style="padding:5px 0px 5px 10px">Double click a row to add a preference for that Teammate</div>
        </CommandItemTemplate>
    </MasterTableView>
    <ClientSettings>
        <ClientEvents OnRowDblClick="RowDblClick" />
    </ClientSettings>
    <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
    <FilterMenu EnableImageSprites="False"></FilterMenu>
</telerik:RadGrid>



Matt
Top achievements
Rank 1
 answered on 03 Jun 2013
4 answers
382 views
I am having difficulty getting the group by Footer Text to have say Subtotal for the groups and then an actual total for everything
I have tried implementing suggestions listed in other forums but none of them seem to work. Any help would be greatly appreciated. 
Example what I am trying for is 

Type: Type 1 - Water Quality
        Data $5
Data $6
Data $4
--Footer Type 1 - Water Quality total sites: 3     $15
Type: Type 2 - Research
        Data $10
Data $20
Data $20
--Footer Type 2 - Research total Sites sites: 3     $50
Total sites: 6  $65





FRONT END
<
telerik:RadGrid ID="rgSite" runat="server" AllowSorting="True"  Skin="Silk" OnNeedDataSource="rgSite_NeedDataSource" EnableLinqExpressions="false" OnPreRender="rgSite_PreRender"
                    AutoGenerateColumns="False" AlternatingItemStyle-BackColor="White"  Width="1298px" OnUpdateCommand="rgSite_UpdateCommand" OnInsertCommand="rgSite_InsertCommand">
    <MasterTableView CommandItemDisplay="Top" ShowFooter="true" ShowGroupFooter="true"
                        DataKeyNames="details_site_id">
    <EditFormSettings PopUpSettings-Modal="false" UserControlName="controls/FundedSites.ascx"
                        EditFormType="WebUserControl"/>
    <CommandItemSettings ShowRefreshButton="false" ShowAddNewRecordButton="false"  addnewrecordtext="Add a Site"/>
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" Visible="false" UniqueName="Edit"/>
            <telerik:GridBoundColumn DataField="site_no" SortExpression="site_no" AllowSorting="true"
                                        UniqueName="site_no" visible="false"/>
            <telerik:GridTemplateColumn DataField="site_no_nm" SortExpression="site_no_nm"
                                        UniqueName="site_no_nm" HeaderText="Site Number"
                                        ItemStyle-BorderStyle="Solid" ItemStyle-Bordercolor="Silver" ItemStyle-BorderWidth="0.25"
                                        Aggregate="CountDistinct" FooterText="Total Funded Sites: ">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server"
                        NavigateUrl='<%# string.Format("site.aspx?org_cd={0}&cust_id={1}&agmt_id={2}&site_no={3}",org_cd,cust_id,agmt_id,ProcessMyDataItem(Eval("site_no")))  %>'
                        Text='<%# ProcessMyDataItem(Eval("site_no_nm")) %>'/>
                    <asp:HiddenField runat="server" ID="hfCollectionUnits" Visible="false" Value='<%# ProcessMyDataItem(Eval("data_collection")) %>'/>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="collection_cd" SortExpression="collection_cd"
                UniqueName="collection_cd" HeaderText="Code"
                ItemStyle-BorderStyle="Solid" ItemStyle-Bordercolor="Silver" ItemStyle-BorderWidth="0.25">
                <ItemTemplate>
                    <a title='<%# ProcessMyDataItem(Eval("collection_desc")) %>' style="color:Black;text-decoration:none;">
                        <%# ProcessMyDataItem(Eval("collection_cd"))%>
                    </a>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="collection_units" SortExpression="collection_units" AllowSorting="true"
                UniqueName="collection_units" HeaderText="Units"
                ItemStyle-BorderStyle="Solid" ItemStyle-Bordercolor="Silver" ItemStyle-BorderWidth="0.25"
                ColumnEditorID="ceUnit"/>
            <telerik:GridBoundColumn DataField="diff_factor" SortExpression="diff_factor" AllowSorting="true"
                UniqueName="diff_factor" HeaderText="Diff. Factor"
                ItemStyle-BorderStyle="Solid" ItemStyle-Bordercolor="Silver" ItemStyle-BorderWidth="0.25"
                ColumnEditorID="ceUnit"/>
            <%--<telerik:GridBoundColumn DataField="data_collection" SortExpression="data_collection"
                UniqueName="data_collection" HeaderText="Data Collection" Visible="false"
                ItemStyle-BorderStyle="Solid" ItemStyle-Bordercolor="Silver" ItemStyle-BorderWidth="0.25" />--%>
            <telerik:GridNumericColumn DataField="funding_usgs_cwp" SortExpression="funding_usgs_cwp" AllowSorting="true"
                UniqueName="funding_usgs_cwp" HeaderText="USGS CWP" DataFormatString="{0:c0}" DataType="System.Decimal"
                ItemStyle-BorderStyle="Solid" ItemStyle-Bordercolor="Silver" ItemStyle-BorderWidth="0.25"
                Aggregate="Sum" FooterAggregateFormatString="{0:c0}"
                ColumnEditorID="ceFunds"/>
            <telerik:GridNumericColumn DataField="funding_customer" SortExpression="funding_customer" AllowSorting="true"
                UniqueName="funding_customer" HeaderText="Customer" DataFormatString="{0:c0}" DataType="System.Decimal"
                ItemStyle-BorderStyle="Solid" ItemStyle-Bordercolor="Silver" ItemStyle-BorderWidth="0.25"
                Aggregate="Sum" FooterAggregateFormatString="{0:c0}"
                ColumnEditorID="ceFunds"/>
            <telerik:GridBoundColumn DataField="funding_total" SortExpression="funding_total" AllowSorting="true"
                UniqueName="total" HeaderText="Total" DataFormatString="{0:c0}" DataType="System.Decimal"
                ItemStyle-BorderStyle="Solid" ItemStyle-Bordercolor="Silver" ItemStyle-BorderWidth="0.25"
                Aggregate="Sum" FooterAggregateFormatString="{0:c0}" ReadOnly="true"/>
 
            <telerik:GridBoundColumn DataField="remarks" SortExpression="remarks" AllowSorting="true"
                UniqueName="remarks" HeaderText="Remarks"
                ItemStyle-BorderStyle="Solid" ItemStyle-Bordercolor="Silver" ItemStyle-BorderWidth="0.25" />
            <telerik:GridButtonColumn ConfirmText="Delete this record?" ConfirmDialogType="RadWindow"
                confirmtitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                uniquename="Delete" Visible="false"/>
        </Columns>
        <GroupByExpressions>
            <telerik:GridGroupByExpression>
                <SelectFields>
                    <telerik:GridGroupByField FieldName="data_collection" FieldAlias="Task"/>
                </SelectFields>
                <GroupByFields>
                    <telerik:GridGroupByField FieldName="data_collection" />
                </GroupByFields>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
        <ExpandCollapseColumn>

        <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
    </MasterTableView>
</telerik:RadGrid>

CODE BEHIND
protected void rgSite_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
    var fundingdb = new fundingdbDataContext();
    rgSite.DataSource = fundingdb.SP_Funding_Agreement_Sites_Details(Convert.ToInt32(agmt_id),Convert.ToInt32(cust_id)).ToList();
}
//Removes Repeating values
protected void rgSite_PreRender(object sender, EventArgs e)
{
    //The Row Index is the Row above the bottom row, walk up the Grid
    for (int rowIndex = rgSite.Items.Count - 2; rowIndex >= 0; rowIndex += -1)
    {
        //The Current Row is the row index
        GridDataItem row = rgSite.Items[rowIndex];
        //The Previous Row is one below it
        GridDataItem previousRow = rgSite.Items[rowIndex + 1];
        //Grab the ItemTemplate Text values from the Hyperlink of the current and previous row and compare them.
        if ((row["site_no"].FindControl("HyperLink1") as HyperLink).Text == (previousRow["site_no"].FindControl("HyperLink1") as HyperLink).Text && (row["site_no"].FindControl("hfCollectionUnits") as HiddenField).Value == (previousRow["site_no"].FindControl("hfCollectionUnits") as HiddenField).Value)
        {
            //If they are the same set the previous rows Text to blank
            previousRow["site_no_nm"].Text = "";
        }
    }
}

Justin
Top achievements
Rank 1
 answered on 03 Jun 2013
1 answer
226 views
In a ASP.NET web application, I've got a page that opens a new window when a user clicks certain hyperlinks.  A normal window.open, not a RadWindow or the like.  The page that's opened doesn't have a master page, but consists of a RadTabStrip and a RadMultiPage control.

     The individual PageViews in the MultiPage control display some RadPanelBars and user controls that contain a variety of inputs, mostly text boxes and comboboxes.  When the page loads, I get the following errors and the combo boxes do not function

  1. Uncaught Sys.InvalidOperationException: Sys.InvalidOperationException: Type Telerik.Web.UI.Orientation has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update. ScriptResource.axd:222
    1. Error$invalidOperationScriptResource.axd:372
    2. Type$registerEnumScriptResource.axd:2315
    3. (anonymous function)ScriptResource.axd:743
  1. Uncaught Sys.InvalidOperationException: Sys.InvalidOperationException: Type Telerik.Web.UI.TouchScrollExtender has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update. ScriptResource.axd:222
    1. Error$invalidOperationScriptResource.axd:372
    2. Type$registerClassScriptResource.axd:1717
    3. (anonymous function)ScriptResource.axd:168
    4. (anonymous function)ScriptResource.axd:169
  1. Uncaught Sys.InvalidOperationException: Sys.InvalidOperationException: Type Telerik.Web.UI.NavigationControlODataSettings has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update. ScriptResource.axd:222
    1. Error$invalidOperationScriptResource.axd:372
    2. Type$registerClassScriptResource.axd:1717
    3. (anonymous function)ScriptResource.axd:15
    4. (anonymous function)ScriptResource.axd:78
  1. Uncaught Sys.InvalidOperationException: Sys.InvalidOperationException: Type Telerik.Web.UI.AttributeCollection has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update. ScriptResource.axd:222
    1. Error$invalidOperationScriptResource.axd:372
    2. Type$registerClassScriptResource.axd:1717
    3. (anonymous function)ScriptResource.axd:21
  1. Uncaught Sys.InvalidOperationException: Sys.InvalidOperationException: Type Telerik.Web.UI.RadComboBoxItem has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update. ScriptResource.axd:222
    1. Error$invalidOperationScriptResource.axd:372
    2. Type$registerClassScriptResource.axd:1717
    3. (anonymous function)ScriptResource.axd:220
    4. (anonymous function)




There is an ASP ScriptManager on the page.  If I change this to a RadScriptManager, my error becomes:

  1. Uncaught TypeError: Object [object Object] has no method '_setChildrenHeight' Telerik.Web.UI.WebResource.axd:4015
    1. Telerik.Web.UI.RadPanelItem._windowLoadHandlerTelerik.Web.UI.WebResource.axd:4015
    2. Telerik.Web.UI.RadPanelItem._windowLoadHandlerSavingStateTelerik.Web.UI.WebResource.axd:4011
    3. Sys._Application.raiseLoadTelerik.Web.UI.WebResource.axd:6
    4. Sys._Application._doInitializeTelerik.Web.UI.WebResource.axd:6



I've re-created the page from scratch, taking out as much complexity as I can, but still run into these issues.  I must be missing something that I cannot find. 


  1. Uncaught Sys.InvalidOperationException: Sys.InvalidOperationException: Type Telerik.Web.UI.Orientation has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update. ScriptResource.axd:222
  1. Uncaught Sys.InvalidOperationException: Sys.InvalidOperationException: Type Telerik.Web.UI.TouchScrollExtender has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update. ScriptResource.axd:222
  1. Uncaught Sys.InvalidOperationException: Sys.InvalidOperationException: Type Telerik.Web.UI.NavigationControlODataSettings has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update. ScriptResource.axd:222
  1. Uncaught Sys.InvalidOperationException: Sys.InvalidOperationException: Type Telerik.Web.UI.AttributeCollection has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update. ScriptResource.axd:222
  1. Uncaught Sys.InvalidOperationException: Sys.InvalidOperationException: Type Telerik.Web.UI.RadComboBoxItem has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.


EDIT:  I'm running version 2012.1.215.35
msigman
Top achievements
Rank 2
 answered on 03 Jun 2013
5 answers
343 views
I am attempting to put a radgrid that I can edit on a page that contains other other controls (textbox, dropdowns, etc.)
I can get the grid to show but when I click on the edit icon it simply comes back to the same page.
Any help would be appreciated.

The code for the grid is below.
   <!-- RAD Routing GRID -->
        <asp:UpdatePanel ID="upGrid" runat="server">
            <ContentTemplate>
                <table border="0" cellpadding="5" width="100%">
                    <tr>
                        <td valign="top" >
                           <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
                                <script type="text/javascript">
                                    function RowDblClick(sender, eventArgs) {
                                        sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
                                    }
 
                                    function gridCreated(sender, args) {
                                        if (sender.get_editIndexes && sender.get_editIndexes().length > 0) {
                                            document.getElementById("OutPut").innerHTML = sender.get_editIndexes().join();
                                        }
                                        else {
                                            document.getElementById("OutPut").innerHTML = "";
                                        }
                                    }
                                </script>
                            </telerik:RadCodeBlock>
                            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                                <AjaxSettings>
                                    <telerik:AjaxSetting AjaxControlID="gvEdit">
                                        <UpdatedControls>
                                            <telerik:AjaxUpdatedControl ControlID="gvEdit" LoadingPanelID="pnlLoad">
                                            </telerik:AjaxUpdatedControl>
                                            <telerik:AjaxUpdatedControl ControlID="winManager"></telerik:AjaxUpdatedControl>
                                        </UpdatedControls>
                                    </telerik:AjaxSetting>
                                </AjaxSettings>
                            </telerik:RadAjaxManager>
                            <telerik:RadAjaxLoadingPanel ID="pnlLoad" runat="server"></telerik:RadAjaxLoadingPanel>
                            <telerik:RadGrid ID="gvEdit" GridLines="None" runat="server" Skin="WebBlue"   AllowAutomaticDeletes="True"
                                AllowAutomaticInserts="True" PageSize="10" AllowAutomaticUpdates="True" AllowPaging="True"
                                AutoGenerateColumns="False" DataSourceID="sdsEditGrid" OnItemUpdated="gvEdit_ItemUpdated"
                                OnItemDeleted="gvEdit_ItemDeleted" OnItemInserted="gvEdit_ItemInserted" OnItemCreated="gvEdit_ItemCreated"
                                OnItemCommand="gvEdit_ItemCommand" OnDataBound="gvEdit_DataBound">
                                <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
                                <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataKeyNames="RoutingID"
                                    DataSourceID="sdsEditGrid" HorizontalAlign="NotSet" AutoGenerateColumns="False">
                                    <Columns>
                                        <%-- Edit Image--%>
                                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                                            <ItemStyle CssClass="MyImageButton"></ItemStyle>
                                        </telerik:GridEditCommandColumn>
 
                                        <%--Name DropDown--%>
                                        <telerik:GridBoundColumn DataField="Name" HeaderText="Name"
                                            SortExpression="Name" UniqueName="Name" Visible="true"
                                            EditFormColumnIndex="0" ColumnEditorID="GridTextBoxColumnEditor1" MaxLength="50">
                                        </telerik:GridBoundColumn>
 
                                         <%--RoutingID TextBox--%>
                                        <telerik:GridBoundColumn DataField="RoutingID" HeaderText="RoutingID"
                                            SortExpression="RID" UniqueName="RID" Visible="true"
                                            EditFormColumnIndex="0" ColumnEditorID="GridTextBoxColumnEditor0" MaxLength="50">
                                        </telerik:GridBoundColumn>
 
                                         <%--Department DropDown--%>
                                        <telerik:GridBoundColumn DataField="Department_Code" HeaderText="Department"
                                            SortExpression="Department" UniqueName="Department" Visible="true"
                                            EditFormColumnIndex="1" ColumnEditorID="GridTextBoxColumnEditor2" MaxLength="50"  >
                                        </telerik:GridBoundColumn>
 
                                         <%--Date Sent TextBox--%>
                                       <%-- <telerik:GridBoundColumn DataField="DateSent" HeaderText="Date Sent"
                                            SortExpression="DateSent" UniqueName="DateSent" Visible="true"
                                            EditFormColumnIndex="2" ColumnEditorID="GridTextBoxColumnEditor3" MaxLength="50">
                                        </telerik:GridBoundColumn>--%>
 
                                         <%--Date Returned TextBox--%>
                                       <%-- <telerik:GridBoundColumn DataField="DateReturned" HeaderText="Date Returned"
                                            SortExpression="DateReturned" UniqueName="DateReturned" Visible="true"
                                            EditFormColumnIndex="3" ColumnEditorID="GridTextBoxColumnEditor4" MaxLength="50">
 
                                        </telerik:GridBoundColumn>--%>
                                          <%--Inactive checkbox--%>
                                       <%-- <telerik:GridCheckBoxColumn DataField="InActive" HeaderText="InActive" SortExpression="InActive"
                                            UniqueName="InActive" EditFormColumnIndex="0" >
                                        </telerik:GridCheckBoxColumn>--%>
                                          <%--Delete --%>
                                        <telerik:GridButtonColumn ConfirmText="Delete this Routing Record?" ConfirmDialogType="RadWindow"
                                            ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                                            UniqueName="DeleteColumn">
                                            <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle>
                                        </telerik:GridButtonColumn>
                                    </Columns>
 
                                    <EditFormSettings  ColumnNumber="1" CaptionDataField="RoutingID" CaptionFormatString="Edit Routing Record: {0}"
                                        InsertCaption="New Routing Record" FormCaptionStyle-Font-Bold="true" FormMainTableStyle-BackColor="lightgrey" >
                                        <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                                        <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                                        <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" Width="100%"></FormMainTableStyle>
                                        <FormTableStyle CellSpacing="0" CellPadding="2" Height="40px"></FormTableStyle>
                                        <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                                        <EditColumn ButtonType="ImageButton" InsertText="Insert Routing Record" UpdateText="Update record"
                                            UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                                        </EditColumn>
                                        <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                                    </EditFormSettings>
 
                                </MasterTableView>
 
                                <ClientSettings>
                                    <ClientEvents OnRowDblClick="RowDblClick" OnGridCreated="gridCreated"></ClientEvents>
                                </ClientSettings>
                                </telerik:RadGrid>
                                <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server" TextBoxStyle-Width="100px"/>
                                <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor2" runat="server" TextBoxStyle-Width="350px"/>
 
                            <br />
                          
                            <asp:SqlDataSource 
                             ID="sdsEditGrid" 
                             runat="server"
                             SelectCommand ="usp_Get_Routing_ForBulletin"
                             InsertCommand="dbsp_addCompany"
                             UpdateCommand="dbsp_updateCompanies"
                             DeleteCommand="dbsp_deleteCompany"
                             SelectCommandType="StoredProcedure"
                             InsertCommandType="StoredProcedure"
                             UpdateCommandType="StoredProcedure"
                             DeleteCommandType="StoredProcedure" >
 
                             <SelectParameters>
                                <asp:Parameter Name="BulletinNumber" Type="Int32"  />
                             </Selectparameters>   
 
                            <InsertParameters>
                            
                            </InsertParameters>
 
                            <UpdateParameters>
                                <asp:Parameter Name="RoutingID" Type="Int32"  />
                            </UpdateParameters>
 
                            <DeleteParameters>
                                <asp:Parameter Name="RoutingID" Type="Int32"  />
                            </DeleteParameters>
 
                        </asp:SqlDataSource
                       </td>
                    </tr>
                </td>
        </table>
     </td>
  </tr>
</table>
            </ContentTemplate>
        </asp:UpdatePanel>
 

Code from .cs file pertaining to radgrid edit

 

protected void gvEdit_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)

{

 

if (e.Item is GridEditableItem && e.Item.IsInEditMode)

{

 

GridEditableItem item1 = e.Item as GridEditableItem;

 

GridTextBoxColumnEditor editor1 = (GridTextBoxColumnEditor)item1.EditManager.GetColumnEditor("Name");

 

TableCell cell1 = (TableCell)editor1.TextBoxControl.Parent;

 

RequiredFieldValidator validator1 = new RequiredFieldValidator();

editor1.TextBoxControl.ID =

 

"Namex";

validator1.ControlToValidate = editor1.TextBoxControl.ID;

validator1.ErrorMessage =

 

"Name required";

cell1.Controls.Add(validator1);

 

GridEditableItem item2 = e.Item as GridEditableItem;

 

GridTextBoxColumnEditor editor2 = (GridTextBoxColumnEditor)item2.EditManager.GetColumnEditor("Department");

 

TableCell cell2 = (TableCell)editor2.TextBoxControl.Parent;

 

RequiredFieldValidator validator2 = new RequiredFieldValidator();

editor2.TextBoxControl.ID =

 

"Name_for_validation";

validator2.ControlToValidate = editor2.TextBoxControl.ID;

validator2.ErrorMessage =

 

"Department required";

cell2.Controls.Add(validator2);

}

}

 

protected void gvEdit_ItemUpdated(object source, GridUpdatedEventArgs e)

{

 

if (e.Exception != null)

{

e.KeepInEditMode =

 

true;

e.ExceptionHandled =

 

true;

SetMessage(

 

"Routing record not updated. Reason: " + e.Exception.Message);

}

 

else

{

gvEdit.Rebind();

SetMessage(

 

"Routing record updated!");

}

}

 

protected void gvEdit_ItemDeleted(object source, GridDeletedEventArgs e)

{

 

if (e.Exception != null)

{

e.ExceptionHandled =

 

true;

 

String x = "Routing Record cannot be deleted. Reason: " + e.Exception.Message;

DisplayMessage(x);

}

 

else

{

gvEdit.Rebind();

SetMessage(

 

"Company is deleted!");

}

}

 

protected void gvEdit_ItemInserted(object source, GridInsertedEventArgs e)

{

 

if (e.Exception != null)

{

e.KeepInInsertMode =

 

true;

e.ExceptionHandled =

 

true;

 

String x = "Routing Record cannto be inserted. Reason: " + e.Exception.Message;

DisplayMessage(x);

}

 

else

{

SetMessage(

 

"New Routing Record is inserted!");

gvEdit.Rebind();

}

}

 

protected void gvEdit_ItemCommand(object source, GridCommandEventArgs e)

{

 

if (e.CommandName == RadGrid.EditCommandName)

{

gvEdit.MasterTableView.IsItemInserted =

 

false;

}

 

if (e.CommandName == RadGrid.InitInsertCommandName)

{

gvEdit.MasterTableView.ClearEditItems();

}

}

 

protected void gvEdit_DataBound(object sender, EventArgs e)

{

 

if (!string.IsNullOrEmpty(gridMessage))

{

DisplayMessage(gridMessage);

}

}

Some of the code from the .cs file pertaining to the radgrid edit

protected void gvEdit_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
   {
       if (e.Item is GridEditableItem && e.Item.IsInEditMode)
       {
           GridEditableItem item1 = e.Item as GridEditableItem;
           GridTextBoxColumnEditor editor1 = (GridTextBoxColumnEditor)item1.EditManager.GetColumnEditor("Name");
           TableCell cell1 = (TableCell)editor1.TextBoxControl.Parent;
           RequiredFieldValidator validator1 = new RequiredFieldValidator();
           editor1.TextBoxControl.ID = "Namex";
           validator1.ControlToValidate = editor1.TextBoxControl.ID;
           validator1.ErrorMessage = "Name required";
           cell1.Controls.Add(validator1);
 
           GridEditableItem item2 = e.Item as GridEditableItem;
           GridTextBoxColumnEditor editor2 = (GridTextBoxColumnEditor)item2.EditManager.GetColumnEditor("Department");
           TableCell cell2 = (TableCell)editor2.TextBoxControl.Parent;
           RequiredFieldValidator validator2 = new RequiredFieldValidator();
           editor2.TextBoxControl.ID = "Name_for_validation";
           validator2.ControlToValidate = editor2.TextBoxControl.ID;
           validator2.ErrorMessage = "Department required";
           cell2.Controls.Add(validator2);
       }
   }
   protected void gvEdit_ItemUpdated(object source, GridUpdatedEventArgs e)
   {
       if (e.Exception != null)
       {
           e.KeepInEditMode = true;
           e.ExceptionHandled = true;
           SetMessage("Routing record  not updated. Reason: " + e.Exception.Message);
       }
       else
       {
           gvEdit.Rebind();
           SetMessage("Routing record updated!");
 
       }
   }
   protected void gvEdit_ItemDeleted(object source, GridDeletedEventArgs e)
   {
       if (e.Exception != null)
       {
           e.ExceptionHandled = true;
           String x = "Routing Record cannot be deleted. Reason: " + e.Exception.Message;
           DisplayMessage(x);
       }
       else
       {
           gvEdit.Rebind();
           SetMessage("Company is deleted!");
       }
   }
   protected void gvEdit_ItemInserted(object source, GridInsertedEventArgs e)
   {
       if (e.Exception != null)
       {
           e.KeepInInsertMode = true;
           e.ExceptionHandled = true;
           String x = "Routing Record cannto be inserted. Reason: " + e.Exception.Message;
           DisplayMessage(x);
       }
       else
       {
           SetMessage("New Routing Record is inserted!");
           gvEdit.Rebind();
       }
   }
   protected void gvEdit_ItemCommand(object source, GridCommandEventArgs e)
   {
       if (e.CommandName == RadGrid.EditCommandName)
       {
           gvEdit.MasterTableView.IsItemInserted = false;
       }
 
       if (e.CommandName == RadGrid.InitInsertCommandName)
       {
           gvEdit.MasterTableView.ClearEditItems();
       }
   }
   protected void gvEdit_DataBound(object sender, EventArgs e)
   {
       if (!string.IsNullOrEmpty(gridMessage))
       {
           DisplayMessage(gridMessage);
       }
   }
Elliott
Top achievements
Rank 2
 answered on 03 Jun 2013
1 answer
81 views
hi,

I am using Spellcheck control in my aspx page..which is working fine in IE browser

but When am accesing my aspx page from Google Chrome it is displaying a Message in SpellChecker control as "SpellCheck in Progress......"
check my screen shot in attatchment

but nothing is spellchecking and buttons on spellcheck control are also not working 

can you Please help me in this..?
Slav
Telerik team
 answered on 03 Jun 2013
3 answers
220 views
I have a simple RadCalendar control that allows the user to select a range of consecutive days. The first day is clicked regularly then the second day is selected with the shift key pressed. All days between the two days are placed in the selected range. However, by setting EnableMultiSelect to true, the user can also select the days at the top of the calendar (M, T, etc) and the calendar will select every Monday, Tuesday, etc.

We need to ensure users cannot select days in this way because the days are not consecutive, but we still need to allow mulitselect.

I am using javascript to manage the date selection by clearing the previous date is the user does not press the shift key.
Selecting the dates by clicking on the week number in the left margin is ok, although if that functionality was lost, it wouldn't be a problem.

Is there a setting that I can use to allow multiselect and but disallow users clicking the column and row headers?
Keith
Top achievements
Rank 2
 answered on 03 Jun 2013
1 answer
226 views

I have very basic Radmenu

I would like to remove all boarders form all parts of the menu including root, vertical etc.

I know if I set the css for root to border:none !important all borders are removed.

However, once I apply

EnableRoundedCorners="True"

A 1px upper and lower border are also applied to the sub menu containers.

Is there anyway to remove ALL border when rounded corners is enabled

Here is my CSS

/* <RadMenu / ETP> */
 
.RadMenu_ETPZ2 .rmRootGroup, .RadMenu_ETPZ2 a.rmLink, .RadMenu_ETPZ2 .rmText
{
    border:none !important;
    font: normal 12px "Segoe UI" ,Arial,Helvetica,sans-serif;
    line-height: 22px;
}
 
.RadMenu_ETPZ2 .rmRootGroup
{
    border:none !important;
    background-repeat: repeat-x;
    background-color: transparent;
    margin: 0 !important;
    padding: 0 !important;
}
 
.RadMenu_ETPZ2 .rmVertical
{
    border:none !important;
    background-color: #FDF4B9;
    background-image: url('../images/back_menu.jpg');
}
 
.RadMenu_ETPZ2 .rmSlide > ul.rmVertical
{
        border: 1px solid #4265ac;
}
 
/* <Root items> */
 
 
.RadMenu_ETPZ2, .RadMenu_ETPZ2 a.rmLink, .RadMenu_ETPZ2 .rmRootLink
{
    color: #000000;
    font-size: 14px;
}
 
.RadMenu_ETPZ2 .rmItem, .RadMenu_ETPZ2 a.rmFocused, .RadMenu_ETPZ2 a.rmSelected
{
    background-position: 0;
    background-color: transparent; /* Selected menu*/
}
 
.RadMenu_ETPZ2 .rmLast a.rmExpanded .rmText
{
    background-repeat: no-repeat;
}
 
.RadMenu_ETPZ2 a.rmDisabled, .RadMenu_ETPZ2 a.rmDisabled:hover
{
    color: #7d7d7d;
    background-position: 0 500px;
}
 
.RadMenu_ETPZ2 .rmVertical .rmLink, .RadMenu_ETPZ2 .rmHorizontal .rmLink
{
    margin-right: 0px; /* Distance between menu items*/
}
 
 
/* Separators */
 
.RadMenu_ETPZ2 .rmSeparator
{
    padding: 1px;
    background-color: #4265ac !important;
}
 
.RadMenu_ETPZ2 .rmSeparator .rmText
{
    background-color: #4265ac !important;
}
 
 
/* Containers */
 
DIV.RadMenu_ETPZ2 .rmItem .rmLink:hover
{
    border:none !important;
    color: #CC0000;
    background-color: transparent;
}
 
DIV.RadMenu_ETPZ2 .rmGroup .rmItem .rmLink .rmText
{
    padding-left: 10px;
    padding-right: 53px;
    margin-left: 4px;
    margin-right: 0px;
    width: 100px;
}
 
DIV.RadMenu_ETPZ2 .rmGroup
{
    padding-bottom: 10px !important;
}


Thank you.

Allan

Kate
Telerik team
 answered on 03 Jun 2013
5 answers
220 views
Hi Team,

One quick query related to RadPivotGrid as mentioned below:

How to save the current setting or user preferences of telerik RadPivotGrid in Asp.net?

Is there any similar type of functionality or approach as we have in GridSettingsPersister class in PivotGrid? Any suggestion/help to achieve the same.

Thanks & regards,
Badal Kumar
Angel Petrov
Telerik team
 answered on 03 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?