Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
75 views
I have grid with GridHyperLinkColumn, navigate url is www.tempuri.org?id={0}. When I add new item (InPlace), GridHyperLinkColumn exists and navigate url is wrong, becuase new item hasn't id yet. And I cannot use ItemTemplate, because I add columns on page load. Is it possible to hide GridHyperLinkColumn in insert mode?

Vlad
Telerik team
 answered on 29 Dec 2008
14 answers
341 views
Hi,

I'm binding my grid on an object collection.  I'm trying to display the information like in the cardview example.  However, even if my code is the same, it keep telling me that i have no record.

<telerik:RadGrid ID="grdReglements" runat="server" GridLines="None" AutoGenerateColumns="False" 
        Width="732px"
        <MasterTableView TableLayout="Fixed"
            <NoRecordsTemplate> 
                <asp:Label ID="lblGrdNoRecord" runat="server" Text="Il n'y a présentement aucun nouveau règlement ajoutés Ã  votre acte de copropriété."></asp:Label> 
            </NoRecordsTemplate> 
            <ItemTemplate> 
                <div style="float: left; width: 231px;"
                    <asp:Label ID="lblNoReglement" runat="server" Text="Numéro de règlement :"></asp:Label> 
                    <br /> 
                    <%# Eval("NoReglement") %> 
                    <br /> 
                    <br /> 
                    <asp:Label ID="lblDateAdoption" runat="server" Text="Date d'adoption :"></asp:Label> 
                    <br /> 
                    <%# Eval("DateAdoption") %> 
                    <br /> 
                    <br /> 
                    <asp:Label ID="lblDateVigueur" runat="server" Text="Date applicable :"></asp:Label> 
                    <br /> 
                    <%# Eval("DateVigueur") %> 
                </div> 
                <div style="width: 500px;"
                    <%# Eval("Titre") %> 
                    <br /> 
                    <%# Eval("Description") %> 
                </div> 
            </ItemTemplate> 
</MasterTableView> 
    </telerik:RadGrid> 

private void RefreshReglements() 
    { 
        grdReglements.DataSource = MyReglementBLL.ReglementCollection; 
        grdReglements.DataBind(); 
    } 


If i use bounded columns, my information is displayed correctly.

Albert Shenker
Top achievements
Rank 1
Veteran
Iron
 answered on 29 Dec 2008
2 answers
140 views
Hi,

I am using Telerik 2008 Q3 version.I have one problem with splitter control. I have one radwindow in which i am using splitter control and teleriik rad panes.I have following problems:
1. Whenever I open specified Rad window, controls in some of the tabs of window gets disappered. Please see attached screenshot(FieldDisappering Problem.Jpeg)

2. I am using same page for adding/editing record. Based on add/edit option, I change title of page as Add Record/Edit record dynamically.But the problem here is that untill page is loaded completely, previous title is displayed on page first. e.g. When I click on Add record link, page opens with title Add Record which is correct. But next time, when I click on edit record link, first 'Add Record' title is displayed untill page is completely loaded and after that 'Edit Record' title is displayed.

3. Also in another page, I am using splittercontrol with two rad panes.Wheneer page is in process of loading , only half of radpan is displayed and then after completly loading page, full rad pane is displayed.Please see attached screen shot.

Please note that I am using radform decorator in all of my pages.

Can you please advice on these problems?

Nikesh
Top achievements
Rank 1
 answered on 29 Dec 2008
1 answer
124 views
Hi All,

I have a grid in a page, loading data from sqldatasource, but I want to change this grid datasource in page load if I received a specific parameter, so how I can change grid source in page_load event in special case?

Please advise.

Regards
Princy
Top achievements
Rank 2
 answered on 29 Dec 2008
1 answer
675 views
I have Radgrid on my page and want to save data of the selected row in any of its event. Can anyone help me how to get the selected row data and on which event i can get that data for my further use.
Princy
Top achievements
Rank 2
 answered on 29 Dec 2008
3 answers
127 views
Has anyone successfully integrated the Telerik RadEditor with BlogEngine.Net?  If so, how is it done?  I cannot find docummentation nor can I figure out how they are doing what.

Thanks in advance
Chase Florell
Top achievements
Rank 1
 answered on 29 Dec 2008
3 answers
325 views

Posted 0 minutes ago (permalink)

 Hi,
    I am using Visual Web Developer 2005.  I installed the Telerik.Web.UI.dll in my GAC from the bin (not Bin35). I made the assemblies entry in my machine.config as well.
   My VWD seems to work fine. It sees what it needs to when it needs to at run time. I can get into the design view, the debug works and I can call the test page up from localhost.  
   However, now I am ready to go back to the live examples to plan what I need to use first and to learn more particulars and I get this when I click on the Live Examples desktop icon now. It was working before I added the DLL to the GAC.  There is no direct reference to the DLL in my VWD references, should there be  In order to distinguish ? will try that, but if there is another reason for this error and I am barking up the wrong tree, could anyone give some advice about this error ?
