Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
153 views

I have followed the cascading combobox sample and everthing seems to work. I am including my code for both the ASPX and VB below.

My issue is that when the initial value is selected in the third como box I want to use the RadComboBox3.DataValueField to update a SqlDataSource and is used to fill a Radgrid. This does not happen nor does selecting another value in RadComboBox3 cause the SqlDataSource to update the grid. Any help much appreciated.

ASPX
<%@ Page Language="VB" AutoEventWireup="TRUE" CodeFile="Default3.aspx.vb" Inherits="Default3" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head id="Head1" runat="server">
 
    <title></title>
 
</head>
<body>
    <form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <div id="qsfexWrapper">
            <br />
            <br />
            <table cellpadding="0" cellspacing="0" class="style1">
                <tr>
                    <td style="padding: 3px">
            <asp:Label ID="Label1" runat="server" AssociatedControlID="RadComboBox1">Account:</asp:Label>
                    </td>
                    <td style="padding: 3px">
            <telerik:RadComboBox ID="RadComboBox1"
                runat="server"
                Width="300px"
                OnClientSelectedIndexChanging="Loadterminals"
                OnItemsRequested="RadComboBox1_ItemsRequested" />
             
                    </td>
                </tr>
                <tr>
                    <td style="padding: 3px">
             
            <asp:Label ID="Label2" runat="server" AssociatedControlID="RadComboBox2">Terminal:</asp:Label>
                    </td>
                    <td style="padding: 3px">
            <telerik:RadComboBox ID="RadComboBox2"
                runat="server"
                Width="186px"
                OnClientSelectedIndexChanging="Loadfleets"
                OnClientItemsRequested="ItemsLoaded"
                OnItemsRequested="RadComboBox2_ItemsRequested" />
             
                    </td>
                </tr>
                <tr>
                    <td style="padding: 3px">
             
            <asp:Label ID="Label3" runat="server" AssociatedControlID="RadComboBox3">Fleet:</asp:Label>
                    </td>
                    <td style="padding: 3px">
            <telerik:RadComboBox ID="RadComboBox3"
                runat="server"
                Width="186px"
                OnClientItemsRequested="ItemsLoaded"
                OnItemsRequested="RadComboBox3_ItemsRequested" />
                    </td>
                </tr>
                <tr>
                    <td style="padding: 3px">
                         </td>
                    <td style="padding: 3px">
                         </td>
                </tr>
            </table>
            <br />
            <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1">
<MasterTableView AutoGenerateColumns="False" DataKeyNames="IDVehicles"
                    DataSourceID="SqlDataSource1">
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
 
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridBoundColumn DataField="IDVehicles" DataType="System.Guid"
            HeaderText="IDVehicles" ReadOnly="True" SortExpression="IDVehicles"
            UniqueName="IDVehicles">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="IDProfileFleet" DataType="System.Int32"
            HeaderText="IDProfileFleet" SortExpression="IDProfileFleet"
            UniqueName="IDProfileFleet">
        </telerik:GridBoundColumn>
    </Columns>
</MasterTableView>
            </telerik:RadGrid>
            <br />
            <br />
            <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                ConnectionString="<%$ ConnectionStrings:CF_SQL_Connection %>"
                SelectCommand="SELECT [IDVehicles], [IDProfileFleet] FROM [CF_Vehicles] WHERE ([IDProfileFleet] = @IDProfileFleet)">
                <SelectParameters>
                    <asp:ControlParameter ControlID="RadComboBox3" Name="IDProfileFleet"
                        PropertyName="SelectedValue" Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>
            <br />
        </div>
 
        <script type="text/javascript">
             
            var terminalsCombo;
            var fleetsCombo;
 
            function pageLoad() {
                 
                terminalsCombo = $find("<%= RadComboBox2.ClientID %>");
                fleetsCombo = $find("<%= RadComboBox3.ClientID %>");
            }
 
            function Loadterminals(combo, eventArqs) {
                var item = eventArqs.get_item();
                terminalsCombo.set_text("Loading...");
                fleetsCombo.clearSelection();
 
                 
                if (item.get_index() > 0) {
                     
                    terminalsCombo.requestItems(item.get_value(), false);
                }
                else {
                     
                    terminalsCombo.set_text(" ");
                    terminalsCombo.clearItems();
 
                    fleetsCombo.set_text(" ");
                    fleetsCombo.clearItems();
                }
            }
 
            function Loadfleets(combo, eventArqs) {
                var item = eventArqs.get_item();
 
                fleetsCombo.set_text("Loading...");
                  
                fleetsCombo.requestItems(item.get_value(), false);
            }
 
            function ItemsLoaded(combo, eventArqs) {
                if (combo.get_items().get_count() > 0) {
                     
                    combo.set_text(combo.get_items().getItem(0).get_text());
                    combo.get_items().getItem(0).highlight();
                }
                combo.showDropDown();
            }
 
        </script>
 
 
    </form>
