Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
116 views
Thanks I have done it
Varun
Top achievements
Rank 2
 asked on 14 Apr 2012
2 answers
461 views

Hi everyone

First of all, I'm aware of another existing thread that has the almost same title; I've read it, and it didn't solve my problem; therefore I decided to write a new thread.

My problem goes as follows:

I have an UpdatePanel placed in a page, which is defined as follows:

1.<asp:UpdatePanel ID="up" runat="server" Visible="false"> 
2. <ContentTemplate> 
3.  <asp:Label runat="server" Visible="false" ID="myLabel"></asp:Label> 
4. </ContentTemplate> 
5.</asp:UpdatePanel>

I need the Label and the Label's type to invoke some JavaScript with the ScriptManager.RegisterStartupScript method, which we will see later; both the UpdatePanel and Label are only needed for this purpose, and the RadComboBox is not placed in there!

The following is the JavaScript method I need to invoke using the ScriptManager.RegisterStartupScript:

1.function MyFunc(){
2. var combo = $find("MyRadComboBox.ClientID");
3. combo.get_text();
4.}

And the following is the RegisterStartupScript method I use in the code-behind file:

1.ScriptManager.RegisterStartupScript(myLabel, myLabel.GetType(), "MyKey", "MyFunc();", true);

Everytime the JavaScript method gets invoked by the RegisterStartupScript method from the code-behind, I get the following error on the client-side:

Uncaught TypeError: Cannot call method 'get_text' of null

The RadComboBox can't be found on the client-side using $find in this special situation. If I try to access it from Chrome's JS Console using the $find method, I'll get the object, and the invocation of a method on it works perfectly. 

What am I doing wrong here? How can I fix this? It's a pretty annoying little problem, and I hope somebody can point me to the right direction.

Thanks very much in advance guys!

Jakub
Top achievements
Rank 1
 answered on 14 Apr 2012
2 answers
294 views
I have a RadGrid with the property UseStaticHeaders = true for freezing the header row while scrolling.
but when i set this property to true Width of Headers does not match the corresponding Column Header Width while setting that property to false keeps headers and columns width match. How can i have frozen headers matching columns width?
Ali
Top achievements
Rank 1
 answered on 14 Apr 2012
8 answers
219 views
After being unable to resolve this issue with my own code, I tried running the demo site in IE7. To my surprise, it has the same issue.

Steps to Recreate
  1. Go to: http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/filtering/defaultcs.aspx
  2. Filter by shipped date: enter a date or use the date picker, click on the associated filter icon
  3. View the results...

It appears as if the filter icon is behind the date picker icon.





Merritt
Top achievements
Rank 1
 answered on 14 Apr 2012
5 answers
285 views
Hi,

We have a hyperlink in the radgrid and unfortunately the filtering doesn't work.
The following ASPX code have been used:

<telerik:GridHyperLinkColumn HeaderText = "Discussion Name" DataTextField="Discussion_Name"
ItemStyle-HorizontalAlign="Left" UniqueName="Discussion_Name"
DataNavigateUrlFields="Discussion_Id" SortExpression="Discussion_Name" ItemStyle-Width="320"
DataNavigateUrlFormatString="Observation.aspx?Id={0}">
</telerik:GridHyperLinkColumn>

Any ideas why is this?

Thanks!
Nathan
Top achievements
Rank 1
 answered on 13 Apr 2012
2 answers
95 views
I have a grid that if it is empty I want to open up an insert form on page load and fill in some default values.

Most of the code works except for this.

rgvAgmtUsers.Items[0].FireCommandEvent("InitInsert", string.Empty);

Now this works if there is already a record in the grid, but if the grid is empty then it doesn't work.

after this is supposed to fire I am wanting to use the grd.MasterTableView.GetInsertItem() to grab controls and set default values.

Any ideas?

Thanks,

Dustin
Simone
Top achievements
Rank 1
 answered on 13 Apr 2012
0 answers
117 views