thanks for any help
******************************************************************************************
 

Server Error in '/RadControls_AspNetAjax' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30560: 'GridBoundColumn' is ambiguous in the namespace 'Telerik.Web.UI'.

Source Error:

Line 15:     ' 
Line 16:     Public Class MyCustomFilteringColumnVB
Line 17: Inherits GridBoundColumnLine 18: 
Line 19:         Public Shared ReadOnly Property ConnectionString() As String

Source File: C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb    Line: 17



C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos> "C:\WINDOWS\Microsoft.NET\Framework\v3.5\vbc.exe" /t:library /utf8output /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\radcontrols_aspnetajax\78751c15\9c9fa247\assembly\dl3\3929eb0d\0012444f_6e4ec901\Telerik.Web.UI.DLL" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\Telerik.Web.UI\2008.3.1125.20__121fae78165ba3d4\Telerik.Web.UI.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.WorkflowServices\3.5.0.0__31bf3856ad364e35\System.WorkflowServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions.Design\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.Design.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Runtime.Serialization\3.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.IdentityModel\3.0.0.0__b77a5c561934e089\System.IdentityModel.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Drawing.Design\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.Design.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml.Linq\3.5.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel.Web\3.5.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Design\2.0.0.0__b03f5f7f11d50a3a\System.Design.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Data.DataSetExtensions\3.5.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll" /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\radcontrols_aspnetajax\78751c15\9c9fa247\App_GlobalResources.nrziyzxi.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.ServiceModel\3.0.0.0__b77a5c561934e089\System.ServiceModel.dll" /R:"C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll" /out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\radcontrols_aspnetajax\78751c15\9c9fa247\App_SubCode_Grid_VB.smmxoxgd.dll" /debug- /define:_MYTYPE=\"Web\" /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Specialized,System.Configuration,System.Text,System.Text.RegularExpressions,System.Web,System.Web.Caching,System.Web.SessionState,System.Web.Security,System.Web.Profile,System.Web.UI,System.Web.UI.WebControls,System.Web.UI.WebControls.WebParts,System.Web.UI.HtmlControls /warnaserror- /optionInfer+  "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\radcontrols_aspnetajax\78751c15\9c9fa247\App_SubCode_Grid_VB.smmxoxgd.0.vb" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\radcontrols_aspnetajax\78751c15\9c9fa247\App_SubCode_Grid_VB.smmxoxgd.1.vb" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\radcontrols_aspnetajax\78751c15\9c9fa247\App_SubCode_Grid_VB.smmxoxgd.2.vb" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\radcontrols_aspnetajax\78751c15\9c9fa247\App_SubCode_Grid_VB.smmxoxgd.3.vb" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\radcontrols_aspnetajax\78751c15\9c9fa247\App_SubCode_Grid_VB.smmxoxgd.4.vb"


Microsoft (R) Visual Basic Compiler version 9.0.21022.8
Copyright (c) Microsoft Corporation.  All rights reserved.