</body>
</html>



VB

Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
Imports Telerik.Web.UI
 
Partial Class Default3
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        If Not Page.IsPostBack Then
 
            Loadaccounts()
        End If
    End Sub
 
    Protected Sub Loadaccounts()
        Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("CF_SQL_Connection").ConnectionString)
 
        Dim adapter As New SqlDataAdapter("SELECT * FROM [CF_Profile_Account] ORDER BY [AccountName]", connection)
        Dim dt As New DataTable()
        adapter.Fill(dt)
 
        RadComboBox1.DataTextField = "AccountName"
        RadComboBox1.DataValueField = "IDProfileAccount"
        RadComboBox1.DataSource = dt
        RadComboBox1.DataBind()
 
        RadComboBox1.Items.Insert(0, New RadComboBoxItem("- Select Account -"))
 
    End Sub
 
    Protected Sub Loadterminals(ByVal IDProfileAccount As String)
        Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("CF_SQL_Connection").ConnectionString)
 
 
        Dim adapter As New SqlDataAdapter("SELECT * FROM [CF_Profile_Terminal] WHERE ([IDProfileAccount] = @IDProfileAccount) ORDER BY [TerminalName]", connection)
        adapter.SelectCommand.Parameters.AddWithValue("@IDProfileAccount", IDProfileAccount)
 
        Dim dt As New DataTable()
        adapter.Fill(dt)
 
        RadComboBox2.DataTextField = "TerminalName"
        RadComboBox2.DataValueField = "IDProfileTerminal"
        RadComboBox2.DataSource = dt
        RadComboBox2.DataBind()
 
    End Sub
 
    Protected Sub Loadfleets(ByVal IDProfileTerminal As String)
        Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("CF_SQL_Connection").ConnectionString)
 
 
        Dim adapter As New SqlDataAdapter("SELECT * FROM [CF_Profile_Fleet] WHERE ([IDProfileTerminal] = @IDProfileTerminal)", connection)
        adapter.SelectCommand.Parameters.AddWithValue("@IDProfileTerminal", IDProfileTerminal)
 
        Dim dt As New DataTable()
        adapter.Fill(dt)
 
        RadComboBox3.DataTextField = "FleetName"
        RadComboBox3.DataValueField = "IDProfileFleet"
        RadComboBox3.DataSource = dt
        RadComboBox3.DataBind()
 
    End Sub
 
    Protected Sub RadComboBox1_ItemsRequested(ByVal o As Object, ByVal e As RadComboBoxItemsRequestedEventArgs) Handles RadComboBox1.ItemsRequested
 
        Loadaccounts()
 
    End Sub
 
    Protected Sub RadComboBox2_ItemsRequested(ByVal o As Object, ByVal e As RadComboBoxItemsRequestedEventArgs) Handles RadComboBox2.ItemsRequested
 
        Loadterminals(e.Text)
 
    End Sub
 
    Protected Sub RadComboBox3_ItemsRequested(ByVal o As Object, ByVal e As RadComboBoxItemsRequestedEventArgs) Handles RadComboBox3.ItemsRequested
 
        Loadfleets(e.Text)
 
    End Sub
 
End Class




Kevin
Top achievements
Rank 2
 answered on 28 Oct 2011
7 answers
407 views
Hi,

I have a radgrid bound to an entitydatasource control, I want to use user controls for the insert and edit forms, what is the best way to do this?

Is it possible to alter the auto generated edit forms or are user controls the only way to go?

