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

Hello Sir

I want to filter the radgrid column but it can give the error selection out of range when i m trying to add 2nd drop downlist search for 2nd column. It works when i add the dropdownlist for single column it will works fine , but in 2nd gives error .


<telerik:GridTemplateColumn HeaderText="Primary Product" DataField="ProdName" UniqueName="ProdName"
                                                                                AllowFiltering="true" AutoPostBackOnFilter="true">
                                                                                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                                                         
                                                                                <ItemTemplate>
                                                                                  <%# DataBinder.Eval(Container.DataItem,"ProdName") %>
                                                                                    <input type="hidden" id="hidPropID" runat="server" value='<%# DataBinder.Eval(Container.DataItem,"Proposal_ID")%>'
                                                                                        name="hidPropID" />
                                                                                    <input type="hidden" id="hidProposalGrpVal" runat="server" value='<%# DataBinder.Eval(Container.DataItem,"ProposalGrpVal")%>'
                                                                                        name="hidProposalGrpVal" />
                                                                                    <input type="hidden" id="hidChecked" runat="server" value='<%# DataBinder.Eval(Container.DataItem,"Checked")%>'
                                                                                        name="hidChecked" />
                                                                                </ItemTemplate>
                                                                             <FilterTemplate>
                                                                                    <telerik:RadComboBox ID="ddlPrimProd" Width="130" DataSourceID="Sqlprimprod" DataTextField="Name"
                                                                                        DataValueField="Name" Height="70" SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("Name").CurrentFilterValue %>'
                                                                                        runat="server" AppendDataBoundItems="True" Sort="Ascending" SortCaseSensitive="false"
                                                                                         MarkFirstMatch="true" Skin="Black" OnClientSelectedIndexChanged="ProdSelectedIndexChanged">
                                                                                        <Items>
                                                                                            <telerik:RadComboBoxItem Text="< Any Product >" />
                                                                                        </Items>
                                                                                    </telerik:RadComboBox>
                                                                                    <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">

                                                                                        <script type="text/javascript">
                                                                                            function ProdSelectedIndexChanged(sender,args) {
                                                                                            var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");
                                                                                                  if (sender.get_value() != "0")
                                                                                                   {                                                                                               
                                                                                                        tableView.filter("Name",args.get_item().get_value(),"EqualTo");
                                                                                                   }
                                                                                                else {
                                                                                                        tableView.filter("Name", args.get_item().get_value(), "NoFilter");
                                                                                                  }
                                                                                            }
                                                                                        </script>

                                                                                    </telerik:RadScriptBlock>
                                                                                </FilterTemplate></telerik:GridTemplateColumn>


<telerik:GridBoundColumn HeaderText="Crop" DataField="CropName" AllowFiltering="true"
                                                                                UniqueName="Name" AutoPostBackOnFilter="true" SortExpression="CropName">
                                                                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
                                                                               
                                                                                <%--<ItemStyle Width="10%" />--%>
                                                                               <%--<FilterTemplate >
                                                                                <telerik:RadComboBox ID="ddlcrop" Width="130" DataTextField="CropName" ShowToggleImage ="false" EnableLoadOnDemand = "true"
                                                                                    DataValueField="CropName" runat="server" AppendDataBoundItems="true" markFirstMatch="true" Skin="Black"></telerik:RadComboBox>
                                                                                </FilterTemplate>--%>                  
                                                                                                                                                              
                                                                                <FilterTemplate>
                                                                                <telerik:RadComboBox ID="ddlcrop" Width="130" DataSourceID="SqlDataSource1" DataTextField="Name"
                                                                                    DataValueField="Name" Height="90" SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("Name").CurrentFilterValue %>'
                                                                                    runat="server" AppendDataBoundItems="true" OnClientSelectedIndexChanged="SelectedIndexChanged"
                                                                                    MarkFirstMatch="true" Skin="Black">
                                                                                    <Items>
                                                                                        <telerik:RadComboBoxItem Text=" <  Every  >" />
                                                                                    </Items>
                                                                                </telerik:RadComboBox>
                                                                                <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

                                                                                    <script type="text/javascript">
                                                                                            function SelectedIndexChanged(sender,args) {
                                                                                            var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>");
                                                                                                  if (sender.get_value() != "0")
                                                                                                   {                                                                                                
                                                                                                        tableView.filter("Name",args.get_item().get_value(),"Contains");
                                                                                                   }
                                                                                                else {
                                                                                                        tableView.filter("Name", args.get_item().get_value(), "NoFilter");
                                                                                                  }
                                                                                            }
                                                                                    </script>

                                                                                </telerik:RadScriptBlock>
                                                                            </FilterTemplate>
                                                                            </telerik:GridBoundColumn>



