Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
92 views
Is there any java-script function to expand the detail grid on a click of hyperlink column in the radgrid.?

If not so, is there any method to trigger the expansion when based on any event of the parent grid? ( like button click event , hyperlink click event etc.,)


I don't want the expansion on the row click, but I want to expand the detail when a particular image button or hyperlink is clicked in a row of specific column.

Prasad
Top achievements
Rank 1
 answered on 02 Sep 2011
2 answers
116 views
Hi Telerik Team,

Just found an unusual piece of CSS code in one of your demos.

.userName
        {
            font-size: 18px;
            font-wight: bold;
            color: #598f97;
            vertical-align: top;
            float: right;
            margin: 30px;
        }

I am pretty sure you meant, font-weight instead of font-wight
Notification Demo

Cheers,
Navnit
Navnit
Top achievements
Rank 2
 answered on 02 Sep 2011
4 answers
112 views

In radgrid i am having a custom filter using a button. Here is my code.

protected void imSearch1_Click(object sender, EventArgs e)

{

RadTextBox txtFirstName = (RadTextBox)RadPanelBar1.FindItemByValue("QuickSearch").FindControl("txtFirstName");

RadTextBox txtLastName = (RadTextBox)RadPanelBar1.FindItemByValue("QuickSearch").FindControl("txtLastName");

DataSet ds = DhsBasePage.getProxyDataService().GetProviderListByName(txtFirstName.Text, txtLastName.Text);

RadGrid1.DataSource = ds;

RadGrid1.Rebind();

}

This works good, but this filter not applied to the next page. In other words when i click the next page, the grid lost the filter.
Need help ASAP.
Thanks in advance.
Eva

Dany
Top achievements
Rank 1
 answered on 02 Sep 2011
2 answers
112 views
Hi,

I am trying to use AJAX editor  in MVC framework. I followed these 2 link for the implementation and every thing works fine except saving the content(accessing in controller).

http://www.telerik.com/help/aspnet-ajax/mvc-using-editor.html
http://www.telerik.com/community/forums/aspnet-ajax/editor/using-rad-editor-into-mvc-page.aspx

The issue is when I assign a value to the content of the editor (say some default value) and then modify it and save it, it always saves the assigned value and not the updated value.

If I remove the default value that is assigned to the editor, then after typying the content in editor when I click save it saves empty, the form value that i get in controller is empty string.

I checked using fiddler and still the formcollection is having empty value only if there is no default value. If I have a default value it has the default value and not the updated data.

can some one help with this?

Another small issue is, I was trying to set the filter ,searchPatten and few more in the MVC view as below, but the Editor dint recognize the paths or the searchpattern or the filters. When I used it as inline it worked. And Inline doesnt allow <%= %>  for MaxUploadFileSize and for searchpatters as the Editor is a server control. So I am forced to use hardcoded value. Is there any alternative for fixing this?
<% string ImageGalleryPath = "/images/ModuleName";
            EditorID.ImageManager.ViewPaths = new string[] { ImageGalleryPath };
            EditorID.ImageManager.UploadPaths = new string[] { ImageGalleryPath };
            EditorID.ImageManager.DeletePaths = new string[] { ImageGalleryPath };
            EditorID.ImageManager.MaxUploadFileSize = ConfigurationHelper.MaxUploadFileSize;
            EditorID.ImageManager.SearchPatterns = ConfigurationHelper.SearchPatternsImages;
            EditorID.DisableFilter(Telerik.Web.UI.EditorFilters.RemoveScripts);
            EditorID.DisableFilter(Telerik.Web.UI.EditorFilters.MakeUrlsAbsolute);
            EditorID.DisableFilter(Telerik.Web.UI.EditorFilters.FixUlBoldItalic);
            EditorID.EnableFilter(Telerik.Web.UI.EditorFilters.FixEnclosingP);
            EditorID.DisableFilter(Telerik.Web.UI.EditorFilters.IECleanAnchors);
            EditorID.DisableFilter(Telerik.Web.UI.EditorFilters.MozEmStrong);
            EditorID.EnableFilter(Telerik.Web.UI.EditorFilters.ConvertFontToSpan);
            EditorID.DisableFilter(Telerik.Web.UI.EditorFilters.ConvertToXhtml);
            EditorID.EnableFilter(Telerik.Web.UI.EditorFilters.IndentHTMLContent);
%>


Thanks,
Akila.



Akila Kumarasamy
Top achievements
Rank 1
 answered on 02 Sep 2011
3 answers
444 views
Good morning everyone! Here is what I am trying to accomplish. I have two datepickers within a radgrid,  one is a start date and the other an end date. What I need is when the user clicks a date within start date is for the end date to automatically be populated with the date five days later. For example, if the user clicks the start date 9/1/2011, then the end date should automatically be set to 9/4/2011. Is there a setting within the raddatepicker or radcalendar that will do this or will I need to use javascript? Thank you in advance for your help!
pmourfield
Top achievements
Rank 1
 answered on 02 Sep 2011
