Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
199 views
<%@ Page Language="C#" Title="Manage City Records" AutoEventWireup="true" CodeFile="Cities.aspx.cs" MasterPageFile="~/MasterPage.master" Inherits="admin_Cities" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Main1" runat="Server">

    <telerik:RadWindowManager RenderMode="Lightweight" runat="server" ID="RadWindowManager1"></telerik:RadWindowManager>
    <script type="text/javascript">

        function alertCallBackFn(arg) {
            //console.log(arg);


        }

    </script>

    <!-- PAGE HEADER -->
    <div class="container-fluid page-header-container">
        <div class="row page-header-row">
            <div class="col page-header-col-left">
                <h1>Manage City Records</h1>
            </div>
        </div>
    </div>
    <!-- / PAGE HEADER -->

    <div class="dataList">
        <div class="container-fluid">
            <div class="row">
                <div class="col">
                    <form id="form1">
                        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                            <AjaxSettings>
                                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                                    <UpdatedControls>
                                        <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                                    </UpdatedControls>
                                </telerik:AjaxSetting>
                            </AjaxSettings>
                        </telerik:RadAjaxManager>
                        <div id="demo" class="demo-container no-bg">
                            <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" DataSourceID="SqlDataSource1" runat="server" ShowStatusBar="true"
                                AutoGenerateColumns="False" PageSize="10" AllowSorting="True" AllowMultiRowSelection="False"
                                AllowPaging="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
                                AllowAutomaticUpdates="True" OnItemUpdated="RadGrid1_ItemUpdated" OnItemDeleted="RadGrid1_ItemDeleted"
                                OnItemInserted="RadGrid1_ItemInserted" OnInsertCommand="RadGrid1_InsertCommand"
                                OnItemCreated="RadGrid1_ItemCreated" OnPageIndexChanged="RadGrid1_PageIndexChanged" OnLoad="RadGrid1_Load">
                                <PagerStyle Mode="NumericPages"></PagerStyle>
                                <MasterTableView DataSourceID="SqlDataSource1" PageSize="10" DataKeyNames="ID" Width="100%" CommandItemDisplay="Top" Name="City">
                                    <DetailTables>
                                        <telerik:GridTableView DataKeyNames="ID" DataSourceID="SqlDataSource2" Width="100%"
                                            runat="server" CommandItemDisplay="Top" Name="CityLookup">
                                            <ParentTableRelation>
                                                <telerik:GridRelationFields DetailKeyField="CityID" MasterKeyField="ID"></telerik:GridRelationFields>
                                            </ParentTableRelation>
                                            <Columns>
                                                <telerik:GridEditCommandColumn UniqueName="EditCommandColumn2">
                                                    <HeaderStyle Width="20px"></HeaderStyle>
                                                    <ItemStyle CssClass="MyImageButton"></ItemStyle>
                                                </telerik:GridEditCommandColumn>
                                                <telerik:GridBoundColumn SortExpression="ID" HeaderText="ID" HeaderButtonType="TextButton"
                                                    DataField="ID" UniqueName="ID" ReadOnly="true">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn SortExpression="re_city_id" HeaderText="City ID" HeaderButtonType="TextButton"
                                                    DataField="re_city_id" UniqueName="CityID" ReadOnly="true">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn SortExpression="OriginalCity" HeaderText="Original City" HeaderButtonType="TextButton"
                                                    DataField="OriginalCity" UniqueName="OriginalCity">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn SortExpression="OriginalStprov" HeaderText="Original State/Province"
                                                    HeaderButtonType="TextButton" DataField="OriginalStprov" UniqueName="OriginalStprov">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn SortExpression="OriginalCountry" HeaderText="Original Country" HeaderButtonType="TextButton"
                                                    DataField="OriginalCountry" UniqueName="OriginalCountry">
                                                </telerik:GridBoundColumn>
                                                 <telerik:GridCheckBoxColumn  HeaderText="Enable Correction" HeaderButtonType="TextButton"
                                                    DataField="EnableCorrection" UniqueName="EnableChildCorrection" DataType="System.Boolean" >
                                                </telerik:GridCheckBoxColumn>
                                                <telerik:GridButtonColumn ConfirmText="Are you sure you want to delete this record from re_citylookup?"
                                                    CommandName="Delete" Text="Delete" UniqueName="DeleteColumn2">
                                                    <HeaderStyle Width="20px"></HeaderStyle>
                                                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle>
                                                </telerik:GridButtonColumn>
                                            </Columns>
                                            <SortExpressions>
                                                <telerik:GridSortExpression FieldName="OriginalCity"></telerik:GridSortExpression>
                                            </SortExpressions>
                                        </telerik:GridTableView>
                                    </DetailTables>
                                    <Columns>
                                        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                            <ItemStyle CssClass="MyImageButton"></ItemStyle>
                                        </telerik:GridEditCommandColumn>
                                        <telerik:GridBoundColumn SortExpression="ID" HeaderText="ID" HeaderButtonType="TextButton"
                                            DataField="ID" UniqueName="ID" ReadOnly="true">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="City" HeaderText="City" HeaderButtonType="TextButton"
                                            DataField="City" UniqueName="City">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="State" HeaderText="State" HeaderButtonType="TextButton"
                                            DataField="State" UniqueName="State">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="Country" HeaderText="Country" HeaderButtonType="TextButton"
                                            DataField="Country" UniqueName="Country">
                                        </telerik:GridBoundColumn>
                                          <telerik:GridCheckBoxColumn  HeaderText="Enable Correction" HeaderButtonType="TextButton"
                                                    DataField="EnableCorrection" UniqueName="EnableCorrection" DataType="System.Boolean">
                                                </telerik:GridCheckBoxColumn>
                                        <telerik:GridButtonColumn ConfirmText="Deleting this record from re_city will also remove child records from re_citylookup table. Are you sure you want to delete this?"
                                            CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                                            <HeaderStyle Width="20px"></HeaderStyle>
                                            <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle>
                                        </telerik:GridButtonColumn>
                                    </Columns>
                                    <SortExpressions>
                                        <telerik:GridSortExpression FieldName="City"></telerik:GridSortExpression>
                                    </SortExpressions>
                                </MasterTableView>
                            </telerik:RadGrid>
                        </div>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                            DeleteCommand="DELETE FROM [dbo].[re_citylookup] WHERE [re_city_id] = @ID; DELETE FROM [dbo].[re_city] WHERE [ID] = @ID"
                            InsertCommand="IF(((SELECT COUNT(1) FROM [dbo].[re_city] WHERE [City] = @City AND [State] = @State AND [Country] = @Country) = 0) AND ((SELECT COUNT(1) FROM [dbo].[re_citylookup] WHERE [OriginalCity] = @City AND [OriginalStprov] = @State AND [OriginalCountry] = @Country) = 0)) BEGIN INSERT INTO [dbo].[re_city] ([City], [State], [Country]) VALUES (@City, @State, @Country); INSERT INTO [dbo].[re_citylookup]([re_city_id], [OriginalCity], [OriginalStprov], [OriginalCountry]) SELECT TOP 1 ID, @City, @State, @Country FROM [dbo].[re_city] WHERE [City] = @City AND [State] = @State AND [Country] = @Country ORDER BY ID DESC; END; ELSE BEGIN THROW 99001, 'City Already Exists', 1; END;"
                            SelectCommand="SELECT * FROM [dbo].[re_city]"
                            UpdateCommand="UPDATE [dbo].[re_city] SET [City] = @City, [State] = @State, [Country] = @Country WHERE [ID] = @ID">
                            <DeleteParameters>
                                <asp:Parameter Name="ID" Type="Int32"></asp:Parameter>
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="City" Type="String"></asp:Parameter>
                                <asp:Parameter Name="State" Type="String"></asp:Parameter>
                                <asp:Parameter Name="Country" Type="String"></asp:Parameter>
                            </InsertParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="City" Type="String"></asp:Parameter>
                                <asp:Parameter Name="State" Type="String"></asp:Parameter>
                                <asp:Parameter Name="Country" Type="String"></asp:Parameter>
                                <asp:Parameter Name="ID" Type="Int32"></asp:Parameter>
                               
                            </UpdateParameters>
                        </asp:SqlDataSource>
                        <asp:SqlDataSource ID="SqlDataSource2" runat="server"
                            DeleteCommand="DELETE FROM [dbo].[re_citylookup] WHERE [ID] = @ID"
                            InsertCommand="IF((SELECT COUNT(1) FROM [dbo].[re_citylookup] WHERE [OriginalCity] = @OriginalCity AND [OriginalStprov] = @OriginalStprov AND [OriginalCountry] = @OriginalCountry) = 0) BEGIN INSERT INTO [dbo].[re_citylookup] ([re_city_id], [OriginalCity], [OriginalStprov], [OriginalCountry]) VALUES (@CityID, @OriginalCity, @OriginalStprov, @OriginalCountry) END ELSE BEGIN THROW 99001, 'City Already Exists', 1; END"
                            SelectCommand="SELECT [ID], [re_city_id], [OriginalCity], [OriginalStprov], [OriginalCountry],[EnableCorrection] FROM [dbo].[re_citylookup] WHERE [re_city_id] = @CityID"
                            UpdateCommand="UPDATE [dbo].[re_citylookup] SET [OriginalCity] = @OriginalCity, [OriginalStprov] = @OriginalStprov, [OriginalCountry] = @OriginalCountry WHERE [ID] = @ID">
                            <SelectParameters>
                                <asp:Parameter Name="CityID" Type="Int32"></asp:Parameter>
                            </SelectParameters>
                            <DeleteParameters>
                                <asp:Parameter Name="ID" Type="Int32"></asp:Parameter>
                            </DeleteParameters>
                            <InsertParameters>
                                <asp:Parameter Name="CityID" Type="Int32"></asp:Parameter>
                                <asp:Parameter Name="OriginalCity" Type="String"></asp:Parameter>
                                <asp:Parameter Name="OriginalStprov" Type="String"></asp:Parameter>
                                <asp:Parameter Name="OriginalCountry" Type="String"></asp:Parameter>
                            </InsertParameters>
                            <UpdateParameters>
                                <asp:Parameter Name="OriginalCity" Type="String"></asp:Parameter>
                                <asp:Parameter Name="OriginalStprov" Type="String"></asp:Parameter>
                                <asp:Parameter Name="OriginalCountry" Type="String"></asp:Parameter>
                                <asp:Parameter Name="ID" Type="Int32"></asp:Parameter>
                            </UpdateParameters>
                        </asp:SqlDataSource>
                    </form>
                </div>
            </div>
        </div>
    </div>

