Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
674 views

Hello telerik community!

I'm currently working within a user form which contains a grid. I want to load the Update and Insert operations, and respective forms in another user control. I'm using 3 layer architecture. What am i missing?


<%@ Register Src="~/Views/Projectos/Equipa/ViewEmissaoTimeSheetEdit.ascx" TagPrefix="uc1" TagName="ViewEmissaoTimeSheetEdit" %> //Child reference in parent UC

<%@ Reference Control="~/Views/Projectos/Equipa/ViewEmissaoTimeSheetEdit.ascx" %>
ClassName="EditCommandColumn" //Reference in child User Control

<Telerik:RadGrid AllowAutomaticInserts="true" AllowAutomaticUpdates="true" On>

<Columns> <telerik:GridEditCommandColumn UniqueName="EditCommandColumn"> </telerik:GridEditCommandColumn> ... </Columns> <EditFormSettings UserControlName="ViewEmissaoTimeSheetEdit.acsx" EditFormType="WebUserControl" > <EditColumn UniqueName="EditCommandColumn1"></EditColumn> </EditFormSettings> </MasterTableView>


Thank you in advance :)
Harlem98
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 03 Nov 2021
2 answers
212 views

Hello

I have problem i have one wsdl that is connected with Visual Studio. And i need add result of one get methode to table. My question is how, it is possible? I have any svc file, any asmx only wsdl https://www.um.poznan.pl/web-service/news?wsdl

I tried it


<%@ Page Language="VB" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="AskingTheWB._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <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 Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
        <h3>RadGrid bound to Web Service</h3>
        <telerik:RadGrid RenderMode="Lightweight" runat="server" ID="RadGrid2" AllowPaging="true" AllowSorting="true"
            AllowFilteringByColumn="true" PageSize="1">
            <MasterTableView DataKeyNames="ProductID" ClientDataKeyNames="ProductID">
                <PagerStyle Mode="NumericPages" />
                <Columns>
                    <telerik:GridBoundColumn DataField="News" HeaderText="News" DataType="System.String">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings>
                <DataBinding SelectMethod="getNews" Location="https://www.um.poznan.pl/web-service/news" SortParameterType="Linq"
                    FilterParameterType="Linq">
                </DataBinding>
            </ClientSettings>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>

but my table is empty. 

Aleksander
Top achievements
Rank 1
Iron
 answered on 03 Nov 2021
1 answer
616 views

I have a page with a popup RadWindow. In the RadWindow, users fill out a simple form and click on an OK button. The processing takes several seconds and sometimes users click on the OK button again. I am trying to find a way of disabling the OK button in javascript while the process runs, if the button is not in a RadAjaxPanel or one of the controls in a RadAjaxManager, the button does not change when it is disabled. When the button is n a RadAjaxPanel or one of the controls in a RadAjaxManager, I can't close the RadWindow.

I would think this is a pretty frequent issue. Anyone have any ideas? If you know of sample code that solves this I would really appreciate it!

Thanks

Vessy
Telerik team
 answered on 01 Nov 2021
0 answers
183 views

Hi,

I have the following snippet in my ASP.NET 

<TELERIK:RADMULTICOLUMNCOMBOBOX ID="RadMultiColumnComboBoxSearch" runat="server" Filter="startsWith" FilterFields="DrawingName, Description"
	Height="800" AllowPaging="true" EnableServerFiltering="true" MinLength="3" PageSize="60" DataTextField="DrawingName" DataValueField="DrawingID">
	<COLUMNSCOLLECTION>
		<TELERIK:MULTICOLUMNCOMBOBOXCOLUMN Field="DrawingID" Title="ID" />
		<TELERIK:MULTICOLUMNCOMBOBOXCOLUMN Field="DrawingName" Title="Name" />
		<TELERIK:MULTICOLUMNCOMBOBOXCOLUMN Field="Description" Title="Description" />
	</COLUMNSCOLLECTION>
	<WEBSERVICESETTINGS ServiceType="XML" Select-DataType="JSON" Select-Url="Default.aspx/GetDrawingsSuggestion" Select-RequestType="Post" />
