Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
216 views

I have a radgrid with a 3-tier structure (master -> detail -> detaildetail)

In my ItemDataBound event:

protected void RadGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
 ... code referencing e.Item
}

how can I determine which "tier" e.Item is?

The <telerik:GridTableView> markup does not appear to allow me to specify a separate ItemDataBound handler for each "tier".

Thanks,


.

.

.

ToltingColtAcres
Top achievements
Rank 2
Veteran
Iron
 answered on 13 Sep 2016
2 answers
290 views

I have an ASP.Net page with a RadGrid which is populated by the SQLDataSource.

I am trying to set up the RadGrid so the user edit some fields in the RadGrid for a record and click on update. But I cannot get it to work.  When clicking on update, I get "ORA-01036: illegal variable name/number" error.

I am connecting to an Oracle database.

In looking at your demos, none of them use EditMode = "InPlace".  They either use an Edit Form or some custom things like textboxes, comboboxes, etc.

I have tried having a simple update command in SQLDataSource like the following:

UpdateCommand="UPDATE ADMIN.RSDC_SCRAP_CREDIT_RATE SET LAST_UPDATE = CURRENT_DATE"

That statement should update the LAST_UPDATE field with the Current Date/Time for all the records but it is causing the error as well.  That statement was just a test to see if the parameters in the SQLDataSource is causing the error and/or the Update statement is causing the error.

Usually I set up a RadGrid to use NeedDataSource but alot of your demos and documentation for editing and updating records in the RadGrid indicate using SQLDataSource instead.

Either way I am trying to find a way for the user to edit fields in the RadGrid and update the record.

Please help!

Here is my ASP.net page:

<%@ Page Language="VB" AutoEventWireup="false" Debug="true" CodeFile="ScrapRateBySupplier.aspx.vb" Inherits="ScrapRateBySupplier" %>
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
    <style type="text/css">
        .auto-style1 {
            width: 960px;
            height: 220px;
        }
        .auto-style4 {
            width: 355px;
        }
        .modal
        {
            position: fixed;
            top: 0;
            left: 0;
            background-color: black;
            z-index: 99;
            opacity: 0.8;
            filter: alpha(opacity=80);
            -moz-opacity: 0.8;
            min-height: 100%;
            width: 100%;
        }
        .loading
        {
            font-family: Arial;
            font-size: 10pt;
            border: 5px solid #67CFF5;
            width: 200px;
            height: 100px;
            display: none;
            position: fixed;
            background-color: White;
            z-index: 999;
        }
        .auto-style5 {
            width: 186px;
        }
        .auto-style6 {
            width: 264px;
        }
        html .RadMenu .rmLink,
        html .RadMenu .rmHorizontal .rmText {
            float: none;
            padding: 0;
            text-align: center;
        }   
        </style>
    <script type="text/javascript" src="/scripts/jquery.min.js"></script>
    <script type = "text/javascript" >
        function preventBack() { window.history.forward(); }
        setTimeout("preventBack()", 3);
        window.onunload = function () { null };
    </script>
    <script type="text/javascript">
        function ShowProgress() {
            setTimeout(function () {
                var modal = $('<div />');
                modal.addClass("modal");
                $('body').append(modal);
                var loading = $(".loading");
                loading.show();
                var top = Math.max($(window).height() / 2 - loading[0].offsetHeight / 2, 0);
                var left = Math.max($(window).width() / 2 - loading[0].offsetWidth / 2, 0);
                loading.css({ top: top, left: left });
            }, 200);
        }
        $('form').live("submit", function () {
            ShowProgress();
        });
        $(document).ready(function () {
            $("#txtActivity").focus(function () {
                $(this).css("background-color", "#ffff33");
            });
            $("#txtActivity").blur(function () {
                $(this).css("background-color", "#ffffff");
            });
            $("#ddlUnit").focus(function () {
                $(this).css("background-color", "#ffff33");
            });
            $("#ddlUnit").blur(function () {
                $(this).css("background-color", "#ffffff");
            });
            $("#txtNote").focus(function () {
                $(this).css("background-color", "#ffff33");
            });
            $("#txtNote").blur(function () {
                $(this).css("background-color", "#ffffff");
            });
        });
 
    </script>
