Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
83 views
I don't see a delete post option...
sqlgod
Top achievements
Rank 1
 asked on 01 Mar 2011
3 answers
112 views
On the Day, Week, and Month buttons located at the top right corner of the scheduler, we see black dots appear over the text.  Is there any resolution to this?

Thanks in advance.
André
Top achievements
Rank 1
 answered on 01 Mar 2011
4 answers
431 views
hi. I've got a asp:button on my formtemplate. when i call it from the insert form, i get passed a grideditform item. but when i call it from the update form, i get passed a griddataitem. i need to access the controls on this form and can't seem to get to them from the griddataitem. please help.

thanks!

.aspx
    <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
    <telerik:RadGrid ID="RadGrid4" runat="server"
    AllowPaging="True" PageSize="20" AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource4" OnNeedDataSource="RadGrid4_NeedDataSource"
    OnItemCreated="RadGrid4_ItemCreated" OnInsertCommand="RadGrid4_InsertCommand" OnUpdateCommand="RadGrid4_UpdateCommand" OnDeleteCommand="RadGrid4_DeleteCommand"
    OnItemCommand="RadGrid4_ItemCommand"
    GridLines="None">
<MasterTableView datakeynames="GeoLocationId" datasourceid="SqlDataSource4" CommandItemDisplay="TopAndBottom">
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
 
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
 
    <Columns>
        <telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column">
        </telerik:GridEditCommandColumn>
        <telerik:GridButtonColumn FilterControlAltText="Filter column column"
            Text="Delete" UniqueName="column" CommandName="Delete"
            ConfirmDialogType="Classic" ConfirmTitle="Confirm Data Center Delete" ConfirmText="Are you sure you want to delete this Data Center?">
        </telerik:GridButtonColumn>
        <telerik:GridBoundColumn DataField="GeoLocationId" DataType="System.Int32"
            FilterControlAltText="Filter GeoLocationId column" HeaderText="Data Center ID"
            ReadOnly="True" SortExpression="GeoLocationId" UniqueName="GeoLocationId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Name"
            FilterControlAltText="Filter Name column" HeaderText="Location"
            SortExpression="Name" UniqueName="Name">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Description"
            FilterControlAltText="Filter Description column" HeaderText="Name"
            SortExpression="Description" UniqueName="Description">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Latitude"
            FilterControlAltText="Filter Latitude column" HeaderText="Latitude"
            SortExpression="Latitude" UniqueName="Latitude">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Longitude"
            FilterControlAltText="Filter Longitude column" HeaderText="Longitude"
            SortExpression="Longitude" UniqueName="Longitude">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="LoadBalancer"
            FilterControlAltText="Filter LoadBalancer column" HeaderText="LoadBalancer"
            SortExpression="LoadBalancer" UniqueName="LoadBalancer">
        </telerik:GridBoundColumn>
    </Columns>
 
<EditFormSettings EditFormType="Template">
<EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn>
    <FormTemplate>
        <table border="0" cellpadding="1" cellspacing="2" width="100%" rules="none" style="border-collapse: collapse; background: white;" id="table1">
            <tr>
                <td><asp:Label runat="server" ID="lblGeoLocationId" Text="Data Center ID:"></asp:Label></td>
                <td><asp:TextBox runat="server" ID="txtGeoLocationId" Enabled="false" Text='<%# Bind("GeoLocationId") %>'></asp:TextBox></td>
            </tr>
            <tr>
                <td>Name:</td>
                <td>
                    <asp:TextBox runat="server" ID="txtDescription" Text='<%# Bind("Description") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator runat="server" ControlToValidate="txtDescription" Text="The Name field is required!"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>Load Balancer:</td>
                <td>
                    <asp:TextBox runat="server" ID="txtLoadBalancer" Text='<%# Bind("LoadBalancer") %>'></asp:TextBox>
                    <asp:Button runat="server" ID="btnLoadBalancer" Text="Get Geographic Data" CommandName="GeoLookup" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtLoadBalancer" Text="The Load Balancer field is required!"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="revLoadBalancer" runat="server" ControlToValidate="txtLoadBalancer" ErrorMessage="Please enter a valid IP Address." ValidationExpression="\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <td>Location:</td>
                <td>
                    <asp:TextBox runat="server" ID="txtName" Enabled="false" Text='<%# Bind("Name") %>'></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>Latitude:</td>
                <td>
                    <asp:TextBox runat="server" ID="txtLatitude" Enabled="false" Text='<%# Bind("Latitude") %>'></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>Longitude:</td>
                <td>
                    <asp:TextBox runat="server" ID="txtLongitude" Enabled="false" Text='<%# Bind("Longitude") %>'></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" colspan="2">
                    <asp:Button ID="btnUpdate" runat="server" Text='<%#  (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' />
                      
                    <asp:Button ID="btnCancel" runat="server" Text="Cancel" CausesValidation="false" CommandName="Cancel" />
                </td>
            </tr>
        </table>
    </FormTemplate>