It gives exception when page is postback

  dgProposals.DataBind()

I m confuse why it happen bcuz it works when i trying for single column it will filter out proper , but when i add the the combobox for another column it gives exception.


The datasources are different ;


<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:GoConnectionString %>"
        SelectCommand="SELECT [ID], [Name] FROM [Crop]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="sqlprimprod" runat="server" ConnectionString="<%$ ConnectionStrings:GoConnectionString %>"
        SelectCommand="SELECT [Name] FROM [QryProdTN] ORDER BY [Name]"></asp:SqlDataSource>


Help Me urgent sir, Its very urgnet need


I hv seen your online demo but m not getting the solution from that .


reply urgent
Georgi Krustev
Telerik team
 answered on 12 Aug 2009
1 answer
148 views
as you can see under the code below i have these 3 radcombobox
<telerik:RadComboBox ID="ddl_Stores" AutoPostBack="true" runat="server" Visible="false" Width="100px" Skin="Forest" />&nbsp;&nbsp;                                               
<telerik:RadComboBox ID="ddl_Departments" AutoPostBack="true"  runat="server" Visible="false" Width="200px" Skin="Forest"/>&nbsp;&nbsp;  
<telerik:RadComboBox ID="ddl_Paging1" AutoPostBack="true" runat="server" Visible="false" Width="100px" Skin="Forest"/><br /><br /> 


and everytime when i tried to do
telerik:AjaxSetting AjaxControlID="ddl_Stores">  
                    <UpdatedControls>                          
                        <telerik:AjaxUpdatedControl ControlID="ddl_Paging1" /> 
                        <telerik:AjaxUpdatedControl ControlID="tbl_Data" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        <telerik:AjaxUpdatedControl ControlID="PivotTable" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
 it would just create a break right after ddl_departments. so instead of having all 3 horizontally in one line, i now have first 2 in one line and the third dropdown in the next line. WHY IS IT? can you tell me what i did wrong? thanks.



<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Report.aspx.vb" Inherits="Report" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head id="Head1" runat="server">  
    <title>Sales Report</title> 
    <script type="text/javascript" src="FusionCharts/FusionCharts.js"></script> 
    <script type="text/javascript">  
        function RequestStart(sender, eventArgs)  
        {  
            var divElementStyle = document.getElementById("RadAjaxLoadingPanel1").style;  
            divElementStyle.position = 'absolute';  
            //position the loading panel  
            divElementStyle.left = eventArgs.get_eventTargetElement().offsetLeft + "px";  
            divElementStyle.top = eventArgs.get_eventTargetElement().offsetTop + "px";  
        }  
    </script>   
    <style type="text/css">  
        .CustomCssClass1 .rspPaneTabText, .rspPane, .RadSplitter  
        {  
            color: white !important;  
            border-color: white !important;  
        }  
        .CustomCssClass2 .rspSlideTitle     
        {  
            color: white !important;  
        }   
    </style>     
