Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
257 views

Take the following (simple) datasource for a grid:

Restaurant    Food

------------------------

joe's pizza       pizza

taco bell          salad

mcdonalds      burger

mcdonalds      salad

taco bell          tacos

 

Now, I want each restaurant to display only once in a radgrid with only a single column (restaurant name), but I also want to programatically filter on 'food'. I've written a simple function to go through every row in a radgrid and 'hide' rows that have duplicate entries for the 'restaurant' column:

Public Sub RemoveDuplicateGridRows(ByVal grid As Telerik.Web.UI.RadGrid, ByVal columnIndex As String)
 
    'Array of column items to compare against for duplicates
    Dim aColumns As New ArrayList
    Dim value As String
 
    Dim gridRows As GridDataItemCollection = grid.MasterTableView.Items
    For Each row As GridDataItem In gridRows
        value = row.Cells(columnIndex).Text
        If Not aColumns.Contains(value) Then
            aColumns.Add(value)
        Else
            row.Visible = False
        End If
    Next
End Sub

This function works perfectly. The issue is that the paging feature on the RadGrid will still count the 'hidden' rows (where row.visible=false) when it generates the 'pager'. For example, if the paging is set to 10 items, but on page1 there are 4 rows 'hidden', it will only show 6 rows on the page. The 'alternating' line theme gets all messed up as well.

I've attached a screenshot of what the end result looks like. Completely removing the rows altogether is not an option, since I would not be able to get the desired result if i applied a filter for 'salad' and the 'mcdonalds' entry had been deleted since it was the 2nd 'mcdonalds' row.

Clayton
Top achievements
Rank 1
 answered on 22 Jul 2010
5 answers
136 views
Hi all!
I use Telerik 2009.3.1221.35 and dont have problem...

The new client has given me new design(CSS) of a site, I have shifted the my product on this new design and problems have begun... Here part of my code...

<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />

....

<
telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
 <asp:Panel ID="Panel1" runat="server">
  
  
            <telerik:RadComboBox ID="RadComboBox1" runat="server" AutoPostBack="true" OnTextChanged="CheckValues">
        <Items>
            <telerik:RadComboBoxItem runat="server" Text="some1" Value="s1" />
            <telerik:RadComboBoxItem runat="server" Text="some2" Value="s2" />
            <telerik:RadComboBoxItem runat="server" Text="some3" Value="s3" />
            <telerik:RadComboBoxItem runat="server" Text="some4" Value="s4" />
         </Items>
    </telerik:RadComboBox>
  
  
 </asp:Panel>
</telerik:RadAjaxPanel>


Well, what is interesting in Mozilla FireFox all works good, but in Internet Explorer or Opera not work!

In Internet Explorer, i select in ComboBox something value, and ComboBox reset again to initial value.
I dont understand whats is can be, i searched for similar problems at your forums but have not found.
Please help!

 

Serial Killer
Top achievements
Rank 1
 answered on 22 Jul 2010
2 answers
120 views
Hi, i have a grid built from values in database tables. The data is stored vertically
Partial NeedDataSource is:

foreach

 

(DataRow oDR in oStructureDT.Rows)

 

{

oNormalDT.Columns.Add(

new DataColumn(oDR["ColumnName"].ToString(),

 

ConvertType(oDR[

"DataType"].ToString())));

 

 

}

The DataType field is in the db as date, time, varchar and so on...
I'm trying to get the RadTimePicker to display in the edit form for a time DataType but all i can get is the calendar
I have AutoGenerateColumns = true, so i may have to rethink that. Can any one confirm?
I'm guessing i need to make the adjustment in itemdatabound, but not sure how to go about it.

Regards
Rod

Rod Barrand
Top achievements
Rank 1
 answered on 22 Jul 2010
5 answers
273 views
Hello,
My application is built on telerik ajax platform. I keep on getting following error at random on telerik tab strip control that have dynamic page view which loads user control. The sequence is random and occurs on any tab. If i set enableajax=false than i never get error and everything works great. Is there a way i can figure out where the error orginates from?
Once i get error the page hangs and user has to refresh the page causing loss of data.

 Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500  Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a8f393b2b-3315-402f-b504-cd6d2db001f6%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%3aen-US%3acf630f82-0e77-4618-bf5c-22b81f4ec1c5%3a16e4e7cd%3af7645509%3a22a6274a%3aed16cbdc%3a24ee1bba%3ae330518b%3a1e771326%3ac8618e41%3a8e6f0d33%3aaa288e2d%3aa7e79140%3a6a6d718d%3a874f8ea2%3a19620875%3a33108d14%3a8674cba1%3ab7778d6c%3ac08e9f8a%3aa51ee93e%3a59462f1, line 6 character 84093