</EditFormSettings>
</MasterTableView>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
 
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
    </telerik:RadGrid>
    <asp:SqlDataSource ID="SqlDataSource4" runat="server"
    ConnectionString="<%$ ConnectionStrings:MgmtServerConnectionString %>"
    SelectCommand="SELECT [GeoLocationId], [Name], [Description], [Latitude], [Longitude], [LoadBalancer] FROM [GeoLocation] ORDER BY [GeoLocationId]"></asp:SqlDataSource>
.aspx.cs
protected void RadGrid4_ItemCommand(object source, GridCommandEventArgs e)
{
    string strCommandName = e.CommandName;
    if (e.CommandName == "GeoLookup")
    {
        if (e.Item is GridEditFormItem || e.Item is GridDataItem)
        {
            // instantiate form objects
            TextBox loadBalancer = null;
            TextBox location = null;
            TextBox latitude = null;
            TextBox longitude = null;
            RegularExpressionValidator revLoadBalancer = null;
 
            if (e.Item is GridEditFormItem)
            {
                GridEditFormItem item = e.Item as GridEditFormItem;
 
                // retrieve the controls from the edit form
                location = (TextBox)item.FindControl("txtName");
                latitude = (TextBox)item.FindControl("txtLatitude");
                longitude = (TextBox)item.FindControl("txtLongitude");
                loadBalancer = (TextBox)item.FindControl("txtLoadBalancer");
                revLoadBalancer = (RegularExpressionValidator)item.FindControl("revLoadBalancer");
            }
 
            if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
 
                // retrieve the controls from the edit form
                location = (TextBox)item.FindControl("txtName");
                latitude = (TextBox)item.FindControl("txtLatitude");
                longitude = (TextBox)item.FindControl("txtLongitude");
                loadBalancer = (TextBox)item.FindControl("txtLoadBalancer");
                revLoadBalancer = (RegularExpressionValidator)item.FindControl("revLoadBalancer");
            }
             
            string txtLoadBalancer = loadBalancer.Text;
            bool blnLoadBalancer = this.txtLoadBalancer_IsValidIP(txtLoadBalancer);
            if (blnLoadBalancer)
            {
                try
                {
                    string results = MgmtServer.App_Code.CalculateDistanceToCoast.GeoLookup(txtLoadBalancer);
                    if (results != "" && (results.IndexOf("IP_NOT_FOUND") == -1))
                    {
                        string[] Args = results.Split(new Char[] { ',' });
                        string strLocation = Convert.ToString(Args[0]) + "," + Convert.ToString(Args[1]) + "," + Convert.ToString(Args[2]);
                        string strLatitude = Convert.ToString(Args[4]);
                        string strLongitude = Convert.ToString(Args[5]);
 
                        // update the control values
                        location.Text = strLocation;
                        latitude.Text = strLatitude;
                        longitude.Text = strLongitude;
                    }
                    else
                    {
                        MgmtServer.App_Code.MgmtServerLib.SaveErrorTrackingOnTable(MgmtServer.App_Code.MgmtServerLib.Broad_CallingGeolookupReturn_Error);
                        Label1.Text = "Geographic Data Lookup returned nothing";
                    }
                }
                catch (Exception ex)
                {
                    MgmtServer.App_Code.MgmtServerLib.SaveErrorTrackingOnTable(MgmtServer.App_Code.MgmtServerLib.Broad_CallingGeolookup_Error, ex.Message, txtLoadBalancer);
                    Label1.Text = "An exception occurred calling geolookup: " + ex.Message + ":" + txtLoadBalancer;
                }
            }
            else
            {
                revLoadBalancer.ErrorMessage = "Please enter a valid IP Address.";
                revLoadBalancer.IsValid = false;
                revLoadBalancer.Validate();
            }
        }
    }
}
areen
Top achievements
Rank 1
 answered on 01 Mar 2011
