Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
411 views
I have a RadGrid that I am using to get a couple of values from a stored procedure. There are always either no rows returned or one row returned. I need to get the values of those 2 cells IF there was a row returned and use them in a server-side C# method that was kicked off by another control. I have tried a bunch of different constructs and none of them works. The RadGrid is UserInfo and the 2 columns are UType and UKey. Both of the values are strings. Oh, the RadGrid is NOT visible. So how do I get the values back from the client side?
Alternately if I could find an example of how to call a stored proc from server side or client side and get the returned values I could do away with the RadGrid but I can't seem to get that to work either.

Thanks,

Joe B
Schlurk
Top achievements
Rank 2
 answered on 23 Oct 2009
2 answers
126 views
hi,

we are using rad grid in our application.We tested in firefox.we found that the grid is not rendering any records in mozilla.but it shows the number of records in the footer of the grid.
we need compatability in both mozilla and IE.

We found that applying css class to radgrid did not apply the required style completely.

So we took the css classes from telerik folder and overrided them in our css file like this

.RadGrid_ourCustomSkin,

.RadGrid_ourCustomSkin .rgMasterTable,

.RadGrid_ourCustomSkin .rgDetailTable,

.RadGrid_ourCustomSkin .rgGroupPanel table,

.RadGrid_ourCustomSkin .rgCommandRow table,

.RadGrid_ourCustomSkin .rgEditForm table,

.GridToolTip_ourCustomSkin

{

    font:12px/16px "segoe ui",arial,sans-serif;

}

please refer the attachment.
need help.

Regards,
Bharathwajan
Greg
Top achievements
Rank 2
 answered on 23 Oct 2009
7 answers
349 views

In my szenario i have a table. Inside this table there is an RadToolBar with two RadComboBoxes.

My problem is the handling of the Related ComboBoxes, after a postback. After the postback the second RadComboBox lost there

Datasource. What I try to do is to set second RadComboBox clientside in the pageLoad Function.

Depending of the value in the first RadComboBox (that i got in the pageLoad function) i try to refresh the datasource for the second RadComboBox.

Here is my code snippet:

    <script type="text/javascript">         
        //global variables for the countries and cities comboboxes  
        var RadGrid1;  
        var WTypesCombo;  
        var CDecisonCombo;  
        
        //------------------------------------------------------------------------  
        function GetGridObject(sender, eventArgs) {  
            RadGrid1 = sender;  
        }  
 
        //------------------------------------------------------------------------  
        function pageLoad() {  
            // initialize the global variables  
            // in this event all client objects   
            // are already created and initialized  
            WTypesCombo                 = $find('<%=rdtbWl.FindItemByText("rtbWTypes").FindControl("rcbWTypes").ClientID %>');  
            CDecisonCombo               = $find('<%=rdtbWl.FindItemByText("rtbCDecision").FindControl("rcbCDecision").ClientID %>');  
         
            //Get the selected type  
            //this will only triggert if a submit event exists  
            var SelectedIndex = document.getElementById("<%= SelectedWType.ClientID %>").value;  
              
            if (SelectedIndex != "0") {  
                //HERE REFRESH THE SECOND RADCOMBOBOX  
                CDecisonCombo.requestItems(SelectedIndex.get_text(), false);  
            }  
 
        }  
        //------------------------------------------------------------------------  
        function OnClientSelectedIndexChanged(sender, eventArgs) {  
              
            var item = eventArgs.get_item();  
            //the first item is always the item to show all rows  
            //we can not use a value because all values are identical. Only text are unique  
            if (item.get_index() == "0") {  
                //Set worklist type in hidden field to store in session, when the submit event is fired  
                document.getElementById("<%= SelectedWType.ClientID %>").value = item.get_index();  
            }  
            else {  
                //Set worklist type in hidden field to store in session, when the submit event is fired  
                document.getElementById("<%= SelectedWType.ClientID %>").value = item.get_text();  
            }  
              
            CDecisonCombo.set_text("Loading...");  
              
            // if a Worklisttyp is selected  
            if (item.get_index() > 0) {  
                // this will fire the ItemsRequested event of the  
                // combobox passing the WtypID as a parameter  
                CDecisonCombo.requestItems(item.get_text(), false);  
            }  
            else {  
                // the -Select a continent- item was chosen  
                CDecisonCombo.set_text(" ");  
                CDecisonCombo.clearItems();  
            }  
        }  
 
        //------------------------------------------------------------------------  
        function ItemsLoaded(combo, eventArqs) {  
              
            if (combo.get_items().get_count() > 0) {  
                // pre-select the first item  
                combo.set_text(combo.get_items().getItem(0).get_text());  
                combo.get_items().getItem(0).highlight();  
            }  
        }  
        //------------------------------------------------------------------------  
 
    </script> 
 