</head>
<body style="background-color: #3A4459">
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
                </asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
                </asp:ScriptReference>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
                </asp:ScriptReference>
            </Scripts>
        </telerik:RadScriptManager>
     <div>
        <img alt="RSDC of Michigan" class="auto-style1" src="/images/RSDC_Logo2.jpg" />
        <br />
        <telerik:RadMenu ID="RadMenu1" Runat="server" Width="960px" Style="z-index: 50">
            <Items>
                <telerik:RadMenuItem runat="server" Font-Bold="True" Font-Size="14pt" NavigateUrl="CustomerPortal" Text="Home" Width="475px">
                </telerik:RadMenuItem>
                <telerik:RadMenuItem runat="server" IsSeparator="True" Text="Sep">
                </telerik:RadMenuItem>
                <telerik:RadMenuItem runat="server" Font-Bold="True" Font-Size="14pt" ForeColor="Red" Text="Logout" Width="475px">
                </telerik:RadMenuItem>
            </Items>
        </telerik:RadMenu>
        <br />
        <br />
        <asp:Label ID="Label2" runat="server" Font-Bold="True" ForeColor="White" Text="Scrap Rate By Supplier"></asp:Label>
        <table style="width:960px;">
            <tr>
                <td style="text-align:right;"><asp:Label ID="lblTable" runat="server" ForeColor="White"></asp:Label></td>
            </tr>
        </table>
        <asp:Panel ID="Panel1" runat="server" Height="600px" Wrap="False" BorderWidth="3px" BorderColor="Black" BorderStyle="Ridge" ForeColor="White" Width="955px" style="margin-right: 17px">
            <br />   
                                             
            <telerik:RadButton ID="rbtnAdd" runat="server" Text="ADD" RenderMode="Classic" Font-Size="11pt">
               <Icon PrimaryIconCssClass="rbAdd" PrimaryIconLeft="4" PrimaryIconTop="3"></Icon>
            </telerik:RadButton>
                
            <asp:Label ID="Label1" runat="server"></asp:Label>
            <br />
            <br />
        <telerik:RadGrid ID="rgScrapRateBySupplier" runat="server" GroupPanelPosition="Top" Height="400px" Width="955px" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"  AllowAutomaticUpdates="True">
            <ExportSettings>
                <Pdf AllowPrinting="False">
                </Pdf>
            </ExportSettings>
            <ClientSettings>
                <Selecting AllowRowSelect="True" />
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            </ClientSettings>
            <MasterTableView EditMode="InPlace" DataSourceID="SqlDataSource1">
                <CommandItemSettings ShowAddNewRecordButton="False" ShowRefreshButton="False" />
                <Columns>
                    <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
                    </telerik:GridEditCommandColumn>
                    <telerik:GridBoundColumn DataField="SUPPLIER" FilterControlAltText="Filter column column" HeaderText="Supplier" ReadOnly="True" UniqueName="Supplier">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="PRIME" FilterControlAltText="Filter column column" HeaderText="Prime" UniqueName="Prime">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="RSDC_SV" FilterControlAltText="Filter column1 column" HeaderText="RSDC SV" UniqueName="RSDCSv">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="MILL" FilterControlAltText="Filter column2 column" HeaderText="Mill" UniqueName="Mill">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ENG" FilterControlAltText="Filter column3 column" HeaderText="Eng" UniqueName="Eng">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="LAST_UPDATE" FilterControlAltText="Filter column4 column" HeaderText="Last Update" ReadOnly="True" UniqueName="LastUpdate">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
            <br />
            <br />
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="OverwriteChanges" ConnectionString="<%$ ConnectionStrings:OracleConnectionStringS01 %>" ProviderName="<%$ ConnectionStrings:OracleConnectionStringS01.ProviderName %>"
                SelectCommand="SELECT * FROM ADMIN.RSDC_SCRAP_CREDIT_RATE">
            </asp:SqlDataSource>
        </asp:Panel>
        <br />
        <br />
 
    </div>
     <div class="loading" align="center" style="z-index:100000">
        Loading. Please wait.<br />
        <br />
        <img src="loader.gif" alt="" />
    </div>
   </form>
</body>
</html>

Here is the Code-behind in vb.net:

Imports System.Data
Imports Telerik.Web.UI
 
