Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
136 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
112 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
108 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
225 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
147 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
161 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
1 answer
91 views
I have a postion table that I drag and drop personnel to positions, however they want the ability to lock out positions.  So what I do is put a number in a field in the db that pulls into the grid.  I turn this number invisible for the column but now how can I lock out the row from being dropped to in the drag and drop event.  Only using code behind so i am using the rowDrop event.
Protected Sub myGridSoldier_RowDrop(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDragDropEventArgs) Handles myGridSoldier.RowDrop
  
        If e.DestDataItem.OwnerTableView.ClientID = myGridPositions.MasterTableView.ClientID Then
            For i As Integer = 0 To e.DraggedItems.Count - 1
                Dim SSN As String = e.DraggedItems(i).GetDataKeyValue("SSN")
                Dim PositionId As Integer = e.DestDataItem.GetDataKeyValue("intPositionId")
  
                HFSSN.Value = SSN
                HFPosition.Value = PositionId
  
                FillInfo(SSN, PositionId)
  
                pnlSoldierInfo_POP.Show()
            Next
        End If
    End Sub
Mira
Telerik team
 answered on 31 Aug 2011
3 answers
126 views

Goodafternoon,

I’ve got a problem with a AjaxLoadingPanel display on the iPad (latest version -> safari browser)
 
What happens:
 
The page is divided in to two Panels:
* oPanelTop (containing information)
* oPanelAll (containing the listview)

A RadListView is being populated from serverside.
A listview item contains 1 image, inputfield, and one button

On the ItemCreated, listviewitem, event I’m linking the button, from listviewitem,  with the AjaxLoadingPanel and the oPanelTop.

code: RadAjaxManager2.AjaxSettings.AddAjaxSetting(oLinkButton, oPanelTop, oRadAjaxLoadingPanel);

Client side the oRadAjaxLoadingPanel is defined as follows:

<telerik:RadAjaxLoadingPanel runat="server" ID="oRadAjaxLoadingPanel" Transparency="30" Skin="" MinDisplayTime="2000">

    <div style="height: 70px; background-color: #EEEEEE;">

        <asp:Label ID="Label1" runat="server" Text="Adding…" />

    </div>

</telerik:RadAjaxLoadingPanel>

The page works well, as it supposed to be, on the following browsers:

IE8, IE9, FireFox, Chrome, Safari (desktop)

The page fails on Safari(iPad).
I get the feeling that on the ipad the button action is triggered twice, or something like that, because:

1st time clicked on a button from listview => site response normaly (hiding AjaxLoadingPanel)
2nd time clicked on a  button from (random) listviewitem =>

The page shows the transparent box over the oTopPanel (like first time). But then The transparent box darkens (2nd AjaxLoadingPanel? Overlaying the existing visible ajaxloadingpanel) and after 2 seconds it lightens (disposing 1st ajaxloadingpanel?), but then remains visible, making it unable to click the controls underneath it.

I Have already tried the following:

Serverside => create an AjaxSetting object with various options
ClientSite => Create the AjaxSetting separate from existing AjaxSetting (so things won’t mix up)

Non has the result I suspected.

The Problem is : AjaxLoadingPanel stays visible even after Displaytime has elapsed.
(only on iPad Safari)

Is there a way to solve this problem.

Thanks in advance.
Marin
Telerik team
 answered on 31 Aug 2011
1 answer
117 views
In my share point application user control, I have a RadEditor and a hyper link. clicking on the hyperlink would open a modaldialog. when user select some data and click on apply button in the modaldialog, the data should automatically insert into the RadEditor. How to achieve this?
Rumen
Telerik team
 answered on 31 Aug 2011
1 answer
83 views
Hi,
I am selecting particular row using linkbutton client side click event .for that i am using following code
 function Edit(control, rowIndex,reportName) {
            var grid = $find("ctl00_ContentPlaceHolder1_rgReportList");
            grid.MasterTableView.selectItem(rowIndex);
        }

This is working fine .
There are buttons in command template which are enables when checkbox of select column is checked ,
but while selecting row using javascript it is not happening.
Kindly suggest for the above.

I am using following markup for commadtemplate and columns.
 <CommandItemTemplate>
                            <telerik:RadToolBar ID="rtbReports" runat="server" OnClientButtonClicked="onToolBarClientButtonClicking"
                                Height="26px" Skin="Office2007" Width="100%">
                                <Items>
                                    <telerik:RadToolBarButton Text="<%$ Resources:New %>" CommandName="<%$ Resources:New %>"
                                        ImageUrl="~/Images/NewEnable2.png" Enabled='<%# rgReportList.EditIndexes.Count == 0 %>'>
                                    </telerik:RadToolBarButton>
                                    <telerik:RadToolBarButton Text="<%$ Resources:Delete %>" CommandName="<%$ Resources:Delete %>"
                                        ImageUrl="~/Images/imgDelBtnEnable.png" Enabled='<%# rgReportList.EditIndexes.Count > 0 %>'>
                                    </telerik:RadToolBarButton>
                                    <telerik:RadToolBarButton Text="<%$ Resources:Edit %>" CommandName="<%$ Resources:Edit %>"
                                        ImageUrl="~/Images/imgEditBtnEnable.png" Enabled='<%# rgReportList.EditIndexes.Count > 0 && rgReportList.EditIndexes.Count == 1%>'>
                                    </telerik:RadToolBarButton>
                                    <telerik:RadToolBarButton Text="<%$ Resources:Copy %>" CommandName="<%$ Resources:Copy %>"
                                        ImageUrl="~/Images/imgCopyBtnEnable.png" Enabled='<%# rgReportList.EditIndexes.Count > 0 && rgReportList.EditIndexes.Count == 1%>'>
                                    </telerik:RadToolBarButton>
                                    <telerik:RadToolBarButton CssClass="rightAligned">
                                        <ItemTemplate>
                                            <table style="background-color: White;" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td valign="middle" style="width: 20px;" align="center">
                                                        <asp:Image ID="imgSearch" runat="server" ImageUrl="~/Images/Search-icon3.png" />
                                                    </td>
                                                    <td valign="middle">
                                                        <telerik:RadTextBox ID="txtsearchreports" runat="server" AutoPostBack="True" MaxLength="20"
                                                            OnTextChanged="txtsearchreports_TextChanged" EmptyMessage="<%$ Resources:EnterToSearch %>"
                                                            Width="200px" EnableViewState="true" CssClass="txtSearch">
                                                        </telerik:RadTextBox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </ItemTemplate>
                                    </telerik:RadToolBarButton>
                                </Items>
                            </telerik:RadToolBar>
                        </CommandItemTemplate>

<Columns>
                            <telerik:GridClientSelectColumn  HeaderStyle-Width="35px"
                                ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" Resizable="false">
                            </telerik:GridClientSelectColumn>
                            <telerik:GridTemplateColumn UniqueName="ReportName" HeaderText="<%$ Resources:ReportName %>"
                                HeaderStyle-Width="30%" SortExpression="ReportName" ShowSortIcon="true">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkReportName" runat="server" Text='<%#Eval("ReportName")%>'
                                        Font-Underline="true"></asp:LinkButton><%--OnClientClick="Edit(this);"--%>
                                    <asp:HiddenField ID="hdnReportName" runat="server" Value='<%#Eval("ReportName")%>' />
                                </ItemTemplate>
                                  <ItemStyle Wrap="false" />
                                  <HeaderStyle Wrap ="false" />
                            </telerik:GridTemplateColumn>
 </Columns>
Veli
Telerik team
 answered on 31 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?