Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
273 views
Basically what I'm trying to accomplish with a custom AdvancedForm, is that when the user changes one dropdown value, it will repopulate another. I have a Client dropdown, and clients have services assigned to them. When the client changes, I need to pull in the appropriate services they have based on what comes back from the database.

Currently I'm using ResourceControl.ascx which is just the single drop-down list. When the resources are initially being populated with the RadScheduler, I set them all to Available = false to hide them until the Client resource's RadComboBox index changes. 

I am currently using the following code to wire up the desired ComboBox on my AdvancedForm

RadComboBox cbClient = AdvancedForm.FindControl("ResClient").FindControl("ResourceValue") as RadComboBox;
//RadComboBox cbClient = e.Container.FindControl("ResClient") as RadComboBox; <- THIS DOESN'T WORK
if (cbClient != null)
{
    cbClient.AutoPostBack = true;
    cbClient.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(cbClient_SelectedIndexChanged);
}

I've hacked together a solution that partially works, but I am unable to use Attributes or the properties of a Resource 

protected void cbClient_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
    //RadComboBox rcb = (RadComboBox)sender;
    //RadSchedulerAdvancedFormResourceControl ctrl = (RadSchedulerAdvancedFormResourceControl)rcb.Parent;
     
    //Gets the resource control contained within the advanced form
    RadSchedulerAdvancedFormResourceControl resourceControl = AdvancedForm.FindControl("ResService") as RadSchedulerAdvancedFormResourceControl;
    //Grabs the ServiceType combo box for binding
    RadComboBox cbServiceType = AdvancedForm.FindControl("ResService").FindControl("ResourceValue") as RadComboBox;
             
    //Casts the sender as a RadComboBox, this was the client dropdown
    //RadComboBox cbClient = (RadComboBox)sender;
    //Declare an instance of a ResourceControl to deserialize the key selected
    RadSchedulerAdvancedFormResourceControl resControl = new RadSchedulerAdvancedFormResourceControl();
    //Will rebind the ServiceType dropdown based on who was selected
    //Since items bound to the control can be objects, they need to be serialized/deserialized
    object resourceKey = null;
    if (e.Value != "NULL")
    {
        resourceKey = DeserializeResourceKey(e.Value);
        //Access the provider
        LaSchedulerProvider provider = PopulateProvider();
        //Bind
        cbServiceType.Items.Clear();
        //cbServiceType.DataSource = provider.LoadClientServices(Convert.ToInt32(resourceKey), AdvancedForm.Start, AdvancedForm.End);
        //cbServiceType.DataValueField = "Key";
        //cbServiceType.DataTextField = "Text";
        //cbServiceType.DataBind();
 
        foreach (Resource clientResource in provider.LoadClientServices(Convert.ToInt32(resourceKey), AdvancedForm.Start, AdvancedForm.End))
        {
            clientResource.Available = true;
 
            cbServiceType.Items.Add(new RadComboBoxItem(clientResource.Text, SerializeResourceKey(clientResource.Key)));
        }
        cbServiceType.Items.Insert(0, new RadComboBoxItem("-", "NULL"));
    }
    else
    {
        resourceKey = "";
        cbServiceType.Items.Clear();
        cbServiceType.Items.Insert(0, new RadComboBoxItem("-", "NULL"));
    }

It's involved taking some of the methods from the various controls and making them Public or copying them and just seems really messy.

Is there ANY way this can be accomplished in a clean manner?
Peter
Telerik team
 answered on 09 May 2012
1 answer
93 views
Using the Group by resource vertically in timeline view to create a scheduling system. On a desktop version a single click of an appointment opens up a summary modal of the item in the schedule (bound to the client click event), and dragging allows changing who the appointment is assigned to.

On the iPad the "click" event seems to get lost/confused with a drag event and the summary window never appears. Anyone have thoughts on how it might be possible to fix this?
Peter
Telerik team
 answered on 09 May 2012
1 answer
84 views
Hi Telerik Team,