</asp:Content>
Doncho
Telerik team
 answered on 12 Jul 2022
0 answers
124 views

 

 

<radCLB:CallbackDropDownList runat="server" ID="OrgPropertyStateList" Width="209px"       OnSelectedIndexChanged="OrgPropertyStateList_SelectedIndexChanged" AutoPostBack="True"                         ControlsToUpdate="pnlSearches;EmploymentTypeSection;divApplicantSalarySelection;divPropertyCitySelection;divPropertyCountySelection" ClientEvents-OnRequestSent="ValidateDateOfBirthAllowedForState">
<asp:ListItem>Unbound</asp:ListItem>
</radCLB:CallbackDropDownList>
Alex
Top achievements
Rank 1
 asked on 11 Jul 2022
2 answers
294 views

Hi, I'm trying to put focus on filter input in DropdownTree control when dropdown is opened but I can't get it. I've tryed with some code like this but without success:

 

JS:
            function SetFilterFocus(sender,argEvent){
                sender.get_filterElement().focus();
            }

ASP.NET
                                            <telerik:RadDropDownTree CssClass="RadComboBox_Metro" Skin="Metro" runat="server" ID="ddt_centro" AutoPostBack="true" Width="90%" TabIndex="3" DataTextField="FMODES" DataFieldID="FMOFAM" TextMode="Default" DataFieldParentID="FMOZU1" OnClientEntryAdding="OnClientEntryAdding" ExpandNodeOnSingleClick="true" CheckNodeOnClick="true" EnableFiltering="true" OnClientDropDownOpened="SetFilterFocus">
                                                <FilterSettings Filter="Contains" Highlight="Matches" MinFilterLength="3" />
                                                <DropDownSettings CssClass="RadComboBox_Metro" Height="300px" CloseDropDownOnSelection="true" />
                                            </telerik:RadDropDownTree>

 

 

