Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
167 views

Dear All,

 

i am new to telerik, especially radgrid. right now i am creating windows popup Employee selector using RadWindows, triggered by button show employee, and then calling another page with radgrid showing Employee record include filter on and paging, it's worked perfectly. But, there some error that i faced, everytime i'm doing filtering or paging on radgrid, after i clicked button close on popup radwindows and then i've clicked button show employee again, popup open but with previously action state that i've done on grid, either filtering or paging.

How can i refresh Radgrid into original state, like first time opening popup and showing radgrid data without filtering or paging state ? 

Thanks.

<%@ Register TagPrefix="UC" TagName="UCEmploye" Src="../SIM/UcEmployeeBrowser.ascx" %>
 
<asp:Button ID="btnSearch" runat="server" Text="..." OnClick="btnSearch_Click" CausesValidation="false" CssClass="btn btn-primary" Height="28px" ToolTip="Click here to browse employee" />
 
<telerik:RadWindow ID="RwEmployeeBrowser" runat="server" Width="1200px" Height="550px" KeepInScreenBounds="true" Title="Select Employee">
    <ContentTemplate>
        <UC:UCEmploye ID="UCEmploye" runat="server" />
    </ContentTemplate>
</telerik:RadWindow>
Attila Antal
Telerik team
 answered on 17 Sep 2019
1 answer
196 views

Using file explorer I am uploading files to my web server. The problem that I am facing is when I try to upload a file which contains <script></script> tags from a cross-origin (CORS), it fails showing a tiny red dot. However,the uploading of files containing script tags from 'same origin' succeeds.

Also note that Temporary folder is given enough permissions and I my web server is IIS. The error occurs in RadAsyncUploadScript.js while making an ajax request.

To be more specific the line "n.send(this.formData);" in RadAsyncUploadScript.js throws an error stating:

"Failed to load resource: the server responded with a status of 403 ()"

 

Thanks and Regards

Bhanu

Vessy
Telerik team
 answered on 16 Sep 2019
15 answers
2.3K+ views
I am trying to access the DataItem for the parent of a detail grid.  Currently I am using the below code.  However, the DataItem is returning null for the parentItem.

protected

 

void grdOrderItems_ItemDataBound(object sender, GridItemEventArgs e)

 

{

 

  if (e.Item.OwnerTableView.Name == "Steps")

 

  {

 

    if (e.Item is GridDataItem && !e.Item.IsInEditMode)

 

    {

 

      string stepId = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Id"].ToString();

 

 


      GridDataItem
item = e.Item as GridDataItem;

 

 

      // item.DataItem is valid here

 

 


      GridDataItem
parentItem = item.OwnerTableView.ParentItem;

 

 

      // parentItem.DataItem is returning null

 

 

    }

 

  }

}

Attila Antal
Telerik team
 answered on 16 Sep 2019
8 answers
970 views
Hi, i have the Autosize property in windowmanager and works fine with my custom dialogs.
But it doesn't work with RadAlert dialog.

Is there any way to use the autosize with radalert? Maybe something with alerttemplate?

Thanks.
Peter Milchev
Telerik team
 answered on 16 Sep 2019
1 answer
232 views
I would like to represent binary data that save in myTable in sqlserver as svg in kendo grid MVC
S.Ahmadi
Top achievements
Rank 1
 answered on 16 Sep 2019
3 answers
662 views
Hi,

I have to validate the numeric text box with min and max value and display the error message. i am using a custom validator to check the condition. i am able to get the min and the max value but when the min value property is set and if i enter any value below the min value its automatically replacing the value with the minvalue. how to avoid this and display the message.

Pls. Guide me.

Jidesh
Attila Antal
Telerik team
 answered on 16 Sep 2019
1 answer
305 views

  Hi All,

I have a code in code behind where i am calling RadConfirm popup screen:

RadWindowManager1.RadConfirm("Are you sure you want to Delete interest record(s) and ready to proceed?", "confirmCallbackFn", 300, 180, null, "Confirmation Message");

<script type="text/javascript">

        function confirmCallbackFn(arg) {
            if (arg) //the user clicked OK
            {

                __doPostBack("<%=OkBtn.UniqueID %>", "");



            }
            else {
                __doPostBack("<%=CancelBtn.UniqueID %>", "");
            }
        }

    </script>

when i scroll all the way down and delete the record on the grid and click on link button, popup screen appear but all the way on top instead of the center when i scroll down. When screen is located up it is fine but when i scroll down to lets say delete last record on the screen popup window remains on the top.

Please help.

Thanks so much.

Peter Milchev
Telerik team
 answered on 16 Sep 2019
3 answers
1.5K+ views

Hi Telerik,

I have a very simple example with a RadNumericTextBox control set to allow a maximum or 20 numeric characters with a MaxValue of 99999999999999999999.  The issue is after entering 16 or more digits and then make the control lose focus causes the value to change.  For example, 88888888888888888888 changes to 88888888888888880000.  99999999999999999999 changes to 10000000000000000000.  Please help me make sense of what's going on.  In my opinion, the value shouldn't change.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="RadTextBoxTest.aspx.vb" Inherits="Pages_RadTextBoxTest" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <div>
            <telerik:RadNumericTextBox runat="server" ID="txtDigits" Type="Number" MaxLength="20" MaxValue="99999999999999999999" Width="150px">
                <NumberFormat DecimalDigits="0" AllowRounding="false" GroupSeparator="" NegativePattern="n" />
            </telerik:RadNumericTextBox>
        </div>
    </form>