I am using the RadAsncFileUpload control to upload files and save them them in Database, I have kept the filter for RadAsncFileUpload to allow only word documents, but when i attach other type of the files it shows them as an invalid files but when I click on save button to upload files it does not throw me any error, and does not save in database.

Please help me what should I do in order to validate the RadAsncFileUpload before saving the file in database.
I have tried the following code:
<telerik:RadScriptBlock ID="rcb" runat="server">
    <script type="text/javascript">
        function DeleteInvalidFiles() {
            debugger;
            var upload = $find("<%= RadAsyncFile_Upload.ClientID %>");
            var inputs = upload.getUploadedFiles();
            for (i = inputs.length - 1; i >= 0; i--) {
                if (!upload.isExtensionValid(inputs[i].value))
                    upload.deleteFileInputAt(i);
            }
        }
    </script>
</telerik:RadScriptBlock>

Thanks,
Arvind.
Plamen
Telerik team
 answered on 09 May 2012
1 answer
82 views
I have got the Script error from RadGrid  in OnCancelCommand,OnInsertCommand . I am using custom RadComboBox inside RadGrid, When I choose  ignore command Working fine. But I can I solve these script error?  Please refer to the attachment  screen shot.

Thanks for your time and help.
Tsvetoslav
Telerik team
 answered on 09 May 2012
0 answers
91 views
Hi,

I just came across what seems to be a bug in RadTextBox. When setting the Label with a text (no matter what) and setting the width to a ##em value, an error gets throw. This error does not occur when setting the width in ##px, ##% or just ##, only when "em" is used.

This is the example page I used:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Dashboard.Website.controls.WebForm1" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:ScriptManager runat="server" />
      <telerik:RadTextBox runat="server" ID="txt"  Label="test" Width="12em" />
    </div>
    </form>
</body>
</html>

I've also included a screenshot of the error that is thrown.

Could someone confirm that this is a problem or tell me what I'm doing wrong?

Thanks!
Danny
Danny
Top achievements
Rank 1
 asked on 09 May 2012
0 answers
89 views
but I have a grid size is 350px defcto high if I change my settings and adjust stops coming out, in my case 10 elements by default but if tenfo a paging and said qiuiero see more than 20 items are not adjusted to width of the 20 elements but it creates a vertical scroll is what I qu ene can you tell me how to remove and the higher self

I hope pudding took weeks with this help I tried the metiodos add a lime and place tall worst hidden and does not work
hugo arturo
Top achievements
Rank 1
 asked on 09 May 2012
6 answers
126 views
Hello!

I'm having some problems trying to dynamically create multiple docks at the same time.

What I'd like to achieve is to have multiple Docks added to the DockZone on a button click, but the only thing I get is first Dock properly created and displayed when the rest of them aren't displayed (they are displayed after I refresh the webpage) and they are created but floating outside of the zone.

I have similar scenario when creating one Dock at a time and it works like a charm.

This is the code:
protected void rbAddTickets_Click(object sender, EventArgs e)
        {
            var ticketList = (from t in db.Ticket
                              where t.idManager == idManager && t.Zatvoren == false || t.idManager == null && t.Zatvoren == false
                              select t).ToList();
 
            var memoTicketList = from t in ticketList
                                 where t.Memo == null || t.Memo == false
                                 orderby t.Firma.Naziv, t.idNadredeniTicket, t.RedniBroj, t.Opis
                                 select t;
 
            foreach (var ticket in memoTicketList)
            {
                RadDock dock = new RadDock();
                dock.UniqueName = ticket.idTicket.ToString();
                dock.ID = string.Format("RadDock{0}", dock.UniqueName);
                dock.Title = ticket.idNadredeniTicket + "-" + ticket.RedniBroj + " (" + ticket.Firma.Naziv + ")";
                dock.Text = ticket.Opis;
                dock.DockMode = DockMode.Docked;
                //dock.Index = Convert.ToInt32(Session["MinIndex"]) - 1;
 
 
                dock.Commands.Add(new DockCloseCommand());
                dock.Commands.Add(new DockExpandCollapseCommand());
                dock.Command += new DockCommandEventHandler(DockCommands);
 
                //ticket.Memo = true;
                //db.SaveChanges(); OMOGUĆI KASNIJE
 
                UpdatePanel1.ContentTemplateContainer.Controls.Add(dock);
 
                ScriptManager.RegisterStartupScript(
                dock,
                this.GetType(),
                "AddDock",
                string.Format(@"function _addDock() {{
    Sys.Application.remove_load(_addDock);
    $find('{1}').dock($find('{0}'));
    $find('{0}').doPostBack('DockPositionChanged');
}};
Sys.Application.add_load(_addDock);", dock.ClientID, rdzIncidenti.ClientID),
                true);
                CreateSaveStateTrigger(dock);
 
            }
        }