</head>      
<body style="background-color:#3d766f;; font-family:Verdana; font-size:12px;">  
    <form id="form1" runat="server">  
        <telerik:radscriptmanager id="RadScriptManager1" runat="server" AsyncPostBackTimeout="0" /> 
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Office2007" DecoratedControls="All" /> 
        <telerik:radajaxmanager id="RadAjaxManager1" runat="server" EnableEmbeddedScripts="true">    
            <ClientEvents OnRequestStart="RequestStart" /> 
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="ddl_Stores">  
                    <UpdatedControls>                          
                        <telerik:AjaxUpdatedControl ControlID="ddl_Paging1" /> 
                        <telerik:AjaxUpdatedControl ControlID="tbl_Data" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        <telerik:AjaxUpdatedControl ControlID="PivotTable" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="ddl_Departments">  
                    <UpdatedControls>                          
                        <telerik:AjaxUpdatedControl ControlID="ddl_Paging1" /> 
                        <telerik:AjaxUpdatedControl ControlID="tbl_Data" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        <telerik:AjaxUpdatedControl ControlID="PivotTable" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="ddl_Paging1">  
                    <UpdatedControls>                          
                        <telerik:AjaxUpdatedControl ControlID="ddl_Paging1" /> 
                        <telerik:AjaxUpdatedControl ControlID="tbl_Data" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        <telerik:AjaxUpdatedControl ControlID="PivotTable" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:radajaxmanager>     
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" > 
            <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border:0;" /> 
        </telerik:RadAjaxLoadingPanel> 
        <asp:Table ID="tbl_Report" runat="server" BorderWidth="1px" cellpadding="5" cellspacing="0" width="100%" HorizontalAlign="center" height="100%" BackColor="#ffffff">  
            <asp:TableRow> 
                <asp:TableCell ColumnSpan="2"><asp:Label ID="lb_Error" runat="server" Font-Bold="true" ForeColor="red" /></asp:TableCell> 
            </asp:TableRow>                                                        
            <asp:TableRow> 
                <asp:TableCell VerticalAlign="top" ColumnSpan="2" Width="100%" Height="100%" BackColor="white">  
                    <telerik:RadSplitter id="RadSplitter1" runat="server" CssClass="CustomCssClass1" Skin="Forest" Width="100%" Height="23px" visible="false">  
                        <telerik:RadPane runat="server" id="RadPane1" Width="100%" > 
                            <telerik:RadSlidingZone runat="server" ID="RadSlidingZone_Graph" SlideDirection="Bottom">  
                                 <telerik:RadSlidingPane id="RadSlidingPane_Graph" title="Graph" runat="server" Scrolling="both">  
                                    <telerik:RadComboBox ID="ddlcharttype" Font-Size="12px" runat="server" Skin="Forest" AutoPostBack="true">                                                                                                  
                                        <Items> 
                                            <telerik:RadComboBoxItem Text="Select a chart type" Value="" /> 
                                            <telerik:RadComboBoxItem Text="Area" Value="Area" /> 
                                            <telerik:RadComboBoxItem Text="Bar" Value="Bar" /> 
                                            <telerik:RadComboBoxItem Text="Column" Value="Column" /> 
                                            <telerik:RadComboBoxItem Text="Line" Value="Line" /> 
                                        </Items> 
                                    </telerik:RadComboBox>    
                                 </telerik:RadSlidingPane> 
                            </telerik:RadSlidingZone>                                                
                        </telerik:RadPane> 
                    </telerik:RadSplitter>      
                    <telerik:RadComboBox ID="ddl_Stores" AutoPostBack="true" runat="server" Visible="false" Width="100px" Skin="Forest" />&nbsp;&nbsp;                                                 
                    <telerik:RadComboBox ID="ddl_Departments" AutoPostBack="true"  runat="server" Visible="false" Width="200px" Skin="Forest"/>&nbsp;&nbsp;  
                    <telerik:RadComboBox ID="ddl_Paging1" AutoPostBack="true" runat="server" Visible="false" Width="100px" Skin="Forest"/><br /><br /> 
                    <asp:Table ID="tbl_Data" runat="server">  
                        <asp:TableRow> 
                            <asp:TableCell> 
                                <asp:Literal ID="PivotTable" runat="server" Visible="false" /> 
                            </asp:TableCell> 
                        </asp:TableRow> 
                    </asp:Table> 
                </asp:TableCell> 
            </asp:TableRow>    
            <asp:TableRow> 
                <asp:TableCell ColumnSpan="2">  
                    <asp:Button ID="ExportToExcel" runat="server" Text="Export" /> 
                </asp:TableCell> 
            </asp:TableRow> 
        </asp:Table> 
    </form> 