Regards
Kevin
Top achievements
Rank 2
 answered on 28 Oct 2011
3 answers
183 views
Hi All,

We have purchased license for telerik extensions for asp.net ajax. Our primary objective is to manage our file upload and delete using File explorer. But after looking at the examples, it turned out that the control is a server side control and cannot be used in MVC razor. Is there a workaround for this?

Thanks in advance.
Rumen
Telerik team
 answered on 28 Oct 2011
3 answers
128 views
Hi,

Well, i have a problem with the radcontextmenu. Inside an ItemTemplate i use a RadListView to list some contracts i can choose from.
This radcontextmenu i add on an imageclick. It shows up when i click on a image. The folowing i added to the webusercontrol.

function showMenuC(e) {
             var contextMenu1 = $find("<%= RadContextC1.ClientID %>");
             contextMenu1.showAt(20, 135);
 
             $telerik.cancelRawEvent(e);
}

 
<asp:ImageButton ID="imgContractBtn1" Visible="true" OnClientClick="showMenuC(event);" ImageUrl="/images/someimage.png" runat="server" />


<Telerik:RadContextMenu id="RadContextC1" runat="server" EnableViewState="false"
    EnableRoundedCorners="true" EnableShadows="true" OnClientItemOpened="itemOpened" >
 
    <Items>
        <telerik:RadMenuItem CssClass="Contracts" text="ContractSelectie">
            <ItemTemplate>
                <div id="CatWrapper" class="Wrapper">
                     
                    <telerik:RadListView ID="RLVContractSelectie1" runat="server"
                        AllowPaging="false"
                        EnableAjaxSkinRendering="true" RegisterWithScriptManager="true" EnableViewState="false"
                        OnItemDataBound="RLVContracts_ItemDataBound"
                        GroupItemCount="1"
                        AllowMultiItemSelection="false" onneeddatasource="RLVContracts_NeedDataSource">
                        <ItemTemplate>
                            <fieldset class="myClass">
                                <div id="div-image">
                                    <asp:ImageButton ID="Image1" runat="server" SkinID="imgNoPicture" CssClass="imageStyle" />
                                </div>
                                <div id="textbox">
                                    some text
                                </div>
                                <div id="div-masker">
                                    <asp:ImageButton ID="imgMasker" CommandName="Select" CommandArgument='<%#DataBinder.Eval(Container.DataItem, "intContractPID")%>' runat="server" SkinID="imgMasker" CssClass="imageStyleMasker" />
                                </div>
                            </fieldset>
                        </ItemTemplate>
                    </telerik:RadListView>
                </div>
            </ItemTemplate>
        </telerik:RadMenuItem>
    </Items>
</Telerik:RadContextMenu>

Ok, I explain now what problem i got now, and what i allready tried to get it work properly.

First thing, i have everything placed in a radAjaxPanel. When i click my image (imgContractBtn1), it shows the contextmenu! It has the radListView filled with some contracts with images and some text on it. Then when i click the imgButton (imgMasker), it fires the onitemcommand of the RadListView and it postback. So my selected item is selected and everything works great, except ajax. It loads my screen with everything what should work. Everything works great, except for the ajax thing.

so, when i try putting on a radajaxpanel inside the radmenu itemtemplate of the radcontextmenu, Ajax works fine, but the contextmenu stays open with all the items of the radListView. It close when i click the white space in the radcontextmenu! so, the functionality of the radmenuitem works.

My final question is, how can i make this work properly?

i didn't found such scenary yet on the forum, so can someone help me? ofcoarse i allready tried a lot of things like instead of the normal image button i used a radbutton, no effect.

ofcoarse there is another solution for this, is that i add a lot of controls to the ajaxmanager, but then again, the contextmenu didn't close when i clicked my imgMasker (imagebutton)


Best regards,

Fandy Backers



 

Kate
Telerik team
 answered on 28 Oct 2011
1 answer
205 views
Hi

I use the RadSlider. I programicly from code behind put the items in the RadSlider. The thing is that i put too many items and the text is not shown, it's like "...", you can see it in the attachment. I put the tool tip but i also want to show the text.

