Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
447 views
I have been wrestling with this on and off over the last couple days, and have not yet found a good basic sample. I am managing data in a business layer, so what I'm passing into the grid are lists of objects. For simplicity, let's say the two lists are:

The rows are:
ClientId
ClientName
ContactId
ContactName
ContactTypeId

The ContactTypeId column needs to provide a lookup, and on ItemDataBound I am passing a list of:
ContactTypeId
ContactTypeName

So far I have gotten it to almost work in several ways, but there always seems to be some weird behavior. Is there a good sample somewhere with the fields to set to connect up the name and id on the lookup column, and to display the correct choice on view and when the dropdown first enters edit mode. Sorry if I'm missing something obvious, I feel like I'm running into a (very hard) wall.

Cheers.
Damon
Top achievements
Rank 1
 answered on 02 Nov 2012
3 answers
306 views
When an exception occurs during the ItemsRequested event, a RadWindow is displayed to the user with the message "There was an error in the callback."

Instead, I want the exception to bubble up to Application_Error in global.asax, where I have implemented centralized error handling/logging for the web site. This centralized error handling logs the error and redirects the user to a common error page. 

I have many other pages in the website where I use RadAjaxManager to perform AJAX-updates. If an exception occurs on the server during one of these AJAX-postbacks, I am able to route the exception through Application_Error by setting web config's customErrors to "On" and setting AllowCustomErrorsRedirect to "true" for the ScriptManager. However, these settings do not seem to have any affect on exceptions that occur during the ItemsRequested event of RadCombo.

I understand that you can call a custom javascript function by setting the "OnClientItemsRequestFailed" property on RadCombo, or that I can swallow the exception by putting a try/catch block around the code in the OnItemsRequested server-side event handler. However, neither of these options meet my needs.

Is there a way to tell RadCombo to allow exceptions that occur during the ItemsRequested event to bubble up to Application_Error?

Thank you.
John
Top achievements
Rank 1
 answered on 02 Nov 2012
2 answers
205 views
Hi,

I am trying to use the RadGrid control to implement a table
that has a field indicating if the record is a favourite,
based upon a database bit field. In the RadGrid the field is
an image button.
I am using the RadGrid_ItemCommand event
to toggle the status of the flag in the database for the record
that the user clicked on.
I use the item.GetDataKeyValue("<DataKeyField>") to get the IDs that are
used to identify the record to toggle.

The problem:
The value returned by item.GetDataKeyValue("cli_id") is not
always correct. It is sometimes a value corresponding to a
different row.
I also tried using the CommandArgument property, but that has the
same behavior.

How do I get the correct value for the row that was clicked on

by the user?