</body> 
</html> 
 
Vlad
Telerik team
 answered on 12 Aug 2009
1 answer
77 views
Is there a way to turn off the custom dictionary options for spellchecking in the radeditor 2009 q1? I do not want people adding to the dictionary because of the large audience using the editor.
Rumen
Telerik team
 answered on 12 Aug 2009
2 answers
212 views

I have a RadWindow that I am unable to display the contents of the URL that is specified in the NavigateUrl property after the page does a postback. When the page first loads, I can open the RadWindow with no problem. But after I click on an asp.net button, which causes a postback, the RadWindow opens but does not load the page.
 
I am using a Master page, and the content page contains a user control, that contains the RadWindowManager and the RadWindow declaration. Someone please help!!!!
 
This is the aspx  code to call the js function to open the window:
<asp:HyperLink ID="lockerSettingsLnk" Text="windowLink" runat="server" 
                    NavigateUrl="javascript:showRadWindow();" /> 
 

The Javascript Function
  function showRadWindow ()  
    { 
        var radWindow = window.radopen(null, "myWindow"); 
        radWindow.argument = new Object(); 
        radWindow.argument.refreshParent = false; 
    } 
 
 
This is the aspx  code for a button:
<asp:Button ID="testButton" runat="server" OnClick="testButton_clicked"/> 

This is the aspx  code for the RadWindowManager and RadWindow declaration:
<telerik:RadWindowManager id="radWindowManager" runat="server" enableembeddedskins="True"> 
    <Windows> 
        <telerik:RadWindow id="mywindow" Behaviors="Close, Move, Resize, Maximize" ReloadOnShow="true" VisibleStatusbar="true" ShowContentDuringLoad="false" 
                 Left="150px" Modal="true" Runat="server" Width="600px" Height="450px" > 
        </telerik:RadWindow>         
    </Windows> 
</telerik:RadWindowManager>
 
Duy
Top achievements
Rank 1
 answered on 12 Aug 2009
4 answers
114 views
All,

I currently have controls inside of a custom template that need to pass a strict validation process. For instance, there are two datetime pickers within the Template whose values need to be passed to a custom validation function. The problem that I am getting is how to pass those values to say the following customvalidator servervalidate routine. I seem to only be able to reference the items in one of the radgrid commands as shown below:
Protected Sub RadGrid2_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid2.UpdateCommand  
        If TypeOf e.Item Is GridEditableItem Then 
            Dim editedItem As GridEditFormItem = CType(e.Item, GridEditFormItem)  
            Dim StartTime As RadDateTimePicker = CType(editedItem.FindControl("RadDateTimePickerStart"), RadDateTimePicker)  
 
            Dim EndTime As RadDateTimePicker = CType(editedItem.FindControl("RadDateTimePickerEnd"), RadDateTimePicker)  
            Dim LeaveType As RadComboBox = CType(editedItem.FindControl("drpleavetype"), RadComboBox)  
            Dim LeaveRequest_Fkey As Label = CType(editedItem.FindControl("lblid"), Label)  
                          
 
 
 
 
 
 
        End If 

I need to be able to reference these values in the custom validator event as shown below:
Private Sub HoursPositiveValidator_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles HoursPositiveValidator.ServerValidate  
 

 

'Create variable to hold instance of validation return array.

 

 

Dim ReturnArray = LeaveClass.CustomDateValidation(FirstGridDateTimePicker.selectedvalue, SecondGridDateTimePicker.selectedvalue)

 

    If returnarray(0) = "False" then
        args.isvalid = false
    End If
End Sub 
Is it possible to reference these values outside of one of the radgrid events because a standard validation and custom validation will not fit my needs. Any help will be greatly appreciated.

Thanks,
Jonathan Adkins
Veli
Telerik team
 answered on 12 Aug 2009
1 answer
180 views
hi:
Is there any way to have something like this?

menu item 1:
Navigateurl="javascript:fnOpenWin(xxxx,xxx)"

menu item 2:
Navigateurl="javascript:fnOpenWin(xxxx,yyyy)"