In the code i tried this
for (double minute = 0; minute <= minutes; minute = minute + 15)
            {
                RadSliderItem radSliderItem;
               if (((int)minute) % 60 == 0)
               {
                   radSliderItem = new RadSliderItem(workHoursStartDate.ToString("HH:mm"), minute.ToString());
                    radSliderItem.ToolTip = workHoursStartDate.ToString("HH:mm");
                }
                else
                {
                    radSliderItem = new RadSliderItem("", minute.ToString());
                   radSliderItem.ToolTip = workHoursStartDate.ToString("HH:mm");
                }
                sliderTimeOffSlider.Items.Add(radSliderItem);
                workHoursStartDate = workHoursStartDate.AddMinutes(15);
            }

i thought that if i don't put text on all items, that the text will be shown on those that have.
Before that the code was like this
for (double minute = 0; minute <= minutes; minute = minute + 15)
            {
                RadSliderItem radSliderItem;
                radSliderItem = new RadSliderItem(workHoursStartDate.ToString("HH:mm"), minute.ToString());
                radSliderItem.ToolTip = workHoursStartDate.ToString("HH:mm");               
                sliderTimeOffSlider.Items.Add(radSliderItem);
                workHoursStartDate = workHoursStartDate.AddMinutes(15);
            }

I have pictures in the attachment from both cases.

So  do you have solution so i can show the time on the radSlider and not just on the tool tip

Regards,
Goran
Slav
Telerik team
 answered on 28 Oct 2011
4 answers
129 views
Greetings,

Currently I'm using an implementation of the RadEditor with a custom ImageManager.  It has the following custom pieces to it:

FileBrowser.ascx
ImageEditor.ascx
SetImageProperties.ascx

FileBrowser.ascx was the only real custom piece, due that we needed to hide a few options.  Recently, I was notified that the Image Editor is no longer working and the following error was spit out.
 

Server Error in '/Community' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.Editor.DialogControls.ImageEditorDialog.InitializeImageEditor() +22
   Telerik.Web.UI.Editor.DialogControls.ImageEditorDialog.OnInit(EventArgs e) +112
   System.Web.UI.Control.InitRecursive(Control namingContainer) +333
   System.Web.UI.Control.AddedControl(Control control, Int32 index) +198
   System.Web.UI.ControlCollection.Add(Control child) +80
   Telerik.Web.UI.DialogHandlerNoSession.AddDialogControl(Control dialogControl, DialogParameters dialogParameters) +252
   Telerik.Web.UI.DialogHandlerNoSession.LoadDialogControl() +606
   Telerik.Web.UI.DialogHandlerNoSession.CreateChildControls() +245
   System.Web.UI.Control.EnsureChildControls() +87
   Telerik.Web.UI.DialogHandlerNoSession.OnPreLoad(EventArgs e) +18
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +554


Version Information: Microsoft .NET Framework Version:2.0.50727.4206; ASP.NET Version:2.0.50727.4209

Nothing has changed in our implementation that I know of and was wondering if something changed when the newer version of the controls came out.  That is the only thing that has really changed that I know of.  Any help would be appreciated.  Thanks.

Kindest Regards,
Chad Johnson
Chad Johnson
Top achievements
Rank 1
 answered on 28 Oct 2011
1 answer
171 views
In RadGrid RowDblClick, I want to put the row in edit mode only if the user clicks certain cell columns in my grid (only if they click one of the non-readonly columns, for example). How can I alter it to conditionally inspect which column was clicked?
function RowDblClick(sender, eventArgs) {
    // inspect what column was clicked
    // if (columnindex in (3,6,7) { -- user clicked one of our editable columns, so allow edit
        sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
     // }
}

Or would it be possible to use a cell dbl-click event instead of row's dbl-click event, if such an event for cells exists?
Andrey
Telerik team
 answered on 28 Oct 2011
1 answer
82 views
Hi,

I have given 'Autosize' property for the Radwindow and set the height and width of the Page(Content) which can be accessed by the Rad Window.I have faced problem in safari that is am getting scrollbars inside Radwindow but not in IE.(See attached Image).
How can I avoid the scrollbars in safari ?