Partial Class ScrapRateBySupplier
    Inherits System.Web.UI.Page
 
    Private myDSData As DataSet
    Private sql As String
    Private bHasError As Boolean = False, strErrorMsg As String
 
    Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        Try
            Dim strUser As String = ""
            Dim strDecUser As String = ""
            Dim strAppName As String = "ACMENUSCRAPRATEBYSUPP"
 
            If Request.IsAuthenticated Then
                If Not Session("UserName") Is Nothing Then
                    strUser = CType(Session("UserName"), String)
 
                    strDecUser = DataEncryption.base64Decode(strUser)
 
                    strDecUser = DataEncryption.base64Decode(strDecUser)
 
                    strDecUser = DataEncryption.base64Decode(strDecUser)
 
                    strUser = strDecUser
 
                End If
 
                If Not LoginValidation.IsValidAppAccess(strUser, strAppName) Then
                    Response.Redirect("CustomerPortal")
                End If
            Else
                FormsAuthentication.RedirectToLoginPage()
            End If
 
        Catch ex As Exception
            strErrorMsg = "Procedure: Page_Init - ScrapRateBySupplier" & vbCrLf & "Error Message: " & ex.Message & vbCrLf & "Source: " & ex.Source
            UserFunctions.UserMsgBox(Me, strErrorMsg)
 
        End Try
    End Sub
 
End Class

Keith
Top achievements
Rank 1
 answered on 13 Sep 2016
1 answer
216 views

Hi,

How to disable drag and drop option for rad sync upload control.

Rumen
Telerik team
 answered on 13 Sep 2016
1 answer
58 views

Hi, 

Is it possible get selected files count on clientfiledropped method?

Rumen
Telerik team
 answered on 13 Sep 2016
5 answers
125 views
When using the RadEditor and the RadPageLayout together things do not render correctly. As you can see from the image the editor does not push the buttons down far enough and they are in the editor box area. How do we fix this?
Rumen
Telerik team
 answered on 13 Sep 2016
1 answer
81 views

Hi,

 

I am currently evaluating Telerik Controls for our next project.

I wish to use spreadsheet for holding data before i paste it into telerik grid.

I have observed that it does not behave as it does in the demo. The keyboard movement is not very smooth and pasting data from excel into it either does not happen at all or happens very late.

Below is the code I have used in aspx file and nothing in cs file. Let me know if i am doing something wrong.

 <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>

             <div id="divSheet">
           
                <telerik:RadSpreadsheet ID="RadSpreadsheet1" runat="server"></telerik:RadSpreadsheet>
           

        </div>

 

Ivan Danchev
Telerik team
 answered on 13 Sep 2016
6 answers
439 views
 Below is the code which is grouping the data based on name field, i also want one more level above the name field ex: category how do i do it?


Thanks a million in advance.









 <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceI="SqlDataSource1" 
   GridLines="None" 
   AllowPaging="false" PageSize="25" 
   Skin="Outlook" DataSourceID="SqlDataSource1">  
 
 
 <MasterTableView DataSourceID="SqlDataSource1">  
   <GroupByExpressions> 
         <telerik:GridGroupByExpression  > 
         <SelectFields> 
          <telerik:GridGroupByField  
            FieldName="name" HeaderText=""/>  
         </SelectFields> 
           <GroupByFields> 
              <telerik:GridGroupByField  
                 FieldName="name" /> 
               </GroupByFields> 
         </telerik:GridGroupByExpression> 
   </GroupByExpressions> 
    </MasterTableView> 
    <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="false" AllowColumnsReorder="false">  
                <Selecting AllowRowSelect="false"></Selecting> 
                            </ClientSettings> 
   
</telerik:RadGrid> 
Maria Ilieva
Telerik team
 answered on 13 Sep 2016
1 answer
339 views

Hi guys,

One of the options of the RadEditor is an option to create links using UI (see the attached screenshot RedEditorVulnerability.jpg)

Here is an option to open a new tab when clicking this link on a front-end site.

What I've recently found is this article with an example https://dev.to/ben/the-targetblank-vulnerability-by-example which says that using the "target=_blank" is a potential security hole for any site in any browser for now. Also there are some suggestions regarding on how to prevent this (by adding the rel="noopener noreferrer" attribute to a link).