C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(17) : error BC30560: 'GridBoundColumn' is ambiguous in the namespace 'Telerik.Web.UI'.

        Inherits GridBoundColumn
                 ~~~~~~~~~~~~~~~
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(26) : error BC30284: sub 'SetupFilterControls' cannot be declared 'Overrides' because it does not override a sub in a base class.

        Protected Overrides Sub SetupFilterControls(ByVal cell As TableCell)
                                ~~~~~~~~~~~~~~~~~~~                         
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(29) : error BC30560: 'RadComboBox' is ambiguous in the namespace 'Telerik.Web.UI'.

            Dim combo As RadComboBox = New RadComboBox
                         ~~~~~~~~~~~                  
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(30) : error BC30456: 'DataField' is not a member of 'Telerik.Web.Examples.Integration.GridAndCombo.MyCustomFilteringColumnVB'.

            combo.ID = ("RadComboBox1" + Me.DataField)
                                         ~~~~~~~~~~~~ 
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(44) : error BC30284: sub 'SetCurrentFilterValueToControl' cannot be declared 'Overrides' because it does not override a sub in a base class.

        Protected Overrides Sub SetCurrentFilterValueToControl(ByVal cell As TableCell)
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                         
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(46) : error BC30560: 'RadComboBox' is ambiguous in the namespace 'Telerik.Web.UI'.

            Dim combo As RadComboBox = CType(cell.Controls(0), RadComboBox)
                         ~~~~~~~~~~~                                       
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(47) : error BC30456: 'CurrentFilterValue' is not a member of 'Telerik.Web.Examples.Integration.GridAndCombo.MyCustomFilteringColumnVB'.

            If (Me.CurrentFilterValue <> String.Empty) Then
                ~~~~~~~~~~~~~~~~~~~~~                      
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(48) : error BC30456: 'CurrentFilterValue' is not a member of 'Telerik.Web.Examples.Integration.GridAndCombo.MyCustomFilteringColumnVB'.

                combo.Text = Me.CurrentFilterValue
                             ~~~~~~~~~~~~~~~~~~~~~
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(53) : error BC30284: function 'GetCurrentFilterValueFromControl' cannot be declared 'Overrides' because it does not override a function in a base class.

        Protected Overrides Function GetCurrentFilterValueFromControl(ByVal cell As TableCell) As String
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                   
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(54) : error BC30560: 'RadComboBox' is ambiguous in the namespace 'Telerik.Web.UI'.

            Dim combo As RadComboBox = CType(cell.Controls(0), RadComboBox)
                         ~~~~~~~~~~~                                       
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(58) : error BC30560: 'RadComboBoxItemsRequestedEventArgs' is ambiguous in the namespace 'Telerik.Web.UI'.

        Private Sub list_ItemsRequested(ByVal o As Object, ByVal e As RadComboBoxItemsRequestedEventArgs)
                                                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(59) : error BC30560: 'RadComboBox' is ambiguous in the namespace 'Telerik.Web.UI'.

            CType(o, RadComboBox).DataTextField = Me.DataField
                     ~~~~~~~~~~~                              
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(59) : error BC30456: 'DataField' is not a member of 'Telerik.Web.Examples.Integration.GridAndCombo.MyCustomFilteringColumnVB'.

            CType(o, RadComboBox).DataTextField = Me.DataField
                                                  ~~~~~~~~~~~~
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(60) : error BC30560: 'RadComboBox' is ambiguous in the namespace 'Telerik.Web.UI'.

            CType(o, RadComboBox).DataValueField = Me.DataField
                     ~~~~~~~~~~~                               
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(60) : error BC30456: 'DataField' is not a member of 'Telerik.Web.Examples.Integration.GridAndCombo.MyCustomFilteringColumnVB'.

            CType(o, RadComboBox).DataValueField = Me.DataField
                                                   ~~~~~~~~~~~~
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(61) : error BC30560: 'RadComboBox' is ambiguous in the namespace 'Telerik.Web.UI'.

            CType(o, RadComboBox).DataSource = GetDataTable("SELECT DISTINCT " & Me.UniqueName & " FROM Customers WHERE " & Me.UniqueName & " LIKE '" & e.Text & "%'")
                     ~~~~~~~~~~~                                                                                                                                      
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(61) : error BC30456: 'UniqueName' is not a member of 'Telerik.Web.Examples.Integration.GridAndCombo.MyCustomFilteringColumnVB'.

            CType(o, RadComboBox).DataSource = GetDataTable("SELECT DISTINCT " & Me.UniqueName & " FROM Customers WHERE " & Me.UniqueName & " LIKE '" & e.Text & "%'")
                                                                                 ~~~~~~~~~~~~~                                                                        
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(61) : error BC30456: 'UniqueName' is not a member of 'Telerik.Web.Examples.Integration.GridAndCombo.MyCustomFilteringColumnVB'.

            CType(o, RadComboBox).DataSource = GetDataTable("SELECT DISTINCT " & Me.UniqueName & " FROM Customers WHERE " & Me.UniqueName & " LIKE '" & e.Text & "%'")
                                                                                                                            ~~~~~~~~~~~~~                             
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(62) : error BC30560: 'RadComboBox' is ambiguous in the namespace 'Telerik.Web.UI'.

            CType(o, RadComboBox).DataBind()
                     ~~~~~~~~~~~            
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(65) : error BC30560: 'RadComboBoxSelectedIndexChangedEventArgs' is ambiguous in the namespace 'Telerik.Web.UI'.

        Private Sub list_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs)
                                                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(66) : error BC30560: 'GridFilteringItem' is ambiguous in the namespace 'Telerik.Web.UI'.

            Dim filterItem As GridFilteringItem = CType(CType(o, RadComboBox).NamingContainer, GridFilteringItem)
                              ~~~~~~~~~~~~~~~~~                                                                  
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(67) : error BC30456: 'UniqueName' is not a member of 'Telerik.Web.Examples.Integration.GridAndCombo.MyCustomFilteringColumnVB'.

            If (Me.UniqueName = "Index") Then
                ~~~~~~~~~~~~~                
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(69) : error BC30456: 'UniqueName' is not a member of 'Telerik.Web.Examples.Integration.GridAndCombo.MyCustomFilteringColumnVB'.

                filterItem.FireCommandEvent("Filter", New Pair("EqualTo", Me.UniqueName))
                                                                          ~~~~~~~~~~~~~  