</TELERIK:RADMULTICOLUMNCOMBOBOX>

[WebMethod()]
public static string GetDrawingsSuggestion(string filter)
{
	string filterText = HttpUtility.UrlDecode(filter);

	using (HEN_INTRANET_ProductionEntities dc = new HEN_INTRANET_ProductionEntities())
	{
		var q = from d in dc.tbl_ENECR_Drawings
				where (d.DrawingFlag == 1 | d.DrawingFlag == 2) && d.DrawingTypeID == 1
				select new
				{
					DrawingID = d.DrawingID,
					DrawingName = d.DrawingName,
					Description = d.Description,
				};
		var drawingsList = q.ToList();

		return Newtonsoft.Json.JsonConvert.SerializeObject(drawingsList);
	}
}

Can I use a page method service to get the data I need from the server?
Looking in Fiddler the call to the GetDrawingsSuggestion method occurs, but it returns the page contents. It does not execute the method. It just returns the rendered page.

Bart
Top achievements
Rank 1
 asked on 27 Oct 2021
1 answer
300 views

I'm launching a Radwindow that contains a RadGrid.  All that is working fine.  Data displays no problem.  The problem is when I click the Edit or the Delete commands the window goes away.  Clicking those doesn't even execute the grids ItemCommand event.  

I tried the grid  on it's own sans having it in a window and it functioned as expected.  Here's my code:

ASPX

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test.aspx.vb" Inherits="OmniCare.Test" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <ajax:ScriptManager runat="server" ID="ScriptManager1" EnablePartialRendering="true" />

        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
            <script language="javascript" type="text/javascript">
                function OnClientclose(sender, eventArgs) {
                    var arg = eventArgs.get_argument();
                }
            </script>
        </telerik:RadScriptBlock>

        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="rgDeposits">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rgDeposits" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnDeposit">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rwDeposits" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rwDeposits">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rwDeposits" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>

        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableViewState="False">
            <Windows>
                <telerik:RadWindow runat="server" ID="rwDeposits" OnClientClose="OnClientclose" VisibleStatusbar="False" Width="750px" Height="350px" CssClass="Padding">
                    <ContentTemplate>
                        <asp:Panel runat="server" HorizontalAlign="Center" Width="98%" CssClass="PanelFrame MainPanel" BackColor="#DFECFB" Height="98%">
                            <div class="General TopRound" style="width: 100%; background-color: #dcdcdc; border-bottom: 1px solid black;">
                                <asp:Label ID="Label2" runat="server" Text="Deposit Information" CssClass="Title" Width="100%"></asp:Label>
                            </div>
                            <telerik:RadGrid ID="rgDeposits" runat="server" Width="99%" AutoGenerateColumns="False" CellPadding="1" CellSpacing="1" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="False" CssClass="Center" GridLines="Both">
                                <MasterTableView GridLines="Both" DataKeyNames="CUST_DEP_ID">
                                    <HeaderStyle Font-Bold="True" />
                                    <Columns>
                                        <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
                                        <telerik:GridBoundColumn DataField="CU_DEP_DATE" HeaderText="Date"></telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="CU_DEP_DESC" HeaderText="Description"></telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="CU_DEP_STAT" HeaderText="Stat">
                                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="CU_DEP_SIGN" HeaderText="Sign">
                                            <ItemStyle HorizontalAlign="Center" CssClass="Align-Center"></ItemStyle>
                                            <HeaderStyle HorizontalAlign="Center" CssClass="Align-Center" />
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="CU_DEP_AMT" HeaderText="Amount" DataFormatString="{0:c}">
                                            <ItemStyle HorizontalAlign="Right" CssClass="Align-Right"></ItemStyle>                                            
                                            <HeaderStyle HorizontalAlign="Center" CssClass="Align-Center" />
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="USER_LOGIN" HeaderText="OPR"></telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="cu_dep_type_id" HeaderText="OPR" Visible="False"></telerik:GridBoundColumn>
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
                        </asp:Panel>
                    </ContentTemplate>
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>


        <div>
            <telerik:RadButton ID="btnDeposit" runat="server" Text="Deposit Detail" Width="100px" RenderMode="Lightweight" CssClass="center" 
                Font-Size="9px" CausesValidation="False" AutoPostBack="True" Height="27px">
                <Icon PrimaryIconUrl="Images/DollarSign.gif" PrimaryIconLeft="5px" PrimaryIconTop="8px"></Icon>
            </telerik:RadButton>

        </div>
    </form>