0 answers
71 views
Looking for a way to store open tabs names in a database so they can be restored upon reopening in the event of a browser or computer crash. 

I would like to use C# functions which would make or delete entries in the database when the user opens or closes a tab. Running into issues calling a C# function from JavaScript. Any idea's?

Also is there an option which would allow the user to reorder the tabs?

Thanks,

Geoff
Geoffrey
Top achievements
Rank 1
 asked on 01 Mar 2011
5 answers
105 views
Hi,

I have a treeview inside a combobox, and i have hooked up a javasript that uncheckes any previus nodes, according to this article,
http://www.telerik.com/help/aspnet/treeview/tree_unchecknodebycheckinganothernode.html

But i cant get the script working, could it be becouse of the treeview being inside of a panelbar and/or a combobox, and if so, would anyone have a solution for this?

<asp:Content ID="Content3" ContentPlaceHolderID="phContent" Runat="Server">
<script type="text/javascript" language="javascript">
   var oldNode;
   function UpdateStatus(node)
   {
       if(oldNode != null)
       {
       oldNode.UnCheck();
       }
       node.Check();
       oldNode = node;
   }
</script>
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    </telerik:RadAjaxManagerProxy>
      
    <table cellspacing="0" width="100%">
  
<%--
Om man är inloggad som Admin ska man komma direkt till Steg 2
--%>
<tr align="center">
<td align="center" style="padding-top:100px;">
    <telerik:RadPanelBar ID="pbCaseRegistration" Runat="server" Skin="Windows7" 
        Width="500px" ExpandMode="SingleExpandedItem">
        <Items>
              
            <telerik:RadPanelItem runat="server" Text="1 - Ärendeinformation" Expanded="true">
                <Items>
                    <telerik:RadPanelItem runat="server" Value="panCaseinfo">
                        <ItemTemplate>
                            <table class="text" style="padding:10px;" cellspacing=0 width=100%>
                            <tr>
                            <td align=center>
                                <asp:Image ID="imgCaseType" runat="server" ImageUrl="images/infoIcon2.jpg" /><asp:Label ID="Label1" runat="server" Text="Ärendetyp"></asp:Label><br />
                                  
                                       <telerik:RadComboBox ID="cmbCaseType" runat="server" Skin="Windows7" Height="160px" Style="vertical-align: middle;" Width="225px">
                                            <ItemTemplate>
                                                <div id="div1">
                                                  
                                                    <telerik:RadTreeView ID="tvCaseType" runat="server" CheckBoxes="True" 
                                                        Height="160px" Width="100%" AfterClientCheck="UpdateStatus">
                                                          
                                                    </telerik:RadTreeView>
Christian
Top achievements
Rank 1
 answered on 01 Mar 2011
5 answers
247 views
Hi There,

I have a RadCombobox that is placed on a CommandItemTemplate and in my SqlDataSource Selecting event there I need to get the SelectedValue from the RadCombobox. I have tried to use the FindControl function but I can't get it to work so I would be happy if you could tell me how this is done :)

Thanks
Hendrik Johns

Shumaila Imran
Top achievements
Rank 1
 answered on 01 Mar 2011
3 answers
708 views
Hi

In radgrid i'm rebinding data in edit. so i couldn't maintain its scroll postion.

Even i've set "SaveScrollPosition=true"