C:\Program Files\Telerik\RadControls for ASPNET AJAX Q3 2008\Live Demos\App_Code\Grid_VB\MyCustomFilteringColumnVB.vb(72) : error BC30456: 'UniqueName' is not a member of 'Telerik.Web.Examples.Integration.GridAndCombo.MyCustomFilteringColumnVB'.

            filterItem.FireCommandEvent("Filter", New Pair("Contains", Me.UniqueName))
                                                                       ~~~~~~~~~~~~~  


Line 1:    Imports Microsoft.VisualBasic
Line 2:    Imports System.Data
Line 3:    Imports Telerik.Web.UI
Line 4:    Imports System.Web.UI.WebControls
Line 5:    Imports System.Web.UI
Line 6:    Imports System
Line 7:    Imports System.Configuration
Line 8:    Imports System.Data.SqlClient
Line 9:    
Line 10:   Namespace Telerik.Web.Examples.Integration.GridAndCombo
Line 11:   
Line 12:       ' <summary>
Line 13:       ' Custom column that shows filtering dropdown instead of textbox
Line 14:       ' </summary>
Line 15:       ' 
Line 16:       Public Class MyCustomFilteringColumnVB
Line 17:           Inherits GridBoundColumn
Line 18:   
Line 19:           Public Shared ReadOnly Property ConnectionString() As String
Line 20:               Get
Line 21:                   Return ConfigurationManager.ConnectionStrings("NorthwindConnectionString").ConnectionString
Line 22:               End Get
Line 23:           End Property
Line 24:   
Line 25:           'RadGrid will call this method when it initializes the controls inside the filtering item cells
Line 26:           Protected Overrides Sub SetupFilterControls(ByVal cell As TableCell)
Line 27:               MyBase.SetupFilterControls(cell)
Line 28:               cell.Controls.RemoveAt(0)
Line 29:               Dim combo As RadComboBox = New RadComboBox
Line 30:               combo.ID = ("RadComboBox1" + Me.DataField)
Line 31:               combo.ShowToggleImage = False
Line 32:               combo.Skin = "Office2007"
Line 33:               combo.EnableLoadOnDemand = True
Line 34:               combo.AutoPostBack = True
Line 35:               combo.MarkFirstMatch = True
Line 36:               combo.Height = Unit.Pixel(100)
Line 37:               AddHandler combo.ItemsRequested, AddressOf Me.list_ItemsRequested
Line 38:               AddHandler combo.SelectedIndexChanged, AddressOf Me.list_SelectedIndexChanged
Line 39:               cell.Controls.AddAt(0, combo)
Line 40:               cell.Controls.RemoveAt(1)
Line 41:           End Sub
Line 42:   
Line 43:           'RadGrid will cal this method when the value should be set to the filtering input control(s)
Line 44:           Protected Overrides Sub SetCurrentFilterValueToControl(ByVal cell As TableCell)
Line 45:               MyBase.SetCurrentFilterValueToControl(cell)
Line 46:               Dim combo As RadComboBox = CType(cell.Controls(0), RadComboBox)
Line 47:               If (Me.CurrentFilterValue <> String.Empty) Then
Line 48:                   combo.Text = Me.CurrentFilterValue
Line 49:               End If
Line 50:           End Sub
Line 51:   
Line 52:           'RadGrid will cal this method when the filtering value should be extracted from the filtering input control(s)
Line 53:           Protected Overrides Function GetCurrentFilterValueFromControl(ByVal cell As TableCell) As String
Line 54:               Dim combo As RadComboBox = CType(cell.Controls(0), RadComboBox)
Line 55:               Return combo.Text
Line 56:           End Function
Line 57:   
Line 58:           Private Sub list_ItemsRequested(ByVal o As Object, ByVal e As RadComboBoxItemsRequestedEventArgs)
Line 59:               CType(o, RadComboBox).DataTextField = Me.DataField
Line 60:               CType(o, RadComboBox).DataValueField = Me.DataField
Line 61:               CType(o, RadComboBox).DataSource = GetDataTable("SELECT DISTINCT " & Me.UniqueName & " FROM Customers WHERE " & Me.UniqueName & " LIKE '" & e.Text & "%'")
Line 62:               CType(o, RadComboBox).DataBind()
Line 63:           End Sub
Line 64:   
Line 65:           Private Sub list_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs)
Line 66:               Dim filterItem As GridFilteringItem = CType(CType(o, RadComboBox).NamingContainer, GridFilteringItem)
Line 67:               If (Me.UniqueName = "Index") Then
Line 68:                   'this is filtering for integer column type 
Line 69:                   filterItem.FireCommandEvent("Filter", New Pair("EqualTo", Me.UniqueName))
Line 70:               End If
Line 71:               'filtering for string column type
Line 72:               filterItem.FireCommandEvent("Filter", New Pair("Contains", Me.UniqueName))
Line 73:           End Sub
Line 74:   
Line 75:           Public Shared Function GetDataTable(ByVal query As String) As DataTable
Line 76:               Dim conn As New SqlConnection(ConnectionString)
Line 77:               Dim adapter As New SqlDataAdapter
Line 78:               adapter.SelectCommand = New SqlCommand(query, conn)
Line 79:   
Line 80:               Dim myDataTable As New DataTable
Line 81:   
Line 82:               conn.Open()
Line 83:               Try
Line 84:                   adapter.Fill(myDataTable)
Line 85:               Finally
Line 86:                   conn.Close()
Line 87:               End Try
Line 88:               Return myDataTable
Line 89:           End Function
Line 90:       End Class
Line 91:   End Namespace
Line 92:   