2 answers
200 views
I am going crazy. I had tree view and it worked, now it doesn't. So I isolated to code from the TreeView onto a page by itself and it still doesn't work.

Here is the code for the page;
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="lp.aspx.cs" Inherits="lp" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
    <script type="text/javascript" src="lpScript.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnResponseEnd="ClientResponseEnd">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Panel1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
        <telerik:RadTreeView ID="RadTreeView1" runat="server" CheckBoxes="True" MultipleSelect="True"
            ShowLineImages="False" EnableEmbeddedSkins="False" TriStateCheckBoxes="False">
            <NodeTemplate>
                <asp:Label ID="lblnodeText" Text='<%#Eval("title") %>' runat="server" />
                <asp:Label ID="lblCatId" Text='<%#Eval("Id") %>' runat="server" Visible="false"></asp:Label>
                <asp:Label ID="lblisCustomer" Text='<%#Eval("isCustomer") %>' runat="server" Visible="false"></asp:Label>
                <asp:Label ID="Description" runat="server" Text='<%#Eval("description") %>' />
            </NodeTemplate>
        </telerik:RadTreeView>
    </div>
    </form>
</body>
</html>
Here is the code behind.
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;
using System.Configuration;
using System.Collections.Generic;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;

public partial class lp : System.Web.UI.Page
{
    protected void Page_Load (object sender, EventArgs e)
    {
        bindAssetTree ();
    }
    private void bindAssetTree ()
    {
        List<AssetTree> ds = getAssetTree (User.Identity.Name);
        RadTreeView1.DataSource = ds;
        RadTreeView1.DataFieldID = "Id";
        RadTreeView1.DataFieldParentID = "IdParent";
        RadTreeView1.DataTextField = "Title";
        RadTreeView1.DataValueField = "Id";
        RadTreeView1.DataBind ();
    }
    public class AssetTree
    {
        public int id { get; set; }
        public int idParent { get; set; }
        public String title { get; set; }
        public Boolean isCustomer { get; set; }
        public Boolean isUserCreated { get; set; }
        public Boolean allowDelete { get; set; }
        public String description { get; set; }
        public Boolean descriptionVisible { get; set; }

        public AssetTree ()
        {
        }

        public AssetTree (int id, int idParent, String title, Boolean isCustomer, Boolean isUserCreated, Boolean allowDelete, String description, Boolean descriptionVisible)
        {
            this.id = id;
            this.idParent = idParent;
            this.title = title;
            this.isCustomer = isCustomer;
            this.isUserCreated = isUserCreated;
            this.allowDelete = allowDelete;
            this.description = description;
            this.descriptionVisible = descriptionVisible;
        }
    }

    public List<AssetTree> getAssetTree (String username)
    {
        List<AssetTree> at = new List<AssetTree> ();
        for (int i = 0; i < assetTree.Length; i++)
            at.Add (assetTree[i]);

        return at;
    }

    AssetTree[] assetTree = {new AssetTree (2270, -2147483648, "Intuitive", false, false, true, "Intuitive Solutions Tree", false),
                                new AssetTree (2270, -2147483648, "Intuitive Solutions Tree", false, true, false, "Intuitive", false)};
}

Tonyz289
Top achievements
Rank 1
 answered on 02 Sep 2011
2 answers
132 views
I'm trying to change the PagerStyle-PageButtonCount but when I do it defaults my PagerStyle-PagerTextFormat which is set to  Change page: {4} &nbsp;Page <strong>{0}</strong> of <strong>{1}</strong>, items <strong>{2}</strong> to <strong>{3}</strong> of <strong>{5}</strong>.  How can I do this without it changing my PagerTextFormat?
Megan
Top achievements
Rank 1
 answered on 02 Sep 2011
6 answers
489 views

Hi please help me in this issue,

I have a RadGrid with employee details.  If i select multiple employees through checkbox column, i have to send email to all the checkbox selected employees when i click on the sendemail button.

Need quick response.

Justin
Top achievements
Rank 1
 answered on 02 Sep 2011
3 answers
163 views
I am trying to get the Checked value of the check box, such as true or false in a RadGrid and for some reason it always says that the value is false.