<telerik:RadWindowManager ID="RadWindowManagerAlertIssue" runat="server" VisibleStatusbar="False"
    EnableEmbeddedSkins="false" Skin="DDC" Behaviors="Close" ShowContentDuringLoad="false"  style="z-index: 1001"
    OnClientPageLoad="OnClientPageLoad" ReloadOnShow="true">
    <Windows>
        <telerik:RadWindow ID="DialogAlertIssue" Modal="true" IconUrl="/_WebControlsResources/Images/Icons/edit.gif"
             AutoSize="true"  runat="server">
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>


Page inside the Radwindow

 
<div>
            <table width="470px" height="150px" border="0" cellspacing="0" cellpadding="0" style="background: #afafd7 url(/_WebControlsResources/Images/TooltipPanels/RadTooltipBlue/email.jpg) no-repeat top right;">
                <tr>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td>
                        <div style="padding: 5px;">
                            <table>
                                <tr>
                                    <td style="color: #ffffff; font-size: 12px; font-weight: bold; padding-right: 10px; width: 1%; white-space: nowrap;" align="right" >
                                        <asp:Label ID="Label1" Text="Default Issue:" runat="server" Font-Bold="True" />
                                    </td>
                                    <td style="color: #ffffff; font-size: 12px; font-weight: bold;" >
                                        <asp:CheckBox ID="cbxDefaultIssue" runat="server" />
                                        <img height="16" width="16" align="absmiddle" style="padding-right: 5px;" src="/_WebControlsResources/Images/Icons/info_violet.gif"/>
                                        <span id="span1" runat="server" style="font-weight: bold; font-size: 11px;">Note: Only one issue can be flagged as the default.</span>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="color: #ffffff; font-size: 12px; font-weight: bold; padding-right: 10px;" align="right">
                                        <asp:Label ID="Label2" Text="Issue:" runat="server" Font-Bold="True" />
                                    </td>
                                    <td style="color: #ffffff; font-size: 11px; font-weight: bold;" padding-left: 5px;">
                                        <asp:Label ID="lblIssueName" runat="server" />
                                    </td>
                                </tr>
                                <tr>
                                    <td style="color: #ffffff; font-size: 12px; font-weight: bold; padding-right: 10px;" align="right">
                                        <asp:Label ID="Label3" Text="Description:" runat="server" Font-Bold="True" />
                                    </td>
                                    <td colspan="2" style="color: #ffffff; font-size: 11px; font-weight: bold;">
                                        <asp:Label ID="lblDescription" runat="server" />
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </td>
                </tr>
                <tr>
                   
                    <td colspan="4" height="36" valign="bottom">
                        <table height="36" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr valign="bottom">
                                <td class="Curved_Plinth_Left_BlueOnTransparent">
                                    <img src="/_WebControlsResources/Images/spacer.gif" width="40" height="36"></td>
                                <td valign="bottom" align="center" nowrap class="Curved_Plinth_Middle_Blue">
                                    <span class="NewPillBtn_GreenOnPlinthBlue">
                                        <asp:Button ID="ButtonSave" runat="server" Text="Save" OnClick="ButtonSave_Click" />
                                    </span>
                                </td>
                                <td valign="bottom" align="left" width="1" nowrap class="Curved_Plinth_Middle_Blue">
                                    <span class="NewPillBtn_BlueOnPlinthBlue">
                                        <asp:Button ID="ButtonCancel" runat="server" Text="Cancel" OnClientClick="javascript:closeOnUpdate(false);" />
                                    </span>
                                </td>
                                <td class="Curved_Plinth_Right_BlueOnTransparent">
                                    <img src="/_WebControlsResources/Images/spacer.gif" width="40" height="36"></td>
                            </tr>
                        </table>
                    </td>
                   
                </tr>
            </table>
        </div>

Marin Bratanov
Telerik team
 answered on 28 Oct 2011
1 answer
65 views
I have a RadMenuItem in a master page that works fine , but in some pages I have user control with a button in it which refresh rad grid.
But the problem is : when I click the button in usercontrol and grid refreshed , all child menu items disappears

Please help me to fix the problem
Peter
Telerik team
 answered on 28 Oct 2011
3 answers
313 views
Hi,
I'd like to add a custom "plus" graphic (16x16) png to the the upload button.
could someone point me to where to change the CSS or any other means to get this done.

thanks
Peter Filipov
Telerik team
 answered on 28 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?