Secondly i have robust error handling mechanism on server side (elmah), log4net at middle tier and database logger.
Can i implement some centralized error handling for ajax erros?

This error is driving me crazy

Line: 6
Error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near 'Telerik.Web.UI 2010.'.

Mac P
Top achievements
Rank 1
 answered on 22 Jul 2010
1 answer
207 views

 

<telerik:RadGrid ID="rgHourlyPeople" runat="server"

 

 

onneeddatasource="rgHourlyPeople_NeedDataSource" GridLines="None" AllowPaging="True"

 

 

AutoGenerateColumns="False" AllowSorting="True"

 

 

onselectedindexchanged="rgHourlyPeople_SelectedIndexChanged">

I have set AllowSorting="True" for the grid, buton only the bound column get sorted, the GridButtonColumn column ( when ButtonType="LinkButton") sort function won't work.

Anynow knows how to sort GridButtonColumn column?

Thanks,
Jessie

 

Radoslav
Telerik team
 answered on 22 Jul 2010
5 answers
148 views
I've set up a tabstrip in the pager template of a formview and bound it to a SQLDatasource.  I then set up a server side OnTabClick event to change the page of the formview.  This works great.  The only issue I'm having is displaying the selected tab.  It seems to only work if I click the same tab twice.  I've tried setting the selected tab in the tabclick event and in the page_load event to to avail.  Does anyone have any ideas?
 
Here is my code, including the tab.selected property in the event.  The functionality is the same with or without that line.

<telerik:RadTabStrip ID="RadTabStrip2" runat="server" 
     DataSourceID="SqlDataSource5" DataTextField="proj_no" 
     ontabclick="RadTabStrip2_TabClick">  
</telerik:RadTabStrip> 
 
    Protected Sub RadTabStrip2_TabClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs)  
        FormView3.PageIndex = e.Tab.Index  
        e.Tab.Selected = True 
    End Sub 


Thanks.
Brian
Top achievements
Rank 1
 answered on 22 Jul 2010
4 answers
337 views
Hi Telerik,

Am using the new telerik controls in my web application. But am facing the issue with auto adjustment of RadSplitter.

Am using Splitter and RadPane
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="RR_Web.Site1" %>
  
<%@ 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>   
    <script type="text/javascript" src="../RR.js"></script>
    <link href="App_Themes/Default/Grid.InspireGrid.css" rel="stylesheet" type="text/css" />
    <link href="App_Themes/Default/TabStrip.InspireTabStrip.css" rel="stylesheet" type="text/css" />
</head>
  
<script language="javascript" type="text/javascript">
    function pnlRequestStarted(ajaxPanel, eventArgs)
    //AJAX
    {
        var sPath = window.location.pathname;
        var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
  
        for (i = 0; i < document.forms[0].elements.length - 1; i++)
        //search for "FILE" textbox where upload filename is stored
        //if this field is not empty, meaning that file is being uploaded
        //once then, must disable AJAX for the upload to work properly.
        //This does not work if the page is using a Wizard and the upload component is not in first wizard step.
            if (document.forms[0].elements[i].type == "file")
                eventArgs.EnableAjax = false;
              
        //TODO: these pages require file uploading. AJAX must be disabled for upload to work.
        if (sPage == "NewScenario.aspx" || sPage == "NewActivation.aspx" || sPage == "ContactsMgmt.aspx")
            eventArgs.EnableAjax = false;
    }   