This is my Grid:
<telerik:radgrid id="grdLeadList" runat="server" autogeneratecolumns="false" allowpaging="True"
     allowsorting="True" pagesize="5" allowautomaticupdates="true" gridlines="None"
     allowmultirowselection="true" onitemcommand="grdLeadList_ItemCommand" DataKeyNames="opportunityid" style="float: left; width: 965px;">
 <ExportSettings HideStructureColumns="true" >
     <Excel Format="ExcelML" />
     <Csv ColumnDelimiter="Comma" RowDelimiter="NewLine" />
     <Pdf />
 </ExportSettings>
 <PagerStyle Mode="NextPrevNumericAndAdvanced" />
 <MasterTableView Width="100%" TableLayout="Auto"  >
     <CommandItemSettings ShowExportToExcelButton="false" ShowExportToCsvButton="false" ShowExportToPdfButton="false" ShowAddNewRecordButton="false" />
     <Columns>
         <telerik:GridTemplateColumn UniqueName="CkhSelect" HeaderText="Select">
           <ItemTemplate>
             <asp:CheckBox ID="chkbxselect" runat="server" />
           </ItemTemplate>
         </telerik:GridTemplateColumn>
         <telerik:GridEditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" EditText="Edit" />
         <telerik:GridBoundColumn DataField="CustomerId" HeaderText="Company Name" SortExpression="CompanyName" UniqueName="CompanyName" />
         <telerik:GridBoundColumn DataField="Priority" HeaderText="Priority" SortExpression="Priority" UniqueName="Priority" />
         <telerik:GridBoundColumn DataField="Eval" HeaderText="Eval" SortExpression="Eval" UniqueName="Eval" />
         <telerik:GridBoundColumn DataField="ContactName" HeaderText="Contact Name" SortExpression="ContactName" UniqueName="ContactName" />
         <telerik:GridBoundColumn DataField="Source" HeaderText="Source" SortExpression="Source" UniqueName="Source" />
         <telerik:GridBoundColumn DataField="State" HeaderText="State" SortExpression="State" UniqueName="State" />
         <telerik:GridNumericColumn DataField="Zip" HeaderText="Zip" SortExpression="Zip" UniqueName="Zip" />
         <telerik:GridDateTimeColumn DataField="CreatedOn" DataFormatString="{0:MM/dd/yy}" HeaderText="Creation Date" SortExpression="CreationDate" UniqueName="CreationDate" />
     </Columns>
     <EditFormSettings UserControlName="EditPanel.ascx" EditFormType="WebUserControl">
         <EditColumn UniqueName="EditCommandColumn1" />
     </EditFormSettings>
 </MasterTableView>
 <ClientSettings EnableRowHoverStyle="false" >
     <Selecting AllowRowSelect="True"  />
 </ClientSettings>
 </telerik:radgrid>


This my C#:
protected void imgBtnSendRecords_Click(object sender, ImageClickEventArgs e)
{
    string mail = "";
 
    foreach (GridDataItem item in grdLeadList.MasterTableView.Items) //loop through each grid item
    {
        CheckBox chkSelected = (CheckBox)item.FindControl("chkbxselect");
        if (chkSelected.Checked == true)
        {
            mail = mail + item["Priority"].Text + " ";
 
        }
    }
 
}


Any help would be great!

Thanks!
Justin
Top achievements
Rank 1
 answered on 02 Sep 2011
1 answer
506 views
Hello!

I've been trying to find the workaround for the following problem for the last couple of hours, but without any success. I've found many of the possible solutions on the Internet, but none of them was solution to my problem.

The problem occurs when I want to insert data into empty datasource. I've been able to find workarounds for RadComboBoxes, but not for the Textboxes. The error that is displayed is: "DataBinding: 'Telerik.Web.UI.GridInsertionObject' does not contain a property with the name 'OpciPrioritet'."

Here is the code:

.ascx (needed for the RadGrid)
<table>
    <tr>
        <td>
            NadreÄ‘eni ticket:
        </td>
        <td colspan="3">
            <telerik:RadComboBox ID="rcbNadredeniTicket" AppendDataBoundItems="true" runat="server"
                Width="455px">
            </telerik:RadComboBox>
        </td>
    </tr>
    <tr>
        <td>
            Prijavio:
        </td>
        <td colspan="3">
            <telerik:RadComboBox ID="rcbPrijavio" AppendDataBoundItems="true" runat="server"
                Width="455px">
            </telerik:RadComboBox>
        </td>
    </tr>
    <tr>
        <td>
            Asset:
        </td>
        <td colspan="3">
            <telerik:RadComboBox ID="rcbAsset" 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" runat="server">
            </telerik:RadComboBox>
        </td>
    </tr>
    <tr>
        <td>
            Status:
        </td>
        <td>
            <telerik:RadComboBox ID="rcbStatus" 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>
            BiljeÅ¡ke:
        </td>
        <td colspan="3">
            <asp:TextBox ID="txtBiljeske" runat="server" TextMode="MultiLine" Width="455px" Height="200px"
                Text='<%# DataBinder.Eval(Container, "DataItem.Biljeske") %>'></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>


