Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
200 views
Hi,

I like the scheduler control, I want set the scheduler to full screen (day, week, month, timeline) via javascript, and resize it, and it's should keep full size on it parent div, how implement to this?

Thanks and best regards
Plamen
Telerik team
 answered on 31 Aug 2011
2 answers
471 views
Hi,

I am having a radgrid with template columns containing checkboxes and radcombos . And the last  template column is having a radcombobox control.

On client click of checkboxes, if  checkbox is checked radcombo should be enabled , else it should be disabled.
I want to achieve this functionality by using javascript.
Any suggestions or sample code please help..


Thanks & Regards,
siva prasad.

Jayesh Goyani
Top achievements
Rank 2
 answered on 31 Aug 2011
5 answers
273 views
Hi,

I need to disable some of the toolbar icons(Eg: Bold and Italic) on the RadEditor on button click and i should hide these on clientside .how can i achieve this.


Thanks
Srinivas
Rumen
Telerik team
 answered on 31 Aug 2011
6 answers
369 views
Hi,

 I have a simple problem but have been having a frustrating time figuring this out. I have a html table which has two rows 'trExistingCustomer' and 'trNewCustomer'. I have an edit popup form on the grid. I want to show a certain row and hide the other based on what command the grid is trying to do (Inset / Edit). I use Jquery in a RadCodeBlack to do this, I am firing a function on the ClientEvent OnPopUpShowing. how I can I check if this was triggered from Insert comand or Edit command in the javascript. I already tried using the function onCommand (Please see code) I saw another example and thought this might be the relevant function but this is not working and it displays all rows. Can someone please show an example in code how to check for the calling command in the popup function or onCommand to do this right? Also is there a list of all client side events asscociated with the edit form and the grid somewhere, I think that would be helpful to know. Any help is appreciated
HTML table in Edit popup form in RadGrid
  
   <table id="tblEditPopup" style="width:100%; height:100%">
     <tr id="trExistingCustomer" >
                              <td align="right">
                                 Select Existing Customer:
                              </td>
                              <td>
                                  <telerik:RadComboBox  ID="cboxCustomers" runat="server" AutoPostBack="true" DataSourceID="CustomerObjectDataSource" DataTextField="CustomerName" DataValueField="customer_id"  SelectedValue='<%# Bind("customer_id") %>' >
                                     
                                  </telerik:RadComboBox>
                              </td>
                               <td align="right">
                                 Abbreviation:
                               </td>
                              <td>
                                 <asp:TextBox ID="txtCustAbbreviation" runat="server" Text='<%# Bind("CustomerAbbrev") %>' ></asp:TextBox>
                               </td>
                            </tr>
  
                            <tr id="trNewCustomer" >
                               <td align="right">
                                  Customer Name:
                               </td>
                               <td>
                                 <asp:TextBox ID="txtCustomerName" runat="server" Text='<%# Bind("CustomerName") %>' ></asp:TextBox>
                               </td>
                               <td align="right">
                                 Abbreviation:
                               </td>
                               <td>
                                 <asp:TextBox ID="txtNewAbbreviation" runat="server" Text='<%# Bind("CustomerAbbrev") %>'  ></asp:TextBox>
                               </td>
                            </tr>
  
                             
  
                            <tr>
                               <td align="right">
                                  City:
                               </td>
                               <td>
                                 <asp:TextBox ID="txtCity" runat="server" Text='<%# Bind("City") %>' ></asp:TextBox>
                               </td>
                               <td align="right">
                                 State:
                               </td>
                               <td>
                                   <telerik:RadComboBox ID="cboxStates" runat="server" DataSourceID="StatesObjectDataSource" DataTextField="description" DataValueField="description" AutoPostBack="false"  SelectedValue='<%# Bind("State") %>'>
                                           
                                   </telerik:RadComboBox>
                               </td>
                            </tr>
  
                            <tr>
                              <td align="center" colspan="4" style="" >
                                 <asp:Button ID="BtnSubmit"  Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'  /> 
                                 <asp:Button ID="BtnCancel" Text="Cancel" runat="server" CausesValidation="false" CommandName="Cancel" />
                              </td>
                            </tr>
                            
                        </table>
  
  