</body>
</html>

 

Thanks,

Rob

Attila Antal
Telerik team
 answered on 16 Sep 2019
1 answer
1.9K+ views

When exporting RadGrid to Excel (XLSX format), I get the following exception 

We found a problem with this formula. Try clicking Insert Function on the Formulas tab to fix it.\n\nNot trying to type a formula? When the first character is an equal (=) or minus (-) sign, RadSpreadsheet thinks it is a formula. For example, when you type =1+1 the cell shows 2.

I have read this KB article. The error occurs because some of my grid cells has value "++".

I can't prevent users from entering this value. So I want to set the cell format to a string for the excel export so the engine does not attempt to parse a formula. How do I do that?

Attila Antal
Telerik team
 answered on 16 Sep 2019
0 answers
155 views

Hi, i have problem whne click save in edit mode,  my problem when i click edit and fill text box after save click i got no change , no save to database and save don go back to edit mode in

my code is

<telerik:RadGrid ID="RadGrid1" OnNeedDataSource="RadGrid1_NeedDataSource" ClientSettings-EnablePostBackOnRowClick="true" OnUpdateCommand="RadGrid1_UpdateCommand" runat="server" Skin="Bootstrap" AutoGenerateColumns="False" AllowSorting="True" CellSpacing="-1" GridLines="Both" >

                    <GroupingSettings CollapseAllTooltip="Collapse all groups"></GroupingSettings>
                    <ClientSettings>
                        <Selecting AllowRowSelect="True" />
                    </ClientSettings>
                    <MasterTableView EditMode="InPlace" CommandItemDisplay="Bottom" CommandItemSettings-ShowAddNewRecordButton="false" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" AlternatingItemStyle-HorizontalAlign="Center" DataKeyNames="ID"  >
                        <Columns>
                            <telerik:GridBoundColumn ReadOnly="true" DataField="da" DataType="System.DateTime" FilterControlAltText="Filter da column" HeaderText="date"  SortExpression="da" UniqueName="da">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn ReadOnly="true" DataField="GivenName" FilterControlAltText="Filter GivenName column" HeaderText="GivenName" SortExpression="GivenName" UniqueName="GivenName">
                            </telerik:GridBoundColumn>

                            <telerik:GridTemplateColumn  DataField="GateComment" HeaderText="GateComment" ItemStyle-Width="240px" UniqueName="GateComment" ShowFilterIcon="false" AutoPostBackOnFilter="true" SortExpression="GateComment">
                                <ItemTemplate>
                                    <%#DataBinder.Eval(Container.DataItem, "GComment")%>
                                </ItemTemplate>
                                <EditItemTemplate>

                                    <asp:TextBox ID="GateComment" runat="server" Text='<%# Bind("GComment") %>'>
                                    </asp:TextBox>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>

 

 

 

and my code behind

 


        protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            String ConnString = ConfigurationManager.ConnectionStrings["TR"].ConnectionString;
            SqlConnection conn = new SqlConnection(ConnString);
            SqlDataAdapter adapter = new SqlDataAdapter();
            adapter.SelectCommand = new SqlCommand();

            adapter.SelectCommand.CommandText = "SELECT GComment, GivenName, da, ScID as ID from tblSC";


            adapter.SelectCommand.Connection = conn;
            var myDataTable = new DataTable();

            conn.Open();
            try
            {
                adapter.Fill(myDataTable);
            }
            finally
            {
                conn.Close();
            }

            RadGrid1.DataSource = myDataTable;
        }

 

 

 protected void RadGrid1_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            //Get the GridEditableItem of the RadGrid    
            GridEditableItem editedItem = e.Item as GridEditableItem;
            //Get the primary key value using the DataKeyValue.    
            string ID = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["ID"].ToString();

        
            TextBox GateComment = (TextBox)editedItem.FindControl("GComment");
            string connectionString = ConfigurationManager.ConnectionStrings["TR"].ConnectionString;
            SqlConnection SqlConnection = new SqlConnection(connectionString);



            try
            {

                using (SqlCommand cmb = new SqlCommand())
                {
                    if ((e.Item is GridEditableItem) && e.Item.IsInEditMode)
                    {
                        //edit operation triggered   
                        cmb.CommandText = "update tblSC set GComment = '" + GComment.Text + "'  where ID = " + ID + "";
                    }






                    cmb.Connection = SqlConnection;

                    SqlConnection.Open();
                    cmb.ExecuteNonQuery();
                }
            }



            catch (Exception ex)
            {
                RadGrid1.Controls.Add(new LiteralControl("Unable to update the field. Reason: " + ex.Message));
                e.Canceled = true;
            }
        }

 

 

osman
Top achievements
Rank 1
 asked on 15 Sep 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?