So, to sum everything up. I would like to generate Docks properly; display them immediately, without having to refresh the page and create them inside DockZone.

Any help would be appreciated.

Regards,

Hrvoje
Hrvach
Top achievements
Rank 1
 answered on 09 May 2012
1 answer
132 views
how can you either "not show" or "disable" the "Add Group" portion of the telerik Rad filter????
screen shot attached.

 

 

<telerik:RadFilter ID="WorkOrdersRadFilter" runat="server" Skin="WebBlue" ShowApplyButton="true"

 

 

 

OnApplyExpressions="WorkOrdersRadFilter_Apply" ApplyButtonText="Filter Work Orders"

 

 

 

OnPreRender="WorkOrdersRadFilter_PreRender" OnFieldEditorCreating="RadFilter_FieldEditorCreating" OnItemCommand="WorkOrdersRadFilter_ItemCommand">

 

 

 

 

<FieldEditors>

 

 

 

<telerik:RadFilterTextFieldEditor FieldName="WORKORDERNUMBER" DisplayName="Work Order#"

 

 

 

DataType="System.String" />

 

 

 

<goldcustom:RadFilterComboBoxEditor FieldName="WOTYPENAME" DisplayName="WO Type"

 

 

 

DataTextField="WOTYPENAME" DataSourceID="WorkOrderTypeFilterODS" DataType="System.String"

 

 

 

ComboBoxSkin="WebBlue" />

 

 

 

</FieldEditors>

 

 

 

 

 

</telerik:RadFilter>

 

Pavlina
Telerik team
 answered on 09 May 2012
0 answers
101 views
Hi,
I am using 2 Radlistbox for item transfer from source to destination.
the double click and arrow button working fine completely in FireFox but it's working partially in IF8 means getting following issues in IE8:

1.       By double click on one item then all the rest items are moving.

2.       some item is not moving By double click 


please support

Thanks & Regards,
Santhosh Naik
Santhosh
Top achievements
Rank 1
 asked on 09 May 2012
6 answers
304 views
I have a radgrid in a user control and am using the following code to capture and retain the scroll bar position after a postback

 

<ClientSettings EnablePostBackOnRowClick="True" EnableRowHoverStyle="True">

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" ScrollHeight="295px" />

 

 

<ClientEvents OnScroll="SetScrollPosition" />

 

 

<Resizing AllowColumnResize="True" />

 

 

</ClientSettings>

 

<

 

script type="text/javascript">

 

 

 

 

function

 

SetScrollPosition() {

 

 

var y = DBSearch1_RadGrid1_GridData.scrollTop;

 

document.cookie =

"divPos=!^^->" + y + "<-^^!";

 

}

window.onload =

function() {

 

 

var cook = document.cookie;

 

 

if (cook.indexOf("!^^->") != 0) {

 

 

var start = cook.indexOf("!^^->");

 

 

var end = cook.indexOf("<-^^!");

 

 

var pos = cook.substring(start + 5, end);

 

window.setTimeout(

function() {

 

DBSearch1_RadGrid1_GridData.scrollTop.scrollTop = pos;

}, 0);

}

 

}

 

</

 

script>

The problem I am encountering is that the scroll bar does get set to the value of 'pos'  but within a split second it gets reset and is at the first record in the datagrid after a postback. I was wondering if any one has encountered similar issues. Thx

 

Maria Ilieva
Telerik team
 answered on 09 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?