Is it possible to do this?

 

Thanks

David
Top achievements
Rank 1
Iron
 answered on 08 Jul 2022
1 answer
126 views

How can i make a popup on a layer click with information (name,etc...).

On Telerik Radmap Asp.net

 

Attila Antal
Telerik team
 answered on 04 Jul 2022
0 answers
120 views

Hey all, l was wondering how I would go about removing these huge gaps on my <li> upon export.  I'm placing dynamic values from state. I attached the before and after images.

 

<ol className="contract-details-one">
<li>
Event Date:
<strong className="field-highlight"> {eventDate}</strong>

</li>

</ol>

Vaughn
Top achievements
Rank 1
 asked on 01 Jul 2022
2 answers
276 views

If I attempt to ajaxify an asp.net textbox using RadAjaxManager, obviously, a div with a RadAjaxPanel class surround the div with the "form-floating" class.

When that situation occurs the placeholder duplicates 11px above the current one. In addition, when you put the cursor in the textbox field, the floating label doesn't "float". It remains where it is and conflicts with the newly entered text in the textbox.

 

Any suggestions?

Dana

Dana Cobb
Top achievements
Rank 1
Iron
 answered on 29 Jun 2022
1 answer
493 views

I have a grid.  It has a MasterTableView and a DetailTables with a GridTableView that has a CommandItemTemplate.  In the DetailTableDataBind event I need to hide a button when certain conditions apply.  I can't for the life of me figure out how to access these buttons.  I can get to the buttons in the MasterTableView's CommandItemTemplate, but not the Detail Table. 