</body>
</html>

VB


Imports Telerik.Web.UI

Public Class Test
    Inherits System.Web.UI.Page

    Dim db As dcDataDataContext = Nothing

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        db = New dcDataDataContext("SAMP1")

    End Sub

    Private Sub rgDeposits_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs) Handles rgDeposits.NeedDataSource
        Dim res = From x In db.sp_Cust_Dep_SEL(1)
                  Select x

        rgDeposits.DataSource = res.ToList

    End Sub


    Private Sub rgDeposits_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles rgDeposits.ItemCommand
        Dim xxx As String = e.CommandName
    End Sub

    Private Sub btnDeposit_Click(sender As Object, e As EventArgs) Handles btnDeposit.Click
        rgDeposits.Rebind()

        Dim script As String = "function f(){$find(""" + rwDeposits.ClientID + """).show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, True)

    End Sub
End Class

Attila Antal
Telerik team
 updated answer on 25 Oct 2021
1 answer
307 views

I'm trying to select an item value from DropDownTree which impeded in a RadGrid , in the add new record in the radGrid then select the item from dropdownTree , but i can't find a way to access the radgrid cell to update its value by the  DropDownTree value , 

the scenario is get the itemCode value from DropDownTree  then search in Database to get the Item Price then put the price in the RadGrid

 Protected Sub RadDropDownTree1_EntryAdded(sender As Object, e As DropDownTreeEntryEventArgs)
        GetItemPrice(e.Entry.Value)
    End Sub
    Private Sub GetItemPrice(Item_code As Int32)
        Dim ConnString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
        Dim conn As SqlConnection = New SqlConnection(ConnString)
        Dim command As SqlCommand = New SqlCommand()
        Dim myreader As SqlDataReader
        command.CommandText = "[dbo].[FindItemPrice]"
        command.CommandType = CommandType.StoredProcedure
        conn.Open()
        command.Connection = conn
        command.Parameters.AddWithValue("ItemCode", Item_code)

        Try
            myreader = command.ExecuteReader()

            If myreader.Read() Then
                Dim ItemGrid As RadGrid = CType(Page.Master.FindControl("MainContent").FindControl("RadGrid2"), RadGrid)



                For Each item As GridDataItem In ItemGrid.MasterTableView.Items
                    Dim tx As TextBox = TryCast(item.FindControl("Price"), TextBox)
                    tx.Text = myreader("Unit_Price")
                Next

            Else

            End If

            conn.Close()
        Catch ex As Exception
            Throw ex
        End Try
    End Sub
Attila Antal
Telerik team
 answered on 22 Oct 2021
1 answer
378 views

Ok, so I am working on a project where inside a RadWizard control I am adding dynamically creating RadDropDownList controls.

RadDropDownList ddl = new RadDropDownList() { ID = string.Format("FrmDDL{0}", i) };


I then call a method to select the selected RadDropDownListItem (Now using every method I can think of to select the value) (The RadDropDownList is passed to the method as 'r')

foreach (DropDownListItem l in r.Items)
{
    if (string.Compare(value, l.Value) == 0) 
    { 
        l.Selected = true; 
        r.SelectedIndex = i; 
        r.SelectedValue = l.Value; 
        r.SelectedText = l.Text; 
    }
    i++;
}

 

Now where it gets interesting is when you look at the generated code


<div id="FrmDDL0" class="RadDropDownList" style="width:300px;" tabindex="0">
    <span class="rddlInner">
        <span class="rddlFakeInput">X4</span>
        <span class="rddlIcon"><!-- &nbsp; --></span>
    </span>
    <div class="rddlSlide" id="FrmDDL0_DropDown" style="display:none;">
        <div class="rddlPopup rddlPopup_SI">
            <ul class="rddlList">
                <li class="rddlItem">&nbsp;</li>
                <li class="rddlItem">X1</li>
                <li class="rddlItem">X2</li>
                <li class="rddlItem">X3</li>
                <li class="rddlItem  rddlItemSelected">X4</li>
            </ul>
        </div>
    </div>
<input id="FrmDDL0_ClientState" name="FrmDDL0_ClientState" type="hidden" autocomplete="off">
</div>

You can clearly see that the _ClientState control is not populated with the selected value even though the <li> item has the 'rddlItemSelected' class. For comparison this is what it looks like if I selected a value from the RadDropDownList from the UI.


<input id="FrmDDL0_ClientState" name="FrmDDL0_ClientState" type="hidden" autocomplete="off" value="{&quot;enabled&quot;:true,&quot;logEntries&quot;:[],&quot;selectedIndex&quot;:4,&quot;selectedText&quot;:&quot;X4&quot;,&quot;selectedValue&quot;:&quot;X4&quot;}">

So the question really becomes, when using the RadWizard and its back and forward buttons, how do I persist client selection on a dynamically created RadDropDownList

 

Peter Milchev
Telerik team
 answered on 22 Oct 2021
1 answer
1.2K+ views

So basically when I run my ASP.NET project I get this error, the thing is I used to get this error with Newtonsoft.Json, so what I did I went to my web.config and checked the <bindingRedirect>

<dependentAssembly>
<assemblyIdentityname="Telerik.Web.UI" publicKeyToken="" culture="neutral" />
<bindingRedirectoldVersion="0.0.0.0-2020.2.617.45" newVersion="2020.2.617.45" />
</dependentAssembly>

So after I went to references and checked if the version matched with the web config and it did

 

 

                     
Vessy
Telerik team
 answered on 22 Oct 2021
1 answer
226 views

I have a Radgrid with AllowKeyboardNavigatin="true"

When using the Keyboard arrows to move around the grid, if the arrow comes into a RadDatePicker, or even a System.DateTime datatype, the value changes by 1 month depending on if the up or down arrow was used to enter that cell.

So

1.  The cell becomes dirty just by using the up / down arrow to go past them.

2. The cell actually changes value just by using the arrow to navigate past it.

 

Is there any work around or property I can set to keep this from happening but also allow use of the keyboard arrows?

** If you hold down the ctrl key along with the arrow key this DOES NOT happen.  This could be a hard training topic for my users.

Hopefully there is another way to do this.

Thanks.

 

Roger
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 21 Oct 2021
1 answer
153 views

I have the following RadClientDataSource:

      <telerik:RadClientDataSource runat="server" ID="rdsCounty">
         <DataSource>
            <WebServiceDataSourceSettings ServiceType="GeoJSON">
               <Select Url="Arizona.json" DataType="JSON" ContentType="application/json" />
            </WebServiceDataSourceSettings>
         </DataSource>
      </telerik:RadClientDataSource>

...which is being consumed by a RadMap (along with other RadClientDataSource controls) like so:

         <telerik:RadMap runat="server" ID="rdmTest" Width="800" Height="600">
            <ClientEvents OnShapeCreated="configureShape" OnShapeClick="clickShape" OnLoad="zoomToContiguousUSA" />
            <LayersCollection>
               <telerik:MapLayer Type="Bing" Key="my key here" />
               <telerik:MapLayer Type="Shape" ClientDataSourceID="rdsState" />
               <telerik:MapLayer Type="Shape" ClientDataSourceID="rdsCounty" />
            </LayersCollection>
         </telerik:RadMap>


Is it possible to change the URL from "Arizona.json" to "Illinois.json"? I want to do this on the client, using javascript, in response to user action. I've looked at the client side API for the RadClientDataSource and I don't see how this could be done. I could also load Illinois.json manually, but I've tried something like this:

                     map.layers[2].setDataSource(JSON.parse(IllinoisFileContents));

...but that doesn't seem to work.

Is there a proper technique for this?

Vessy
Telerik team
 answered on 21 Oct 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
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
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?