</telerik:RadCodeBlock> 
 
<table cellpadding="0" cellspacing="0" border="0" width="100%">  
    <tr> 
        <td> 
            <telerik:RadToolBar ID="rdtbWl" runat="server"   
                Style="display: block; float: none" Visible="true" 
                Width="100%" OnClientButtonClicked="OnClientButtonClicking"   
                OnButtonClick="rdtbWl_ButtonClick" 
                OnClientMouseOver="clientMouseOver" 
                OnClientMouseOut="clientMouseOut" 
                meta:resourcekey="rdtbWlResource1">  
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                <Items> 
                    <telerik:RadToolBarButton Value="rtbWTypes" Text="rtbWTypes">  
                        <ItemTemplate> 
                            <telerik:RadComboBox ID="rcbWTypes"   
                                                    runat="server"   
                                                    CssClass="DefaultText" 
                                                    OnClientSelectedIndexChanged="OnClientSelectedIndexChanged" 
                                                    DataTextField="Shorttext" 
                                                    DataValueField="Shorttext" 
                                                    HighlightTemplatedItems="True">  
                                <CollapseAnimation Duration="200" Type="OutQuint" /> 
                            </telerik:RadComboBox> 
                        </ItemTemplate> 
                    </telerik:RadToolBarButton> 
                    <telerik:RadToolBarButton Value="rtbCDecision" Text="rtbCDecision">  
                        <ItemTemplate> 
                            <telerik:RadComboBox ID="rcbCDecision"   
                                                    runat="server"   
                                                    CssClass="DefaultText"   
                                                    OnClientItemsRequested="ItemsLoaded" 
                                                    OnItemsRequested="rcbCDecision_ItemsRequested">  
                                <CollapseAnimation Duration="200" Type="OutQuint" /> 
                            </telerik:RadComboBox> 
                        </ItemTemplate>      
                    </telerik:RadToolBarButton> 
                    <telerik:RadToolBarButton Text="rtbColumnSetDecision"   
                        Value="rtbColumnSetDecision"   
                        runat="server" PostBack="false"   
                        meta:resourcekey="RadToolBarButtonResource4" > 
                    </telerik:RadToolBarButton> 
                    <telerik:RadToolBarButton Text="rtbCDecisionExecute" 
                        Value="rtbCDecisionExecute"   
                        runat="server" PostBack="true">  
                    </telerik:RadToolBarButton> 
                </Items> 
            </telerik:RadToolBar> 
        </td> 
    </tr> 
</table> 
 
<%--store the selected Type--%> 
 <asp:HiddenField ID="SelectedWType" runat="server" Value="0"/>  
 
 

The same example we find in the telerik demos: [Related ComboBoxes]
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multiplecomboboxes/defaultcs.aspx

Thanks for any help
Echarbeneau
Top achievements
Rank 1
 answered on 23 Oct 2009
2 answers
119 views
Hello,

Is anyone aware of a (pre-existing) way to get rad controls' script objects from a collection of DOM objects (all of this on the client-side)?

I'll explain (this is a simplistic example, and other solutions apply for this example, but it will illustrate the scenario):
Imagine I want to get a collection of objects on the page, like all rad textboxes that had "Company" in their ID, and I want to clear them.

Outside of rad, I'd use jQuery, something like:
$(":text[id*=Company]").val("");


But say I'd like to use the .clear() function on the script object (the javascript object that is returned by $find(), instead of $get()) -- is there a way to get an array of the script objects if I have a jQuery collection of the DOM objects?

I know that this isn't a strong usage scenario (the .clear() on the script object may be the same as the setting the HTML object's value to empty string), but other scenarios could exist, like setting up events in bulk, changing the selected item on a RadComboBox in bulk, dynamically modifying an object such that you need to use .trackChange() and .commit(), etc.