</script>
  
   
  
  
<body>
  
    <form id="form1" runat="server">
     
    <asp:ScriptManager ID="ScriptManager1" runat="server"  EnablePartialRendering="true">
    </asp:ScriptManager>
      
   <table border="0" cellspacing="0" cellpadding="0" class="HeaderBg" width="100%">
            <tr style="height: 50px">                   
                <td class="HeaderBg" style="width: 100%">
                    <table border="0" cellspacing="0" cellpadding="0" width="100%">
                    <tr> 
                        <td width="300px" valign="middle" align="left"> <a style="font-weight: bold; font-size: larger">Welcome to Rapid Recall</a> </td>
                        <td width="50px" nowrap="nowrap">   </td>
                        <td valign="middle" align="left">
                             <table border="0" cellpadding="6" cellspacing="0">
                             <tr>
                                    <td align="center"><asp:ImageButton ID="btnkNewContact" runat="server" ImageUrl="~/Images/newContact.gif" Visible="false" onclick="btnkNewContact_Click" /></td>  
                                    <td align="center"><asp:ImageButton ID="btnkNewScenario" runat="server" ImageUrl="~/Images/newScenario.gif" Visible="false" onclick="btnkNewScenario_Click" /></td>
                                    <td align="center"><asp:ImageButton ID="btnNewActivation" runat="server" ImageUrl="~/Images/newActivation.gif" Visible="false" onclick="btnNewActivation_Click" /></td>
                                    <td align="center"><asp:ImageButton ID="btnhUserMgmt" runat="server" ImageUrl="~/Images/usersMgmt.gif" Visible="false" onclick="btnhUserMgmt_Click" /></td>
                             </tr>
                             <tr>
                                    <td><asp:Literal ID="lblNewContact" runat="server" Text="New Contact" Visible="false"></asp:Literal></td>
                                    <td><asp:Literal ID="lblNewScenario" runat="server" Text="New Scenario" Visible="false"></asp:Literal></td>
                                    <td><asp:Literal ID="lblNewActivation" runat="server" Text="New Activation" Visible="false"></asp:Literal></td>
                                    <td><asp:Literal ID="lblUsersMgmt" runat="server" Text="Users Mgmt." Visible="false"></asp:Literal></td>
                             </tr>
                             </table>
                        </td>
                        <td valign="top" width="200px" align="right"> <asp:Label ID="lblDateTime" runat="server"></asp:Label> </td>
                    </tr>
                    </table>                    
                </td>
            </tr>           
            <tr>
                <td class="titleBarBg">
                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr>
                            <td style="width: 20px; height: 19px;">
                                <asp:Image ID="Image4" runat="server" ImageUrl="~/Images/pgtitleimage.gif" />
                            </td>
                            <td style="width: 400px; height: 19px;" nowrap="nowrap" align="left">
                                 <asp:Label ID="lblTitle" runat="server" CssClass="titleBar"></asp:Label>
                            </td>
                            <td width="500px" align="right" valign="middle">                
                                        <asp:Label ID="lblUsername" runat="server"></asp:Label> | 
                                        <asp:HyperLink ID="hlnkChgPwd" runat="server" NavigateUrl="~/ChangePassword.aspx" Text="Change Password"></asp:HyperLink> |
                                        <asp:HyperLink ID="hlnkAccountInfo" runat="server" NavigateUrl="~/CreateUser.aspx" Text="Account Info"></asp:HyperLink> |
                                        <asp:HyperLink ID="hlnkLogout" runat="server" NavigateUrl="~/Logout.aspx" Text="Logout"></asp:HyperLink>
                            </td> 
                        </tr>
                    </table>
                </td>               
            </tr>
            <tr>
                <td valign="top" align="left" width="100%">                
                <telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%" Height="100%">                    
                    <telerik:RadPane ID="RadPaneMenus" runat="server" Width="200px" Scrolling="None" MinWidth="250" MaxWidth="250">
                                <telerik:RadPanelBar ID="RadPanelBar1" runat="server" ExpandMode="FullExpandedItem" OnItemClick="RadPanelBar1_ItemClick" Height="100%">
                                <Items>
                                        <telerik:RadPanelItem Text="Manage Contacts" ImageUrl="Images/mngContacts.png" Visible="false">
                                            <Items>
                                                <telerik:RadPanelItem NavigateUrl="ContactsMgmt.aspx" Text="Manage Contacts" />
                                                <telerik:RadPanelItem NavigateUrl="ImportContacts.aspx" Text="Import Contacts" />
                                            </Items>
                                        </telerik:RadPanelItem>
                                        <telerik:RadPanelItem Text="Scenarios" ImageUrl="Images/mngScenarios.png" Visible="false">
                                            <Items>
                                                <telerik:RadPanelItem NavigateUrl="Scenarios.aspx" Text="Scenarios" />
                                                <telerik:RadPanelItem NavigateUrl="NewScenario.aspx" Text="New Scenario" />
                                            </Items>
                                        </telerik:RadPanelItem>
                                        <telerik:RadPanelItem Text="Activations" ImageUrl="Images/mngActivations.png" Visible="false">
                                            <Items>
                                                <telerik:RadPanelItem NavigateUrl="Activations.aspx" Text="Activations" />
                                                <telerik:RadPanelItem NavigateUrl="NewActivation.aspx" Text="New Activation" />
                                            </Items>
                                        </telerik:RadPanelItem>
                                        <telerik:RadPanelItem Text="Manage Users" ImageUrl="Images/mngUsers.png" Visible="false">
                                            <Items>
                                                <telerik:RadPanelItem NavigateUrl="UserList.aspx" Text="Manage Users" />                                                
                                            </Items>
                                        </telerik:RadPanelItem> 
                                </Items>                                
                                </telerik:RadPanelBar> 
                    </telerik:RadPane>
                      
                    <telerik:RadSplitBar ID="RadSplitBar1" runat="server" CollapseMode="Forward"></telerik:RadSplitBar>                    
                    <telerik:RadPane ID="radPaneContent" runat="server" Width="100%">
                        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                        </asp:ContentPlaceHolder>
                    </telerik:RadPane>                
                </telerik:RadSplitter>                
                </td>
            </tr>
            <tr>
                <td class="skinfooter">
                                <asp:HyperLink ID="HyperLink5" runat="server" Text="© Copyright 2000-2010 Inspire-Tech Pte Ltd. All Rights Reserved."
                                    NavigateUrl="http://www.inspire-tech.com"></asp:HyperLink>
                </td>
            </tr>
        </table>
      
    </form>