So I'd like to ask you to add a possibility in the Hyperlink Manager to secure such links (e.g. some kind of checkbox "Protect my link from the target=_blank vulnerability").

This functionality will be very helpful for those clients who are focused on their sites' security.

Thank you!

 

Ianko
Telerik team
 answered on 13 Sep 2016
15 answers
184 views

When the root (1st) node in a RadTreeView are expanded, the background of the child nodes have black vertical lines behind them. (See screenshot attached).

What can I do about this or is this a bug?

 Thank you,

Lee

Ivan Danchev
Telerik team
 answered on 13 Sep 2016
1 answer
365 views
Hi i have the two way binding working with rad grid and a rad combobox in a template but when i hit  save the new changed data is not being passed. i keep getting the old bound data. here is the code.                           
                                       
    protected void OnClickSave(object sender, EventArgs e)
        {
            foreach (var test in grdStatus.Items)
            {
              GridEditableItem item = (GridEditableItem)test;
               QARSubmittal s = item.DataItem as QARSubmittal;
                RadComboBox comboBox = item.FindControl("CbOracleVerified") as RadComboBox;

               string format = DataBinder.Eval(item.DataItem, "ORACLE_VERIFIED").ToString(); 

            }

        }
    private void LoadResults()
        {
            var dtosList = new List<QARSubmittal>();
            int counter = 3;
            for (int i = 0; i < counter; i++)
            {
                var dtos = new QARSubmittal
                {

                    AUDIT_CALENDAR_ID = 11000+i,
                    SUBMITTER_USERID = 1000 + i,
                    RC = 999 + i,
                    STATION = "Atlanta" + i,              
                    ORACLE_VERIFIED = i==1?0:1,
                    TRAFFIC_VERIFIED = 1,
                    DART_VERIFIED = 1,
                    OPERATIVE_VERIFIED = 1,
                    CBSPAYNOW_VERIFIED = 1,
                    ANDO_TRITON_VERIFIED = 1,
                    SUBMITTAL_STATUS = 1000,
                    SUBMITTER = "gabdo" + i,
                    SUBMIT_DATE = DateTime.Today,
                    MARKET = "Atlanta" + i

                };
                dtosList.Add(dtos);
            }

            grdStatus.DataSource = dtosList;
            grdStatus.Rebind();

        }


here is my html 
                                       
             <telerik:RadGrid runat="server" ID="grdStatus" OnItemCommand="grdStatus_ItemCommand"   AutoGenerateColumns="false"  AllowPaging="false" >
                   <MasterTableView DataKeyNames="QAR_SUBMITTAL_ID,AUDIT_CALENDAR_ID,SUBMITTER_USERID,RC, MARKET, STATION, ORACLE_VERIFIED, TRAFFIC_VERIFIED,
                ANDO_TRITON_VERIFIED,DART_VERIFIED,OPERATIVE_VERIFIED,CBSPAYNOW_VERIFIED,SUBMITTER">
                   <Columns>
                    
                         <telerik:GridTemplateColumn UniqueName="ORACLE_VERIFIED" HeaderText="Oracle">
                        <ItemTemplate>
                                <telerik:RadComboBox runat="server" SelectedValue='<%#Bind("ORACLE_VERIFIED") %>' AutoPostBack="false" ID="CbOracleVerified">
                                <Items>
                                    <telerik:RadComboBoxItem Text="Not Verified" Value="0" />
                                     <telerik:RadComboBoxItem Text="N/A" Value="-1" />
                                     <telerik:RadComboBoxItem Text="Verified" Value="1" />
                                     
                                </Items>
                      </telerik:RadComboBox>
                         
                   </Columns>
                       </MasterTableView>
             </telerik:RadGrid>

     <div class="dialogHeader">
        <table border="0">
            <tr>
                <td align="left" valign="top">
                    <table cellspacing="5">
                        <tr>
                            <td>
                                <telerik:RadButton runat="server" ID="btnSave" OnClick="OnClickSave" Text="Save" Style="margin-bottom: 0px">
                                </telerik:RadButton>
                            </td>
                            <td>
                                <telerik:RadButton runat="server" ID="btnSubmit" OnClick="OnClickSubmit" Text="Submit">
                                </telerik:RadButton>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
Veselin Tsvetanov
Telerik team
 answered on 13 Sep 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?