I also know converting a bunch of DOM objects to a bunch of script objects isn't difficult -- it would essentially be looping over each DOM object in a collection, either examining a property on the DOM object as a filter (to see if represents a Telerik control) before calling $find on the DOM object's ID, or calling $find on all DOM object IDs and checking a property on the script object (if it isn't null; to see if it represented a Telerik control).

I'm asking if some functionality (like a jQuery plugin) had been developed, or is maintained by Telerik, so that you guys can optimize it (maybe there is a way to get the script objects without a loop), or any member of the community, so the effort isn't duplicated.

Anyone aware of a pre-existing methodology or library call to achieve this functionality?

Thanks,

Matthew





Matthew
Top achievements
Rank 1
 answered on 23 Oct 2009
2 answers
172 views
Hi

Can you give me some help on this... I am struggling.

I have a column on which the column sort does not work,
<telerik:GridTemplateColumn DataField="PricePerBottle"   
DataType="System.Decimal" HeaderText="£/Bottle"   
SortExpression="PricePerBottle" UniqueName="PricePerBottle">  
    <ItemTemplate> 
        <asp:Label ID="PricePerBottleLabel" runat="server"   
        Text='<%# ConstClass.getCurrencyPrice(Eval("PricePerBottle"))%'>  
        </asp:Label> 
    </ItemTemplate> 
    <HeaderStyle HorizontalAlign="Right" Width="70px" /> 
    <ItemStyle HorizontalAlign="Right" /> 
</telerik:GridTemplateColumn> 
It all looks OK to me but maybe the code behind is interfering, because I change the HeaderText in the ItemDataBound event.
Could that be an issue?  Can I get round it?
Thanks for your help!

Clive

Clive Hoggar
Top achievements
Rank 1
 answered on 23 Oct 2009
5 answers
324 views
I'm trying to figure out how to insert a record by using a UserControl. I have a Master Gridview with a child gridview and want to be able to insert a new record into the child grid. I have created a UserControl  "InsertOil.ascx" and added a reference to it in the RadGrid but when I click on the Add New Record button I only get the built in edit/insert form which works so I guess I have not configured the grid to call the UserControl properly. I will post the relevant code in hopes that someone can stewer me in the right directio before I go completely mad. Thanks for any help.          




<%@ Page Title="" Language="VB" MasterPageFile="~/Facilities.master" AutoEventWireup="false" CodeFile="OilAdditions.aspx.vb" Inherits="SiteReporting_OilAdditions" %>  
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>  
 
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" Runat="Server">  
 
<telerik:RadGrid ID="RadGrid1"   
                 runat="server"   
                 DataSourceID="sdsGenerators"   
                 GridLines="None"   
                 ShowGroupPanel="True" Skin="Hay"   
                 AutoGenerateColumns="False" 
                 Width="500px">  
 
<MasterTableView DataSourceID="sdsGenerators"   
                 GroupLoadMode="Client"   
                 DataKeyNames="EquipmentID"   
                 HierarchyLoadMode="Client" 
                   
                   
                   
                 >  
 
 
    <DetailTables>  
        <telerik:GridTableView  runat="server"   
                                DataSourceID="sdsOilAdditions"   
                                AllowAutomaticInserts="True"   
                                GroupLoadMode="Client"   
                                HierarchyLoadMode="Client" AllowPaging="True"   
                                CommandItemDisplay="Top">  
            <ParentTableRelation>  
                <telerik:GridRelationFields  DetailKeyField="EquipmentID"   
                                             MasterKeyField="EquipmentID" />  
            </ParentTableRelation>  
              
            <Columns>  
                <telerik:GridBoundColumn DataField="DateAdded" DataFormatString="{0:dd MMM,  yy}" HeaderText="DateAdded" DataType="System.DateTime" UniqueName="DateAdded">  
                </telerik:GridBoundColumn>  
                <telerik:GridBoundColumn DataField="Quantity" HeaderText="Qty (Gals)" DataType="System.Double" UniqueName="Quantity">  
                </telerik:GridBoundColumn>  
                <telerik:GridBoundColumn DataField="Scheduled" HeaderText="Added During RWP" DataType="System.Boolean" UniqueName="Scheduled">  
                </telerik:GridBoundColumn>  
                  
 
 
                 
            </Columns>  
              
        </telerik:GridTableView>  
    </DetailTables>  
                
<ExpandCollapseColumn Visible="True"></ExpandCollapseColumn>  
                
            <Columns>  
                <telerik:GridBoundColumn DataField="EquipmentID_Old"   
                                         HeaderText="Generator"   
                                         SortExpression="EquipmentID_Old"   
                                         UniqueName="EquipmentID_Old">  
                </telerik:GridBoundColumn>  
            </Columns>  
            <EditFormSettings UserControlName="InsertOil.ascx" EditFormType="WebUserControl">  
                    <EditColumn UniqueName="EditCommandColumn1">  
                    </EditColumn>  
                </EditFormSettings>  
     </MasterTableView>  
         
    </telerik:RadGrid>  
       
    <asp:SqlDataSource ID="sdsGenerators" runat="server"   
        ConnectionString="<%$ ConnectionStrings:AAIOMSConnectionString %>"   
        SelectCommand="spSelectFAC_PowerPlantsBySiteID"   
        SelectCommandType="StoredProcedure">  
        <SelectParameters>  
            <asp:SessionParameter DefaultValue="7" Name="SiteID" SessionField="SiteID"   
                Type="Int32" />  
        </SelectParameters>  
    </asp:SqlDataSource>  
     
    <asp:SqlDataSource ID="sdsOilAdditions" runat="server"   
        ConnectionString="<%$ ConnectionStrings:AAIOMSConnectionString %>"   
        SelectCommand="spSelectFAC_OilAdditionsByEquipmentID"   
        SelectCommandType="StoredProcedure"   
        InsertCommand="spInsertFAC_OilAdditions" InsertCommandType="StoredProcedure">  
        <SelectParameters>  
            <asp:SessionParameter Name="EquipmentID"  SessionField="EquipmentID"   
                Type="Int32" />  
        </SelectParameters>  
        <InsertParameters>  
            <asp:Parameter Name="EquipmentID"  Type="Int32" />  
            <asp:Parameter Name="DateAdded" Type="DateTime" />  
            <asp:Parameter Name="Scheduled" Type="Boolean" />  
            <asp:Parameter Name="Quantity" Type="Double" />  
            <asp:Parameter Name="AddedBy" Type="String" />  
        </InsertParameters>  
    </asp:SqlDataSource>  
</asp:Content>  
 

Here is the User Control 
 
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="InsertOil.ascx.vb" Inherits="WorkOrders_InsertOil" %>  
 
        EquipmentID<asp:TextBox ID="txtEquipmentID" runat="server"></asp:TextBox><br />  
        Date Added<asp:TextBox ID="txtDateAdded" runat="server"></asp:TextBox><br />  
        Quantity<asp:TextBox ID="txtQuantity" runat="server"></asp:TextBox><br />  
        Added By<asp:TextBox ID="txtAddedBy" runat="server"></asp:TextBox><br />  
        Scheduled<asp:CheckBox ID="chkScheduled" runat="server" /> 


AkAlan
Top achievements
Rank 2
 answered on 23 Oct 2009
1 answer
119 views
Hi, I´m using multiples RadComboBoxes (Q3 2008) combined with RadTabStrip  and after making one selection, when I move to the next combo the first combo becames unresponsive (even the hover isn´t working). To be able to change the firt selection I have to click anywhere in the page first.

Does anyboby experienced this before?

Thanks,

Rod
Simon
Telerik team
 answered on 23 Oct 2009
3 answers
153 views
RadChart will not display after deploying compiled code to my staging server, but runs fine on my local development environment.

Dev environment is Win7 64bit, iis7 in integrated mode.

Staging is Windows 2003 server 64 bit.

Http handlers look like this:
in system.web:
<add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false"/> 

in system.webserver:
<add name="ChartImage_axd" verb="*" preCondition="integratedMode" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler"/> 

Any help on getting this working on the 2003 server would be much appreciated!!
Giuseppe
Telerik team
 answered on 23 Oct 2009
4 answers
239 views
Is there a way to keep the cursor from changing to a text select when hovering over the combo box? I tried using EnableTextSelection="false", but this did not seem to have any effect. I don't want the user to type in the combo box. I also want the pointer cursor regardless of where you are hovering over the combobox.

Thanks,
Levi
Vishwa
Top achievements
Rank 2
 answered on 23 Oct 2009
2 answers
102 views

hi,

i have added the following style to aspx page. But still image is getting disappered on mouse hover.
I am using telerik verion 2009.2.826.20.

please help me....

 

 

 


<

 

style type="text/css">

 

 

.RadTreeView .rtPlus

 

{

 

background-image: url('../Images/Folderclosed.gif') !important;

 

 

height: 10px !important;

 

 

width: 12px !important;

 

}

 

 

.RadTreeView .rtMinus

 

{

 

background-image: url('../Images/Folderopen.gif') !important;

 

 

height: 10px !important;

 

 

width: 12px !important;

 

}

 

 

.RadTreeView .rtLI rtLast

 

{

 

background-image: url('../Images/Closed_folder.gif') !important;

 

 

background-position: 0px 0px !important;

 

 

height: 10px !important;

 

 

width: 10px !important;

 

 

}

 

.RadTreeView .rtMinus:hover

 

{

 

background-position: 0px 0px !important;

 

 

}

 

 

.RadTreeView .rtPlus:hover

 

{

 

background-position: 0px 0px !important;

 

}

 

 

</style>

Regards,
Medac 

 

Genady Sergeev
Telerik team
 answered on 23 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?