NOTE : its working fine when i take off ajax setting to rad grid and Load button. but its not tracking its scroll position while controls where loaded in ajax panel.

regards,

Baaje
Pavlina
Telerik team
 answered on 01 Mar 2011
1 answer
115 views
Hello everyone,

I created a web user control called MultiSelectDropDown using RadComboBox based on the example Telerik.com provided.
When I drag and drop this control into a web page, It works perfect, My problem is , when the page has 2 or more MultiSelectDropDown ,
Only the one works, for the rest of them, when I click check box items, the text in combo box always empty. I hope some one can help me out.I appreciate it in advanced. Below is code:
ASCX code:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MultiSelectDropDown.ascx.cs" Inherits="G2WebFramework.RebillRejectedData.Controls.MultiSelectDropDown" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>



 <style type="text/css">
     .example-panel
{
    width:352px;
    height: 30px;
    margin: 91px 0 0 68px;
    background: transparent url("Img/background.png") no-repeat 0 0;
}

.example-panel ul.combobox-panel
{
    list-style:none;
    margin:156px 0 0 75px;
    padding:0;
    float:left;
}

.example-panel ul.status-panel
{
    list-style:none;
    padding:0;
    margin:40px 0 0 117px;
    float:left;
}

.example-panel ul.status-panel label
{
    font: 14px 'Segoe UI', Arial, sans-serif;
    color: #fff;
    padding-right: 9px;
}

.example-panel ul.status-panel li
{
    float:left;
    font: 14px 'Segoe UI', Arial, sans-serif;
    color: #ffb400;
    padding-right: 15px;
}

* html ul.combobox-panel
{
    display:inline; /*double margin bug*/
}

.example-panel ul.combobox-panel li
{
    float:left;
}

.example-panel ul.combobox-panel li label
{
    font: 12px 'Segoe UI', Arial;
    color: #fff;
    margin-right: 5px;
    margin-left: 40px;
}

.combo-item-template input,
.combo-item-template label
{
    vertical-align:top;
}

.combo-item-template img
{
    vertical-align:top;
}

.example-panel .rent-button
{
    float:right;
    width: 73px;
    height:21px;
    background: transparent url('Img/button.png') no-repeat 0 0;
    text-decoration:none;
    color: #000;
    text-align:center;
    line-height:21px;
    margin: 18px 30px 0 auto;
}
</style>

<script type="text/javascript">
//        <![CDATA[
            var cancelDropDownClosing = false;
            
            function StopPropagation(e)
            {
                //cancel bubbling
                e.cancelBubble = true;
                if (e.stopPropagation)
                {
                    e.stopPropagation();
                }
            }

            function onDropDownClosing()
            {
                cancelDropDownClosing = false;
            }

            function onCheckBoxClick(chk)
            {
                var combo = $find("<%= RadComboBox1.ClientID %>");
                
                //prevent second combo from closing
                cancelDropDownClosing = true;
                //holds the text of all checked items
                var text = "";
                //holds the values of all checked items
                var values = "";
                //get the collection of all items
                var items = combo.get_items();
                //enumerate all items
                for (var i = 0; i < items.get_count(); i++)
                {
                    var item = items.getItem(i);
                    //get the checkbox element of the current item
                    var chk1 = $get(combo.get_id() + "_i" + i + "_chk1");
                    if (chk1.checked)
                    {
                        text += item.get_text() + "," ;
                        values += item.get_value() + ",";
                    }
                }
                //remove the last comma from the string
                text = removeLastComma(text);
                values = removeLastComma(values);
            
                if (text.length > 0)
                {
                    //set the text of the combobox
                    combo.set_text(text);
                    combo.set_value(text);
                }
                else
                {
                    //all checkboxes are unchecked
                    //so reset the controls
                    combo.set_text("");
                   
                }
            }

            //this method hides the nodes of the treeeview depending on
            //the checked items in the first combobox
           

            //this method removes the ending comma from a string
            function removeLastComma(str)
            {
                return str.replace(/,$/,"");
            }

           

            function OnClientDropDownClosingHandler(sender, e)
            {
                //do not close the second combo if
                //a checkbox from the first is clicked
                e.set_cancel(cancelDropDownClosing);
            }