IQworks
Top achievements
Rank 1
 answered on 29 Dec 2008
3 answers
1.6K+ views
I have a RadGrid which lists addresses. I have configured it to popup during edit, in which there are 2 dropdown lists, for country and for province - the first dropdown  being set to AutoPostBack=true, so that any change there, will also change the list of provinces available.
But when I change the country selection, I get this error "Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control."

Any ideas on how to get around this problem?

=================
                                   <td>
                                    Country:</td>
                                <td>
    <asp:ObjectDataSource ID="obCountry" runat="server"
        SelectMethod="GetAllCountries"
        TypeName="CNH.CountryController">
    </asp:ObjectDataSource>
                                <asp:DropDownList ID="cbCountry" runat="server" AutoPostBack="True"  SelectedValue='<%# Bind("intCountry") %>'
                                    DataSourceID="obCountry" DataTextField="txtName"
                                    DataValueField="intcountry">
                                </asp:DropDownList>   

</td>                           
                                                               
                             
 
                            </tr>                                                                                 
                            <tr>
                                <td>
                                    Province:</td>
                                <td>
                                    <asp:ObjectDataSource ID="obProv" runat="server"
                                        SelectMethod="GetAllProvinces"
                                        TypeName="CNH.ProvStateController" >
                                        <SelectParameters>
                                            <asp:ControlParameter ControlID="cbCountry"
                                                Name="intCountry" PropertyName="SelectedValue" Type="Int32" />
                                        </SelectParameters>
                                    </asp:ObjectDataSource>                               
                                     <asp:DropDownList ID="cbProv" runat="server"
                                        DataSourceID="obProv" DataTextField="txtname"  SelectedValue='<%# Bind("intprovstate") %>'
                                        DataValueField="intprovstate">
                                    </asp:DropDownList>
                                   
                                </td>
Eric
Top achievements
Rank 1
 answered on 28 Dec 2008
1 answer
102 views

Posted on Dec 3 (permalink)

Hi

We are implemting grid filtering by giving filter expression in Need_DataSource event by setting following property -

Grid.MasterTableView.FilterExpression

which is set to something like the following

DataSourceProperty.ToString().ToUpper().StartsWith("Hi")  where DataSourceProperty is a property of object, collection of which is set as Data Source to the grid just after setting filter expressio.

Now my problem is that we wnat to give a user option to put % in the filter values and the filter should work like "Like" opertor in Oracle. So the input may be "punit%was%" .

For this I have tried to set the property like below as suggested in documenattion at some place :-
RadGrid1.MasterTableView.FilterExpression =
"([Country] LIKE \'%Germany%\') ";
 
Along with this I have also set  grid LINQ expressions to false (EnableLinqExpressions=false) .

But this is not actually filtering the results and is just returning the results without filtering.


Thanks

Kevin Babcock
Top achievements
Rank 1
 answered on 28 Dec 2008
1 answer
116 views
When a user moves a column in the grid to a new location, it occupies the same space that the column that was in that spot takes up.  I am setting the HeaderStyle-Width property in the aspx for each GridBoundColumn. 
Kevin Babcock
Top achievements
Rank 1
 answered on 28 Dec 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?