Here is the RadGrid_ItemCommand event:

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
{
    Trace.Write("RadGrid1_ItemCommand: starting up...");
    if (e.CommandName == "ChangeStatus")
    {
        GridDataItem item = (GridDataItem)e.Item;
 
        //Get the record IDs from the DataKeyNames
        System.Data.DataRowView oRow = (System.Data.DataRowView)item.DataItem;
        int iApp_id = Convert.ToInt32(item.GetDataKeyValue("app_id"));
        int iCli_id = Convert.ToInt32(item.GetDataKeyValue("cli_id"));
        bool bIsFav = Convert.ToBoolean(item.GetDataKeyValue("IsFav"));
        Trace.Write("RadGrid1_ItemCommand: iApp_id: " + iApp_id);
        Trace.Write("RadGrid1_ItemCommand: cli_id: " + iCli_id);
        Trace.Write("RadGrid1_ItemCommand: bIsFav: " + bIsFav);
        int itmp = Convert.ToInt32(e.CommandArgument);
 
        //Toggle the Favorite status for that combination
        SqlConnection oConn = new SqlConnection(SqlDataSource_GridViewSolutions.ConnectionString);
        SqlCommand oCmd = new SqlCommand("toggle_gru_IsFav_Status", oConn);
        oCmd.CommandType = System.Data.CommandType.StoredProcedure;
 
        //ToDo make User name dynamic: oCmd.Parameters.Add(this.Page.User.Identity.Name);
        oCmd.Parameters.Add(new SqlParameter("strLoginID", "the_user"));
        oCmd.Parameters.Add(new SqlParameter("app_id", iApp_id));
        oCmd.Parameters.Add(new SqlParameter("cli_id", iCli_id));
        try
        {
            oConn.Open();
            oCmd.ExecuteNonQuery();
        }
        catch (Exception ex1)
        {
            Response.Write("Error updating favorite status: " + ex1.Message);
        }
        finally
        {
            oConn.Close();
            oConn.Dispose();
        }
        RadGrid1.Rebind();
    }

Here is the markup for the RadGrid control:

<div class="apps_by_clients">
    <asp:SqlDataSource ID="SqlDataSource_GridViewSolutions"
        ConnectionString="Data Source=BTSLSQLDEV01;Initial Catalog=GenericStorage;User ID=userid;pwd=xxxxxxxxx"
        SelectCommand="EXEC GetAppsWithFavStatus 'the_user'"
        runat="server" />
</div>
  
<telerik:RadGrid ID="RadGrid1" runat="server" 
    AllowPaging="True" 
    CellSpacing="0" 
    DataSourceID="SqlDataSource_GridViewSolutions" 
    GridLines="None" 
    PageSize="30" 
    Skin="Vista" 
    Width="720px"
    AutoGenerateColumns="False"
    AllowFilteringByColumn="True"
    GroupingSettings-CaseSensitive="false" 
    onitemcommand="RadGrid1_ItemCommand" 
    OnPreRender="RadGrid1_PreRender">
    <MasterTableView 
    DataSourceID="SqlDataSource_GridViewSolutions"
    GroupsDefaultExpanded="false"
    DataKeyNames="app_id, cli_id, IsFav"
    >
        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
  
        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
  
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
        <Columns>
            <telerik:GridBoundColumn DataField="cli_name" 
                FilterControlAltText="Filter cli_name column" HeaderText="cli_name" 
                UniqueName="cli_name" SortExpression="cli_name">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="app_name" 
                FilterControlAltText="Filter app_name column" HeaderText="app_name" 
                SortExpression="app_name" UniqueName="app_name">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="app_id" DataType="System.Decimal" 
                FilterControlAltText="Filter app_id column" HeaderText="app_id" ReadOnly="True" 
                SortExpression="app_id" UniqueName="app_id">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn DataField="IsFav" 
                HeaderText="Favourite?" 
                UniqueName="IsFav"
                AllowFiltering="false"
                >
                <ItemTemplate>
                    <asp:ImageButton ID="ImageButton1" runat="server" 
                        ImageUrl='./'
                        CommandName="ChangeStatus"
                        CommandArgument='<%# Eval("cli_id") %>'
                        />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
        </EditFormSettings>
        <PagerStyle PageButtonCount="5" />
    </MasterTableView>
  
    <PagerStyle PageButtonCount="5" />
  
    <FilterMenu EnableImageSprites="False"></FilterMenu>
</telerik:RadGrid>

We are using ASP.Net 4.0 on Windows server 2008
We are using 2012.2.607.40 of the Telerik Radcontrols


Cheers,
Geoff

BtsiTech
Top achievements
Rank 1
 answered on 02 Nov 2012
4 answers
44 views
Hi,

I've just installed the new Q2 version of the controls and in the main all is fine.  I have however noticed that in Chrome I end up with an extra margin inside a RadSplitter.  So I tried to inspect the CSS with Chrome, as soon as I try the margin collapses and the page looks as it should.  I've deleted as much as possible on the page to get to a working example.  The following code works in Chrome, you should see a left blue column,  the right column has some text,  the text appears maybe 15-20px away from the blue panel, if you now open it up for inspection the margin disappears.

Note that if you refresh the page with the inspector open in chrome then the margin appears for half a second or so then disappears.

Regards,

Jon

<head id="Head1" runat="server">
    <title></title>
    <style type="text/css">
        html, body, form
        {
            height: 100%;
            margin: 0px;
            padding: 0px;
            overflow: hidden;
        }
        .surroundPaneBackground
        {
             background-color: #8ba0bc;
             height: 100%;
             width: 100%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadStyleSheetManager ID="pgRadStyleSheetManager" runat="server"></telerik:RadStyleSheetManager>
        <telerik:RadScriptManager ID="pgRadScriptManager" runat="server"></telerik:RadScriptManager>
        <div id="ParentDivElement" style="height: 100%;">
            <telerik:RadSplitter ID="uxRadSplitter" runat="server" Height="100%" Width="100%" Orientation="Vertical" LiveResize="true" BorderSize="0">
                <telerik:RadPane ID="uxRadPaneLeft" runat="server" MinWidth="0"><div class="surroundPaneBackground"></div></telerik:RadPane>
                <telerik:RadPane ID="uxRadPaneMain" runat="server" Scrolling="none" Width="850">
                    <telerik:RadSplitter ID="RadSplitter1" runat="server" Height="100%" Orientation="Horizontal" LiveResize="true" BorderSize="0">
                        <telerik:RadPane ID="uxRadPaneContent" runat="server" Scrolling="none" >
                        aaaa
                        </telerik:RadPane>
                    </telerik:RadSplitter>
                </telerik:RadPane>
            </telerik:RadSplitter>
        </div>
    </form>
</body>
</html>


Vessy
Telerik team
 answered on 02 Nov 2012
1 answer
110 views
Hello Telerik Team,

We are using Telerik Rad Editor in application to implement Email system. When ever we paste any links in Rad editor save it in data base it saves properly, but when we are loading the same content in to same rad editor for viewing, and when we click on the links, the corresponding link is opening up in Rad editor itself. Please find the attached image file with name "Capture1.PNG" file which is default look of the rad editor when we load the content in to editor.  

But when we click on the link it is opening in Rad editor itself as shown in the image file with name "Capture2.png". I need to open up the link in new tab window. 

Please find attachment. Please help me solve this issue.

Thanks,
Arvind Chary N.
Rumen
Telerik team
 answered on 02 Nov 2012
1 answer
55 views
I am using An Advance Form to insert and edit an Appointment using WebService for data binding. After the appointment is inserted, or edit, if the appointment time in not in the view, I want to move the scheduler to the appointment date. Is there a way to achieve this? Is there a way to attache a client side js function to an Update button of the Advance Form after the appointment is updated? Thank you in advance.
Boyan Dimitrov
Telerik team
 answered on 02 Nov 2012
1 answer
95 views
Hi,

When I add classes with the same value attribute to the <classes> element of the "ToolsFile.xml" file, then only last one is displayed in the Apply CSS dropdown list. For example:

<classes>
        <class name="Name 1" value=".class1" />
        <class name="Name 2" value=".class1" />
</classes>

In this case there is only "Name 2" class in the list.

Is this expected behavior? And if it is, is this documented somewhere? Is there any configuration to allow displaying all classes with the same value?

Thank you in advance.

Best regards,
Vitaliy
Rumen
Telerik team
 answered on 02 Nov 2012
1 answer
93 views
Hi! Im using radmenu like this:

<Menu>
  <Item text="lvl1" Role="A">
    <Item text="lvl2" Role="A">
      <Item text="lvl3" Role="A" />
      <Item text="lvl3" Role="B" />
    </Item>
    <Item text="lvl2" Role="B" />
  </Item>
  <Item text="lvl1" Role="B">
  </Item>
</Menu>

<asp:XmlDataSource DataFile="LikeAbove" ID="xmlDataSource" XPath="//Item[@Role='A']" runat="server />
<telerik:RadMenu DataSourceID="xmlDataSource" runat="Server">
  <DataBindings>
    <telerik:RadMenuItemBinding Depth="0" TextField="Text" />
    <telerik:RadMenuItemBinding Depth="1" TextField="Text" />
  </DataBindings>
</telerik:RadMenu>

What Im trying to do is to get all menu items with the role "A", filtering on all levels. I works on a single level using this /Item[@Role='A']but when using this approach on a multi level //Item[@Role='A'] (two slash in the beginning) it "flats out", meaning all menu nodes are being visible on the first level AND also still remains unfiltered where they used to be in the tree.
Max
Top achievements
Rank 1
 answered on 02 Nov 2012
6 answers
358 views
Hi,

Is there a way or can we utilize the Image Map editor without using the RadEditor? If yes, how can we use it in such we can retrieve and save data such as saving of image and "area properties" in database?


Thank you in advance... hope you can help us with our query..

Regards,

Rex
Rumen
Telerik team
 answered on 02 Nov 2012
11 answers
369 views
HI
I've a radgrid with group.
I used the property "GroupsDefaultExpanded=false" for close the group, but the property reclose the group any time i try to do any action (example when i click the button for edit)
Can you help me?
Lasly
Top achievements
Rank 1
 answered on 02 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?