</body>
</html>
and RadPanelBar. I want the RadSplitter auto increase to page content. I tried to height Offset attribute still i can't get the results.

Down side am placing my master page code. please check let me know how to set the splitter height auto set to the content place holder height. i don't want to see the vertical scroll bar in content place holder rad pane.

 

Tsvetie
Telerik team
 answered on 22 Jul 2010
4 answers
265 views
Hi,

I have a radGrid which I want to be multilingual. I want to change the pager text based on the culture. I am unable to find properties which does this. Given below are the text that is displayed on my radgrid pager which i want to change based on culture.

Change page    label
Go                     link
Page size
          label
Change             link
Displaying page 1 of 3, items 1 to 10 of 21   label.

could you please let me know what properties that needs to be set on the radgrid in order to change the above values??


Thanks,
Mahesh
mahesh
Top achievements
Rank 1
 answered on 22 Jul 2010
3 answers
152 views
I  want to show msgbox after save data to  database  and not show msgbox when post back again after save data.
Now I use "RadAjaxManager1.ResponseScripts.Clear()"  for clear msgbox .. but  msgbox show alway after save data..
Pls help me ..

Page Load
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load   
        If Not Page.IsPostBack Then  
            ConnectPreFix()
            ConnectUserGroup()
            CheckLevelGroup(gLevel)
             .....
        Else
            RadAjaxManager1.ResponseScripts.Clear()
        End If  
    End Sub

Insert Data

 

Sub InsertData()
  Dim Result As Boolean
 Try
   StrSql="..."
   Result = DbPortal.QueryExecuteNonQuery(StrSql)
    ....
   Catch ex As Exception
            LblError.Text = " InsertData :" & ex.Message
            PanelError.Visible = True  
   Finally           
            ShowMsg("Insert Data Complete !")
            PanelError.Visible = False
   End Try

 

End Sub

 

 

 

Show Msg

 

 

Sub ShowMsg(ByVal sMsg As String)   
RadAjaxManager1.ResponseScripts.Add("Sys.Application.add_load(function()" & Chr(13)& "" & Chr(10) & " {radalert('" & sMsg & "', 330, 210);})")   
End Sub

 

 

 



 

Petio Petkov
Telerik team
 answered on 22 Jul 2010
1 answer
92 views
I have a requirment, I need to have a dropdown list which will contains values form 1 to 4.
Based on what user selects from it, I need to add same number  Dockzone control to my asp.net page.

I want to know is it possible to do, I did add Dock controls at the runtime and they are working fine on another page.
But i am not sure about the dockzone controls.

Petio Petkov
Telerik team
 answered on 22 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?