.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();
        TicketAsset ticketAsset = new TicketAsset();
 
        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();
        rcbTip.Text = "'<%# DataBinder.Eval(Container, 'DataItem.Tip') %>'";
 
        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();
        rcbStatus.Text = "'<%# DataBinder.Eval(Container, 'DataItem.Status') %>'";
 
        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();
        rcbVrstaPrijave.Text = "'<%# DataBinder.Eval(Container, 'DataItem.VrstaPrijave') %>'";
 
        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();
        rcbPrioritet.Text = "'<%# DataBinder.Eval(Container, 'DataItem.Prioritet') %>'";
 
        RadComboBox rcbNadredeniTicket = (RadComboBox)userControl.FindControl("rcbNadredeniTicket");
        var nadredenTicketList = (from t in db.Ticket
                                    select t).ToList();
 
        if (nadredenTicketList.Count > 0)
        {
            rcbNadredeniTicket.DataSource = from t in nadredenTicketList
                                            where t.idFirma == idFirma && t.Zatvoren == false
                                            select new { t.idTicket, t.idNadredeniTicket, OpisTicketa = t.idTicket + " - " + t.Opis };
 
            rcbNadredeniTicket.DataTextField = "OpisTicketa";
            rcbNadredeniTicket.DataValueField = "idTicket";
            rcbNadredeniTicket.Text = "'<%# DataBinder.Eval(Container, 'DataItem.idNadredeniTicket') %>'";
        }
 
        rcbNadredeniTicket.Items.Add(new RadComboBoxItem("Bez nadreÄ‘enog ticketa", "0"));
        rcbNadredeniTicket.DataBind();
 
        RadComboBox rcbPrijavio = (RadComboBox)userControl.FindControl("rcbPrijavio");
        rcbPrijavio.DataSource = from k in db.Kontakt
                                 where k.idFirma == idFirma
                                 select new { k.idKontakt, kontaktNaziv = k.Ime + " " + k.Prezime };
 
        rcbPrijavio.Items.Add(new RadComboBoxItem("Bez kontakta", "0"));
        rcbPrijavio.DataTextField = "kontaktNaziv";
        rcbPrijavio.DataValueField = "idKontakt";
        rcbPrijavio.Text = "'<%# DataBinder.Eval(Container, 'DataItem.idKontakt') %>'";
        rcbPrijavio.DataBind();
 
        RadComboBox rcbAsset = (RadComboBox)userControl.FindControl("rcbAsset");
        var assetList = (from a in db.Asset
                         where a.idFirma == idFirma
                         select a).ToList();
 
        if (assetList.Count > 0)
        {
            var assets = from a in assetList
                         where a.idFirma == idFirma
                         select new { a.idAsset, Naziv = a.Naziv + " (" + a.Kontakt.Ime + " " + a.Kontakt.Prezime + ")" };
 
            rcbAsset.DataSource = assets;
            rcbAsset.DataTextField = "Naziv";
            rcbAsset.DataValueField = "idAsset";
            rcbAsset.Text = "'<%# DataBinder.Eval(Container, 'DataItem.Naziv') %>'";
            rcbAsset.Items.Add(new RadComboBoxItem("Bez pridruženog asseta", "0"));
            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;
 
            int kontakt = Convert.ToInt32(ticket.idKontakt);
 
            if (ticket.idKontakt == null)
            {
                rcbPrijavio.Items.FindItemByValue("0").Selected = true;
            }
            else
            {
                rcbPrijavio.Items.FindItemByValue(kontakt.ToString()).Selected = true;
            }
 
            int nadredeniTicket = Convert.ToInt32(ticket.idNadredeniTicket);
             
            if (ticket.idNadredeniTicket == null)
            {
                rcbNadredeniTicket.Items.FindItemByValue("0").Selected = true;
            }
            else
            {
                rcbNadredeniTicket.Items.FindItemByValue(nadredeniTicket.ToString()).Selected = true;
            }
 
            var ticketAssetCount = from ta in db.TicketAsset
                                   where ta.idTicket == idTicket
                                   select ta;                 
                             
            if (ticketAssetCount.Count() > 0)
            {
                ticketAsset = db.TicketAsset.SingleOrDefault(ta => ta.idTicket == idTicket);
 
                int asset = Convert.ToInt32(ticketAsset.idAsset);
 
                rcbAsset.Items.FindItemByValue(asset.ToString()).Selected = true;
            }
            else
            {
                rcbAsset.Items.FindItemByValue("0").Selected = true;
            }
        }
    }
}

.aspx (only the needed snippet):
<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"
    onupdatecommand="gvTicketi_UpdateCommand">
    <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="idKontakt">
            </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>


Any help would be appreciated as this is pretty much urgent!
Andrey
Telerik team
 answered on 02 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?