Anyone know how to access these little buggers?  VB.NET if at all possible...please and thank you.  if you need for me to post my grid structure I can.  

Attila Antal
Telerik team
 answered on 29 Jun 2022
1 answer
160 views

Hi Team,

As I am trying use Radalert box to show the validation messages from javascript function. (Earlier we were using normal alert for validation messages).

I am able to get the radalert pop up but unable to see the messages on it as its blank box.

Please advise me on this.

Thanks in Advance

Vijaykumar

 

Code :

 

if (grid.get_masterTableView().get_selectedItems()[0] != undefined) {
        selRequestRowID = grid.get_masterTableView().getCellByColumnUniqueName(grid.get_masterTableView().get_selectedItems()[0], 'REQUESTINFO_ID').innerHTML;
    } else if (!all) {
        //alert(alertNothingSelected);
        radalert("Please select a record", 290, 220, "Alert"); //this is the message want show it on UI
        return false;
    }

 

As I can see it in debugger mode the line is executing without any error and even I can see the pop up box with my css .

 

Peter Milchev
Telerik team
 answered on 29 Jun 2022
1 answer
265 views
How can I pop up a custom list of available tasks that a user is allowed to add to the gantt chart.  Preferably a different list depending on the level they are adding the child to.  Any examples of this concept would be great!
Peter Milchev
Telerik team
 answered on 28 Jun 2022
1 answer
273 views

I have added a custom button in place of the "Add Task" but can't seem to figure out how I can find the selected task from the gantt chart in javascript.  I am trying to force a popup so that the user can only select from a list of items to add as a task, depending on level they are selecting.  Any samples or ideas would be great.

Thanks!

Peter Milchev
Telerik team
 answered on 28 Jun 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?