Is it possible?? . I trying but I dont get this. Can you help me please.
It is a feature very important for my project.   :(

thank you.
Renato
Top achievements
Rank 1
 asked on 13 Apr 2012
1 answer
119 views
I am trying to set up a RadGrid with multiple dropdownlist filters but I get an ArgumentOutOfRangeException on the MyCustomFilteringColumn 

Here is code from the MyCustomFilteringColumn  
 :
       Protected Overloads Overrides Sub SetupFilterControls(ByVal cell As TableCell)
            MyBase.SetupFilterControls(cell)
            cell.Controls.RemoveAt(0)
            Dim list As New DropDownList()
            list.ID = "list" + Me.DataField
            list.AutoPostBack = True
            AddHandler list.SelectedIndexChanged, AddressOf list_SelectedIndexChanged
            cell.Controls.AddAt(0, list)
            cell.Controls.RemoveAt(1)
            list.DataTextField = Me.DataField
            list.DataValueField = Me.DataField
            list.DataSource = _listDataSource
            list.DataBind()
        End Sub

My RadGrid columns are setup like the below (here is one of the many that I have): 

         <custom:MyCustomFilteringColumn DataField="AssessmentID" FilterControlAltText="Filter AssessmentID column"
             FilterControlWidth="80px" HeaderStyle-Width="80px" ItemStyle-Width="80px" ItemStyle-ForeColor="Black"
                                                HeaderStyle-Wrap="true" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                                                ShowFilterIcon="false" HeaderText="Assessment ID" SortExpression="AssessmentID"
                                                UniqueName="AssessmentID" />


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        For Each column As GridBoundColumn In RadGrid1.MasterTableView.Columns
            If TypeOf column Is MyStuff.MyCustomFilteringColumn Then
                CType(column, MyStuff.MyCustomFilteringColumn).ListDataSource = GetFilterTable(column.DataField)
            End If
        Next
end sub

    Private Function GetFilterTable(ByVal Field As String) As DataTable
        Dim strConnection As String = ConfigurationManager.ConnectionStrings("PKLConnectionString").ConnectionString
        Dim objConnection As New SqlConnection(strConnection)
        Dim SQLCmd As New SqlCommand() 'The SQL Command
        objConnection.ConnectionString = strConnection     'Set the Connection String
        objConnection.Open() 'Open the connection
        SQLCmd.Connection = objConnection 'Sets the Connection to use with the SQL Command
        Dim dt As New DataTable
        Dim adapter As SqlDataAdapter
        adapter = New SqlDataAdapter("SELECT distinct [" + Field + "] FROM tblAssessment", objConnection)
        objConnection.Open()
        Try
            adapter.Fill(dt)
        Finally
            objConnection.Close()
        End Try
        Return dt
    End Function

Error:
System.ArgumentOutOfRangeException was unhandled by user code
  Message=Specified argument was out of the range of valid values.
Parameter name: index
  ParamName=index
  Source=System.Web
  StackTrace:
       at System.Web.UI.ControlCollection.get_Item(Int32 index)
       at System.Web.UI.ControlCollection.RemoveAt(Int32 index)
       at MyStuff.MyCustomFilteringColumn.SetupFilterControls(TableCell cell) in D:\PKLQMW AT 04 05 2012\PKL_QMW\App_Code\MyCustomFilteringColumn.vb:line 33
       at Telerik.Web.UI.GridColumn.InitializeCell(TableCell cell, Int32 columnIndex, GridItem inItem)
       at Telerik.Web.UI.GridBoundColumn.InitializeCell(TableCell cell, Int32 columnIndex, GridItem inItem)
       at Telerik.Web.UI.GridItem.Initialize(GridColumn[] columns)
       at Telerik.Web.UI.GridItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows)
       at Telerik.Web.UI.GridTableView.CreateFilteringItem(Boolean useDataSource, GridColumn[] copiedColumnSet, GridTHead thead)
       at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource)
       at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource)
       at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data)
       at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)
       at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
       at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
       at Telerik.Web.UI.GridTableView.PerformSelect()
       at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
       at Telerik.Web.UI.GridTableView.DataBind()
       at Telerik.Web.UI.RadGrid.DataBind()
       at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()
       at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
       at System.Web.UI.Control.EnsureChildControls()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  InnerException: 

Pavlina
Telerik team
 answered on 13 Apr 2012
1 answer
397 views
Hi, 
I apologize for my bad English I'll try to explain as best as possible. This is my first ticket:you can call a vb sub from javascript written on the same page.

<script type="text/javascript"> LANGUAGE="JavaScript"

      / / Open window 
     OpenFabbricatiRadWindow function () {
         var wnd = $ find ("<% = Fabbricati.ClientID%>");
         wnd.setUrl ("Form_Job / radwindow_Fabbricati.aspx");
         wnd.set_modal (true);
         wnd.show ();
     }
     / / Get selected value
     Fabbricatoselect function (sender, EventArgs) {
         eventArgs.get_argument var args = ();
         if (arg) {
            Varfabbricato.value = arg.Fabbricato;
            Vargestione.value = arg.Gestione;
       
   Call here ************************** **************** sub Leggi'

  }
     }

    
</ script>

in the page vb.aspx

Protected Sub Leggi ()
         Dim query = From c In Archivio.Tabelle_Spesa
         In joins and Archivio.Stato On c.Tab_Stato Equals e.Id_Stato
         Select ID_Tabella c.ID_Tabella =, Description = c.Tab_Descrizione, Acronym =c.Tab_Sigla, thousandths = c.Tab_Millesimi, State = e.Stato_Descrizione
         Query = RadGrid1.DataSource
         RadGrid1.DataBind ()

     end Sub



Thank

Fabio Cirillo
Top achievements
Rank 1
 answered on 13 Apr 2012
2 answers
90 views
Hi, i have a radgrid with allowpaging.
I need to make a verification in all items in the grid before saving in the database, but the code just verify only ten itens that displayed in the first page. How can i make a solution to resolve this problem ? 

Actually, my code do this: 

      foreach (GridDataItem item in rgdRebanho.Items)
                {
                    CheckBox ckbItem = (CheckBox)((item).FindControl("ckbItem"));
                    if (ckbItem.Checked == true && ckbItem.Enabled == true)
                    {
                            RadDateInput dt_ocorrencia = (RadDateInput)((item).FindControl("dt_ocorrencia"));
                            if (dt_ocorrencia.SelectedDate == null)
                            {
                                erro = true;
                            }
   
                    }
                }



Sorry if have some words wrong, but i don´t speak english very well.


Thanks!
Diego
Top achievements
Rank 1
 answered on 13 Apr 2012
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?