//         ]]>
        </script>
        
        <%-- <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="all" ControlsToSkip="Scrollbars"></telerik:RadFormDecorator>--%>
                    <telerik:RadComboBox ID="RadComboBox1" runat="server" HighlightTemplatedItems="true"
                                AllowCustomText="true" Width="131px"    
    OnClientDropDownClosed="onDropDownClosing"  ForeColor="Navy"    
    BorderColor="Navy" AutoPostBack="True"  >
    
   
                                <ItemTemplate>
                                   <div id="ListDiv" onclick="StopPropagation(event)" class="combo-item-template" runat="server" >
                                        <asp:CheckBox runat="server" ID="chk1" Checked="false" onclick="onCheckBoxClick(this)" BorderColor="Navy"/>
                                        <asp:Label runat="server" ID="Label1" AssociatedControlID="chk1" ForeColor="Navy">

                                           <%# Eval(RadComboBox1.DataTextField) %>

                                        </asp:Label>
                                   </div>
                                </ItemTemplate>
                      </telerik:RadComboBox>
         
          ____________________________________
C# code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace G2WebFramework.RebillRejectedData.Controls
{
    public partial class MultiSelectDropDown : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                RadComboBox1.DataBind();
            }
               
        }
        

        //selected checkbox text
        public string sText
        {
            get { return RadComboBox1.Text; }
        }

        public Object DataSource
        {
            get { return RadComboBox1.DataSource; }
            set { RadComboBox1.DataSource = value; }
        }

        public string DataTextField
        {
            get { return RadComboBox1.DataTextField; }
            set { RadComboBox1.DataTextField = value; }
        }
        public string DataValueField
        {
            get { return RadComboBox1.DataValueField; }
            set { RadComboBox1.DataValueField = value; }
        }

      
       
    }
}             
   

Testing code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using G2WebBL.DataMappers.RebillRejectedData;

namespace G2WebFramework.RebillRejectedData
{
    public partial class Test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                BindData_Company();
                BindData_LEC();
            }
                
        }

        internal void BindData_Company()
        {

            var DBObj = new RebillRejectedDataAccess("BOSS_SB");
            var DT = DBObj.SelectCompany();
            MultiSelectDropDown1.DataSource = DT;
            MultiSelectDropDown1.DataTextField = "Company";
            MultiSelectDropDown1.DataValueField = "Company";

        }
        internal void BindData_LEC()
        {
            var DBObj = new RebillRejectedDataAccess("BOSS_SB");
            var DT = DBObj.SelectLEC();
            MultiSelectDropDown2.DataSource = null;
            MultiSelectDropDown2.DataSource = DT;
            MultiSelectDropDown2.DataTextField = "LEC";
            MultiSelectDropDown2.DataValueField = "LEC";

        }
        
    }
}          
         
Dimitar Terziev
Telerik team
 answered on 01 Mar 2011
3 answers
51 views
Hi!  I have a RadGrid with a MasterTable and a DetailsTable.  The MasterTable has a column in it with the 'expand' button.  However when I click on the 'expand' button nothing happens. 

I've checked to ensure the 'GridRelationFields' have the correct values for the 'DetailKeyField' and the 'MasterKeyField'.  The MasterTable and the DetailsTable both have columns for these values.

Could someone provide suggestions for troubleshooting?  I have this same logic working on another page in our web application, but must be missing something for this particular page.

Thanks!
Amy
Top achievements
Rank 1
 answered on 01 Mar 2011
2 answers
80 views
Hello,

I have a radiobuttonlist and when I select a certain choice it enables a RadDatePicker and a RequiredFieldValidator. So in my code behind I enable and disable my RequiredFieldValidator. I've found that when my RequiredFieldValidator is updated by my RadAjaxManagerProxy it doesn't validate anymore.

Thanks

Keven
Maria Ilieva
Telerik team
 answered on 01 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?