GRID's CLIENT SIDE EVENTS
 <ClientSettings>
                <ClientEvents OnPopUpShowing="PopUpShowing" OnCommand="onCommand"  />
   </ClientSettings>
  
JAVASCRIPT
  
 <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
        
       var popUp;
                function PopUpShowing(sender, eventArgs) {
                    popUp = eventArgs.get_popUp();
  
                     //This works when the popup comes up but how can I tell if its called from the Edit or Insert command??
                        $('#trExistingCustomer').css('display', 'block');
                        $('#trNewCustomer').css('display', 'none');
  
                                      
                }
  
        //This seems a more logical place to put this but this does not work , is there another command I should be checking for??
         function onCommand(sender, args) {
  
                    if (args.get_commandName() == "InitInsert")        
                   {
                        $('#trExistingCustomer').css('display', 'block');
                        $('#trNewCustomer').css('display', 'none');
                   
                 
                   else if(args.get_commandName() == "InitEdit") {
                        $('#trExistingCustomer').css('display', 'block');
                        $('#trNewCustomer').css('display', 'none');
                   }
  
   </script>
        </telerik:RadCodeBlock>
Farhan
Top achievements
Rank 1
 answered on 31 Aug 2011
2 answers
116 views
Hello!

I'm having some serious issues with RadComboBox which behaves erratically. The problem is I can't bind the data from ItemDataBound event of the RadGrid to the RadComboBox that is inside the UserControl. I always get errors that there is something wrong with binding even though it should work properly.

Here are the code snippets:

TicketUserControl.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TicketUserControl.ascx.cs"
    Inherits="IDE_Ticketing_System__Telerik_.UserControls.TicketUserControl" %>
<table>
    <tr>
        <td>
            NadreÄ‘eni ticket:
        </td>
        <td colspan="3">
            <telerik:RadComboBox ID="rcbNadredeniTicket" DataTextField="OpisTicketa" DataValueField="idTicket"
                AppendDataBoundItems="true" Text='<%# DataBinder.Eval(Container, "DataItem.idNadredeniTicket") %>'
                runat="server" Width="455px">
            </telerik:RadComboBox>
        </td>
    </tr>
    <tr>
        <td>
            Asset:
        </td>
        <td colspan="3">
            <telerik:RadComboBox ID="rcbAsseti" AppendDataBoundItems="true"
                runat="server" Width="455px">
            </telerik:RadComboBox>
        </td>
    </tr>
    <tr>
        <td>
            Opći prioritet:
        </td>
        <td>
            <asp:TextBox ID="txtOpciPrioritet" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.OpciPrioritet") %>'></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
            Tip:
        </td>
        <td>
            <telerik:RadComboBox ID="rcbTip" Text='<%# DataBinder.Eval(Container, "DataItem.Tip") %>'
                runat="server">
            </telerik:RadComboBox>
        </td>
    </tr>
    <tr>
        <td>
            Status:
        </td>
        <td>
            <telerik:RadComboBox ID="rcbStatus" Text='<%# DataBinder.Eval(Container, "DataItem.Status") %>'
                runat="server">
            </telerik:RadComboBox>
        </td>
    </tr>
    <tr>
        <td>
            Datum prijave:
        </td>
        <td>
            <asp:TextBox ID="txtDatumPrijave" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.DatumPrijave") %>'></asp:TextBox>
        </td>
        <td>
            Vrsta prijave:
        </td>
        <td>
            <telerik:RadComboBox ID="rcbVrstaPrijave" Text='<%# DataBinder.Eval(Container, "DataItem.VrstaPrijave") %>'
                runat="server">
            </telerik:RadComboBox>
        </td>
    </tr>
    <tr>
        <td>
            Prioritet:
        </td>
        <td>
            <telerik:RadComboBox ID="rcbPrioritet" Text='<%# DataBinder.Eval(Container, "DataItem.Prioritet") %>'
                runat="server">
            </telerik:RadComboBox>
        </td>
        <td>
            Deadline:
        </td>
        <td>
            <asp:TextBox ID="txtDeadline" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.DatumDo") %>'></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
            Opis:
        </td>
        <td colspan="3">
            <asp:TextBox ID="txtOpis" runat="server" TextMode="MultiLine" Width="455px" Height="200px"
                Text='<%# DataBinder.Eval(Container, "DataItem.Opis") %>'></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
            Zatvoren ticket:
        </td>
        <td>
            <asp:CheckBox ID="chkZatvoren" runat="server" Checked='<%# CheckNull(DataBinder.Eval(Container, "DataItem.Zatvoren")) %>' />
        </td>
    </tr>
    <tr>
        <td>
            Opis zatvorenog ticketa:
        </td>
        <td colspan="3">
            <asp:TextBox ID="txtOpisZatvorenog" runat="server" TextMode="MultiLine" Width="455px"
                Height="200px" Text='<%# DataBinder.Eval(Container, "DataItem.OpisZatvoren") %>'></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
            <asp:Button ID="btnUpdate" Text="Spremi" runat="server" CommandName="Update" Visible='<%# !(DataItem is Telerik.Web.UI.GridInsertionObject) %>'>
            </asp:Button>
            <asp:Button ID="btnInsert" Text="Spremi" runat="server" CommandName="PerformInsert"
                Visible='<%# DataItem is Telerik.Web.UI.GridInsertionObject %>'></asp:Button>
              
            <asp:Button ID="btnCancel" Text="Odustani" runat="server" CausesValidation="False"
                CommandName="Cancel"></asp:Button>
        </td>
    </tr>
</table>

TvrtkaWebForm.aspx (the one with RadGrid)
<telerik:RadGrid ID="gvTicketi" runat="server" AllowPaging="True" AllowSorting="True"
    AutoGenerateColumns="False" CellSpacing="0" GridLines="None"
    onneeddatasource="gvTicketi_NeedDataSource"
    onitemdatabound="gvTicketi_ItemDataBound"
    oninsertcommand="gvTicketi_InsertCommand">
    <MasterTableView DataKeyNames="idTicket" CommandItemDisplay="TopAndBottom" InsertItemPageIndexAction="ShowItemOnCurrentPage">
        <CommandItemSettings AddNewRecordText="Dodaj novi ticket" RefreshText="Prikaži sve tickete" />
        <Columns>
            <telerik:GridBoundColumn UniqueName="idTicket" HeaderText="Ticket" DataField="idTicket">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="idKontakt" HeaderText="Kontakt" DataField="Kontakt">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="idManager" HeaderText="Manager" DataField="idManager">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Opis" HeaderText="Opis" DataField="Opis">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="TicketNumber" HeaderText="Broj ticketa" DataField="TicketNumber">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="DatumPrijave" HeaderText="Datum prijave" DataField="DatumPrijave" DataFormatString="{0:dd.MM.yyyy.}">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="VrstaPrijave" HeaderText="Vrsta prijave" DataField="VrstaPrijave">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Tip" HeaderText="Tip" DataField="Tip">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Status" HeaderText="Status" DataField="Status">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Prioritet" HeaderText="Prioritet" DataField="Prioritet">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="OpciPrioritet" HeaderText="Opći prioritet" DataField="OpciPrioritet">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Deadline" HeaderText="Deadline" DataField="DatumDo" DataFormatString="{0:dd.MM.yyyy.}">
            </telerik:GridBoundColumn>
            <telerik:GridCheckBoxColumn UniqueName="Zatvoren" HeaderText="Zatvoren" DataField="Zatvoren">
            </telerik:GridCheckBoxColumn>
            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
            </telerik:GridEditCommandColumn>
            <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete"
                ConfirmDialogType="RadWindow" ConfirmText="Brisanje ticketa!" />
        </Columns>
        <EditFormSettings UserControlName="UserControls/TicketUserControl.ascx" EditFormType="WebUserControl">
            <EditColumn UniqueName="EditCommandColumn1">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>

TvrtkaWebForm.aspx.cs:
protected void gvTicketi_ItemDataBound(object sender, GridItemEventArgs e)
{
    int idFirma = Convert.ToInt16(Request.QueryString["idt"]);
 
    if ((e.Item is GridEditFormItem) && e.Item.IsInEditMode )
    {
        GridEditFormItem editFormItem = (GridEditFormItem)e.Item;
        UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
 
        TSEntities db = new TSEntities();
        Ticket ticket = new Ticket();
 
        RadComboBox rcbTip = (RadComboBox)userControl.FindControl("rcbTip");
        rcbTip.Items.Add(new RadComboBoxItem("Incident"));
        rcbTip.Items.Add(new RadComboBoxItem("Reklamacija"));
        rcbTip.Items.Add(new RadComboBoxItem("Nova funkcionalnost"));
        rcbTip.DataBind();
 
        RadComboBox rcbStatus = (RadComboBox)userControl.FindControl("rcbStatus");
        rcbStatus.Items.Add(new RadComboBoxItem("New"));
        rcbStatus.Items.Add(new RadComboBoxItem("U radu"));
        rcbStatus.Items.Add(new RadComboBoxItem("On hold"));
        rcbStatus.Items.Add(new RadComboBoxItem("Pending"));
        rcbStatus.Items.Add(new RadComboBoxItem("Scheduled"));
        rcbStatus.Items.Add(new RadComboBoxItem("Canceled"));
        rcbStatus.Items.Add(new RadComboBoxItem("Completed"));
        rcbStatus.DataBind();
 
        RadComboBox rcbVrstaPrijave = (RadComboBox)userControl.FindControl("rcbVrstaPrijave");
        rcbVrstaPrijave.Items.Add(new RadComboBoxItem("Usmeno"));
        rcbVrstaPrijave.Items.Add(new RadComboBoxItem("Telefon"));
        rcbVrstaPrijave.Items.Add(new RadComboBoxItem("E-mail"));
        rcbVrstaPrijave.Items.Add(new RadComboBoxItem("Web"));
        rcbVrstaPrijave.DataBind();
 
        RadComboBox rcbPrioritet = (RadComboBox)userControl.FindControl("rcbPrioritet");
        rcbPrioritet.Items.Add(new RadComboBoxItem("Low"));
        rcbPrioritet.Items.Add(new RadComboBoxItem("Normal"));
        rcbPrioritet.Items.Add(new RadComboBoxItem("High"));
        rcbPrioritet.Items.Add(new RadComboBoxItem("Odmah"));
        rcbPrioritet.DataBind();
 
        CheckBox chkNadreden = (CheckBox)userControl.FindControl("chkNadreden");
 
        RadComboBox rcbNadredeniTicket = (RadComboBox)userControl.FindControl("rcbNadredeniTicket");
        var nadredenTicketList = (from t in db.Ticket
                                    select t).ToList();
 
        rcbNadredeniTicket.DataSource = from t in nadredenTicketList
                                        where t.idFirma == idFirma && t.Zatvoren == false
                                        select new { t.idTicket, OpisTicketa = t.idTicket + " - " + t.Opis };
 
        rcbNadredeniTicket.Items.Add(new RadComboBoxItem("Bez nadreÄ‘enog ticketa", "0"));
        rcbNadredeniTicket.DataBind();
 
        RadComboBox rcbAsset = (RadComboBox)userControl.FindControl("rcbAsset");
        var ticketAssetList = (from a in db.Asset
                               where a.idFirma == idFirma
                               select a).ToList();
 
        if (ticketAssetList.Count > 0)
        {
            var assets = from a in db.Asset
                         where a.idFirma == idFirma
                         select new { a.idAsset, a.Naziv };
 
            rcbAsset.DataSource = assets;
            rcbAsset.DataTextField = "Naziv";
            rcbAsset.DataValueField = "idAsset";
            rcbAsset.Text = "'<%# DataBinder.Eval(Container, 'DataItem.Naziv') %>'";
            rcbAsset.DataBind();
        }                            
         
         
        if (!e.Item.OwnerTableView.IsItemInserted)
        {
            int idTicket = Convert.ToInt32(editFormItem.GetDataKeyValue("idTicket"));
            ticket = db.Ticket.SingleOrDefault(t => t.idTicket == idTicket);
 
            string tip = ticket.Tip;
            rcbTip.Items.FindItemByText(tip).Selected = true;
 
            string status = ticket.Status;
            rcbStatus.Items.FindItemByText(status).Selected = true;
 
            string vrstaPrijave = ticket.VrstaPrijave;
            rcbVrstaPrijave.Items.FindItemByText(vrstaPrijave).Selected = true;
 
            string prioritet = ticket.Prioritet;
            rcbPrioritet.Items.FindItemByText(prioritet).Selected = true;
             
        }              
    }
}

The problem occurs in the line with RadComboBox rcbAsset. The problem is a bit urgent so any help would be appreciated!
Ignjat
Top achievements
Rank 1
 answered on 31 Aug 2011
5 answers
85 views
Hi,
I have a scheduler that is initially hidden on my page.  After the user hits a button the data should be populated.

Technically it works fine and the data is shown BUT on the first load the height of the scheduler is normally set to about 108px.  I've hardcoded the height to be 550px and that doesn't fix this.  

Interestingly if I resize the page, reload the page, visit another page and then come back the problem doesn't reappear until the tab is closed and a new tab opened. This seems to be affecting all browsers but is most demonstrable in chrome and is easy to replicate in chrome.

Tomorrow I'll be creating a demo to solve this, in the meantime is there any obvious reason why this might be happening?

Regards,

Jon

Plamen
Telerik team
 answered on 31 Aug 2011
1 answer
80 views
hi i have been studying this example of dynamic raddock with usercontrols.
What i found is that after you play almost 30 seconds creating and closing docks the html Dom is a complete dissaster, full of divs left by the raddock windows.

there is a way to clean this dom, for example using a server side event for the close command to unload the control and have a clean DOM?
i found a little bit complicated because there should be only one close event function for all raddocks so posible you should pass the control loaded in any way to this event handler to know which control you should unload, and in that case i have not clear that could be keep clean.

Thanks a lot.
Slav
Telerik team
 answered on 31 Aug 2011
7 answers
201 views
Problem:
I have right to left page and an editor in a dock. when i toggle fullscreen mode it dont work corrent.
i take a screencast from the problem
http://www.screencast.com/users/AmirMirkamali/folders/Jing/media/965bd81f-a4d1-45c1-a4b5-3c398539d95c

also some part of toolbars hide behind the page. such as toggle full screen and i cant return to normal screen (I know the shortcut is F11 but many users does not)

Rumen
Telerik team
 answered on 31 Aug 2011
4 answers
122 views
Radeditor clear class dont work in hyperlink manager. when select an style for a link and apply it, you cant remove it !!!

hyperlink manager -> Hyperlink  ->  CSS Class -> clear class

(I have ie 9.0)

I got disappointed with RadEditor, there are some basic tools and functions that are not in RadEditor, such as
  1. Direction
  2. Line Height
  3. Custom css class edit for object (only selective class availble)

RadEditor didnt switch to rtl when add rtl style to it (tools are stil ltr) and i must add too many styles!

I have posted another bug in the forum
http://www.telerik.com/community/forums/aspnet-ajax/editor/radeditor-fullscreen-bug-when-placed-in-raddock.aspx
the editor full screen not work correct in raddock.

please help !


Rumen
Telerik team
 answered on 31 Aug 2011
2 answers
137 views
Hi,

I'm trying to use radwindow in site that will be used from mobile devices (also from PCs, that is already working and using radwindows). To maximize space, I want to remove the frame from the rad window, and only preset the closing X button, using all the size for the content.

Is this possible? examples?

Thanks

Javier Rodríguez 
Marin Bratanov
Telerik team
 answered on 31 Aug 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?