I mean, if there is a way to call a javascript function directly from the navigateurl. I have a dynamic creation of the menu, so I need to have only in the clientside the commands( and the code) required for that particular user profile.

Thanks in advance.
Shinu
Top achievements
Rank 2
 answered on 12 Aug 2009
5 answers
784 views
I have a a RadTabStrip with two tabs (Documents and Search) in a RadDock control. Each tab has a RadGrid. The Documents tab's grid is just to display some documents with their index values. The Search tab's grid allows for document search. When you click the search button I switch to the Documents tab and do an ajax update to load the search results.

But when you switch to the Search tab I increase the containing RadDock's height client-side so you can see the whole search grid. When I switch back to the Documents tab the grid only fills about half the RadDock leaving an often unnecessary scrollbar because the grid height was initially sized server-side to fit the original RadDock height.

So, in a roundabout way we get to my question: how do I go about changing the height of a RadGrid client-side? I couldn't see any client-side functions in the documentation. Is there a way to do this?

Thanks.
Veli
Telerik team
 answered on 12 Aug 2009
1 answer
121 views
hi, i need to set Direction of PanelBar in run time, is this code wrong ? it didn't worked

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ctrlSideMenu.ascx.cs"
    Inherits="Controls_ctrlSideMenu" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadPanelBar ID="rpbSideMenu" runat="server" ExpandMode="SingleExpandedItem" >
    <CollapseAnimation Type="InQuint" />
    <ExpandAnimation Type="OutQuint" />
</telerik:RadPanelBar>
----------------------------------------------------------------------------------------------------------------------------------
.
.
.
.
rpbSideMenu.Style.Add(HtmlTextWriterStyle.Direction, CurrentCulture.language_direction ?
            "ltr" : "rtl");
        rpbSideMenu.Style.Add(HtmlTextWriterStyle.TextAlign, CurrentCulture.language_direction ?
            "Left" : "Right");

        rpbSideMenu.DataFieldID = "LinkID";
        rpbSideMenu.DataFieldParentID = "ParentLinkId";
        rpbSideMenu.DataTextField = "link_text";
        rpbSideMenu.DataNavigateUrlField = "URL";
        rpbSideMenu.DataSource = listLinks;
        rpbSideMenu.DataBind();
.
.
.
.



Princy
Top achievements
Rank 2
 answered on 12 Aug 2009
1 answer
64 views
Hello all,

We have created one aspx page that uses radgrid and works perfectly , but when we try to put it into crm 4.0 as a custom page

we get this java script error:
Line 18420 object required when we try to move from one option to another

Has anyone had this problem ?

Thanks
Tsvetoslav
Telerik team
 answered on 12 Aug 2009
9 answers
272 views
Hello,

I want to insert a new record into more than one MS access data table at one time.
Therefor I am using manual databinding in codebehind on the insert operation.
I've read and tried every solution i've found in this forum without any luck.
I'm using:

<

 

EditFormSettings EditFormType="Template">

I've tried retrieving the insert data both in ItemCommand and in InsertCommand:

 

protected void detailsGrid_ItemCommand(object source, GridCommandEventArgs e)  
    {  
        if (e.CommandName == RadGrid.PerformInsertCommandName)  
        {  
            //GridEditableItem insertedItem = (GridEditableItem)e.Item;   
            GridEditFormInsertItem insertedItem = e.Item as GridEditFormInsertItem;  
            string LastName = (insertedItem["TextBox2"].Controls[0] as TextBox).Text;  
        }  
    } 
And:
 protected void detailsGrid_InsertCommand(object source, GridCommandEventArgs e)  
    {  
        //GridEditableItem insertedItem = e.Item as GridEditableItem;  
        GridEditFormInsertItem insertedItem = e.Item as GridEditFormInsertItem;  
        string LastName = (insertedItem["TextBox2"].Controls[0] as TextBox).Text;  
    } 
However insertedItem always returns Null.

Any suggestions are greatly appreciated

Regards

Janne P

Jan
Top achievements
Rank 1
 answered on 12 Aug 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?