Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
41 views
Hi everybody,

I would like to know if it is possible to set a JS function of a tileList in code-behind (SelectionStateChanged), and how.
I have already created a JS function that i want to be launched when the tile is selected.

I try to create every tileList i need from code-behind, that is why i need this.

Many thanks !
Maxime
Top achievements
Rank 1
 answered on 05 Jul 2013
7 answers
277 views
Hi, In my application I have a RadGrid who is connected to a ObjectDataSource for can filter my query before result loading (when I start my page, i used the LinqDataSource).

After to have implented the ODS, I had a error message :
DataBinding: 'Telerik.Web.UI.GridInsertionObject' does not contain a property with the name 'CodeComplementaireNumero'.

I to search in the internet, and i have found this link :  http://www.telerik.com/help/aspnet-ajax/grid-error-messages.html who give me a solution for my Insert problem (when I edit a DataItem all work perfectly)

Case "Add", "InitInsert"
 
                EcritureRecurrenteFacade.ObjCompte.Entity = Nothing
                UndoChange()
 
                e.Canceled = True
                Dim newValues As System.Collections.Specialized.ListDictionary = New System.Collections.Specialized.ListDictionary()
                newValues("ID") = 0
                newValues("CompteNumero") = Nothing
                newValues("Description") = Nothing
                newValues("CodeComplementaireNumero") = 0
                newValues("Pourcentage") = 0
                'newValues("EcritureRecurrenteID") = IIf(EcritureRecurrenteFacade.EcritureCourante IsNot Nothing, EcritureRecurrenteFacade.EcritureCourante.ID, 0)
                e.Item.OwnerTableView.InsertItem(newValues)

After I have add this code, when I click on my Add button, the row appear in the RadGrid. In the RadGridRow. But in my RadGrid for each row I have Search Action Button who call this Event to my ItemCommand

Case "SearchCompte"
    ' Désactive le compte courante pour empêcher les problèmes d'affichages
    If (EcritureRecurrenteFacade.ObjCompte.Entity IsNot Nothing) AndAlso (EcritureRecurrenteFacade.ObjCompte.Entity.ID > 0) Then
        EcritureRecurrenteFacade.ObjCompte.Entity = Nothing
    End If
 
    ' Prépare la recherche
    Dim i As GridDataItem = DirectCast(e.Item, GridDataItem)
    Dim editValues As New Hashtable()
    i.ExtractValues(editValues)
    editValues.Add("CompteNumeroID", i("CompteNumero").ClientID)
    ViewState("extract") = editValues
    Dim SearchValue As String = ""
    If (editValues("CompteNumero") IsNot Nothing) Then
        SearchValue = editValues("CompteNumero").ToString
    End If
 
    MainMaster.CallSearchItem(GetLocalResourceString("SearchTitle_Compte"), EcritureRecurrenteFacade.ObjCompte.LinqContextTypeName,
                      EcritureRecurrenteFacade.ObjCompte.GetPropertyName(Function() EcritureRecurrenteFacade.ObjCompte.GridSearchSelect),
                      i("CompteNumero").ClientID, EcritureRecurrenteFacade.ObjCompte.GridSearchColumn)

When my Search is terminated and my RadWindows closes. This function it's call
Private Sub RechercheEventCompte(ByVal sender As System.Object, ByVal e As System.EventArgs)
    'Select case contenant la liste de tous les champs dont la recherche est disponible.
    If (ViewState("extract") IsNot Nothing) Then
        Dim Hash As Hashtable = DirectCast(ViewState("extract"), Hashtable)
        Dim oldvalue As String = ""
        If Hash("CompteNumero") IsNot Nothing Then
            oldvalue = Hash("CompteNumero").ToString
        End If
 
        Dim ObjEventArgs As SearchReturnEvent = CType(e, SearchReturnEvent)
        Select Case ObjEventArgs.UpdatedControlId
            Case Hash("CompteNumeroID").ToString
                GetCompteByID(ObjEventArgs.IDSelect)
        End Select
 
    End If
End Sub
 
Public Sub GetCompteByID(ByVal IdCompte As Integer)
    Try
        ' REcherche et obtention du Compte relier a la recherche
        EcritureRecurrenteFacade.ObjCompte.GetByID(IdCompte)
        EcritureRecurrenteFacade.ObjCompte.Entity = EcritureRecurrenteFacade.ObjCompte.SelectedTEntity
        RadGridEdit.Rebind()  ' BUG LINE
        'RadGridEdit.DataBind()
    Catch ex As Exception
        Throw ex
    End Try
End Sub

Before, with the LinqDataSource, after using «DataBind» in «GetCompteID». The RadGrid_ItemDataBound is called for insert the «Compte» value in my row cells. 
   Private Sub RadGridEdit_ItemDataBound(sender As Object, e As GridItemEventArgs) Handles RadGridEdit.ItemDataBound
        'Ajouter la validation de confirmation
        'Le code à été mis ici pour l'ajout du script afin de permettre de désactiver les événements
        If TypeOf e.Item Is GridDataItem Then
            Dim dataItem As GridDataItem = CType(e.Item, GridDataItem)
 
            ' Permet d'inscrire la valeur de la recherche lors de insertion d'une nouvelle ligne.
            If (EcritureRecurrenteFacade.ObjCompte.Entity IsNot Nothing) AndAlso (EcritureRecurrenteFacade.ObjCompte.Entity.ID > 0) AndAlso (ViewState("extract") IsNot Nothing) Then
                If RadGridEdit.MasterTableView.EditMode = GridEditMode.InPlace Then
                    If TypeOf e.Item Is GridDataInsertItem AndAlso e.Item.OwnerTableView.IsItemInserted Then
                        Dim insertItem As GridDataInsertItem = DirectCast(e.Item, GridDataInsertItem)
                        TryCast(insertItem("CompteNumero").Controls(0), Telerik.Web.UI.RadNumericTextBox).Text = CStr(EcritureRecurrenteFacade.ObjCompte.Entity.Numero)
                        TryCast(insertItem("Description").Controls(0), TextBox).Text = EcritureRecurrenteFacade.ObjCompte.Entity.Description
                    ElseIf TypeOf e.Item Is GridDataItem AndAlso e.Item.IsInEditMode Then
                        Dim editItem As GridEditableItem = DirectCast(e.Item, GridEditableItem)
                        TryCast(editItem("CompteNumero").Controls(0), Telerik.Web.UI.RadNumericTextBox).Text = CStr(EcritureRecurrenteFacade.ObjCompte.Entity.Numero)
                        TryCast(editItem("Description").Controls(0), TextBox).Text = EcritureRecurrenteFacade.ObjCompte.Entity.Description
                    End If
                End If
            End If
 {...}
End sub

But with ODS (object data source) after my Rad RadWindows closes, I receive a same message error.

DataBinding: 'Telerik.Web.UI.GridInsertionObject' does not contain a property with the name 'CodeComplementaireNumero'.


Thank you if u can help me, and sorry for my bad english :/
Good Day
Mathieu B.B
Andrey
Telerik team
 answered on 05 Jul 2013
1 answer
28 views
Hi ,

i am able to search a word in radEditor but i want that word should be in view 
is there any thing like ScrollIntoView.?

Thanks
Sumit
Slav
Telerik team
 answered on 05 Jul 2013
1 answer
98 views
you can create a combobox columns with header but load the data with a webservice?

I load the record in combobox with this code:


<WebMethod()> _
Public Function GetLuogoNome(ByVal context As RadComboBoxContext) As RadComboBoxData
    Dim data As DataTable = GetCittadinanza(context.Text)
 
    Dim comboData As New RadComboBoxData()
    Dim itemOffset As Integer = context.NumberOfItems
    Dim endOffset As Integer = Math.Min(itemOffset + ItemsTipoGruppoPerRequest, data.Rows.Count)
    comboData.EndOfItems = endOffset = data.Rows.Count
 
    Dim result As New List(Of RadComboBoxItemData)(endOffset - itemOffset)
 
    For i As Integer = itemOffset To endOffset - 1
        Dim itemData As New RadComboBoxItemData()
        itemData.Text = data.Rows(i)("descrizione").ToString()
        itemData.Value = data.Rows(i)("idrecord").ToString()
        result.Add(itemData)
    Next
    REM ottengo il messaggio dei record selezionati
    comboData.Message = GetStatusMessage(endOffset, data.Rows.Count)
    comboData.Items = result.ToArray()
    Return comboData
End Function
Private Function GetLuogo(ByVal text As String) As DataTable
    REM SELECT * FROM Tab_categorie WHERE CONTAINS(descrizione, @text)
    REM per indici full text
    Dim conString = ConfigurationManager.ConnectionStrings("Receptionstring")
    Dim strConnString As String = conString.ConnectionString
    Using scope As New Transactions.TransactionScope
        Using db As New SqlConnection(strConnString)
            db.Open()
            Using sqlcmd As New SqlCommand("get_cittadinanza", db)
                sqlcmd.CommandType = CommandType.StoredProcedure
                sqlcmd.Parameters.AddWithValue("@textsearch", SqlDbType.VarChar).Value = text
                Dim adapter As New SqlDataAdapter(sqlcmd)
                Dim data As New DataTable()
                adapter.Fill(data)
                Return data
            End Using
        End Using
        scope.Complete()
    End Using
Hristo Valyavicharski
Telerik team
 answered on 05 Jul 2013
1 answer
205 views
  Below is the gridview rowcommand code which i want to convert in radgrid itemdatabound any budy have solution

protected void Gridviiew_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                if (e.Row.RowType == DataControlRowType.Header)
                {
                    dtTotalDuration = Convert.ToDateTime("01/01/1900");
                    dtTotalTimeSpent = Convert.ToDateTime("01/01/1900");
                }
                else if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    Int32 intRow = e.Row.RowIndex + 1;

                    int intSeconds;
                    string strValue;
                    string strHtml;

                    //strHtml = "javascript:var w=window.showModalDialog('Course.aspx?ChapterNum=" + intRow.ToString() + "', null, 'dialogHeight=700px; dialogTop=75px; dialogLeft=250px; dialogWidth=800px; edge=Raised; center=No; help=Yes; resizable=no; status=no; scroll=yes');";
                    strHtml = "javascript:var w=openCourse('" + intRow.ToString() + "', '" + Session["CID"].ToString() + "');";
                     //   e.Row.Cells[4].Attributes.Add("OnClientClick", "function_Name()");

                    //Add New
                    string strhtmlnew1 = "javascript:RadWindowOpenCourse('" + intRow.ToString() + "', '" + Session["CID"].ToString() + "');";
                    e.Row.Cells[4].Attributes.Add("OnClick", "javascript:RadWindowOpenCourse('" + intRow.ToString() + "','" + Session["CID"] + "');return false;");
                   
                    strValue = DataBinder.Eval(e.Row.DataItem, "Course_Duration").ToString();
                    intSeconds = clsCommonData.MyInt32Convert(strValue.Substring(0, 2)) * 3600 + clsCommonData.MyInt32Convert(strValue.Substring(3, 2)) * 60 + clsCommonData.MyInt32Convert(strValue.Substring(6, 2));
                    dtTotalDuration = dtTotalDuration.AddSeconds(Convert.ToDouble(intSeconds));

                    strValue = DataBinder.Eval(e.Row.DataItem, "Customer_Duration").ToString();
                    intSeconds = clsCommonData.MyInt32Convert(strValue.Substring(0, 2)) * 3600 + clsCommonData.MyInt32Convert(strValue.Substring(3, 2)) * 60 + clsCommonData.MyInt32Convert(strValue.Substring(6, 2));
                    dtTotalTimeSpent = dtTotalTimeSpent.AddSeconds(Convert.ToDouble(intSeconds));
                }
                else if (e.Row.RowType == DataControlRowType.Footer)
                {
                    e.Row.Cells[1].Text = dtTotalDuration.ToString("HH:mm:ss");
                    e.Row.Cells[2].Text = dtTotalTimeSpent.ToString("HH:mm:ss");
                }
            }
            catch (Exception ex)
            {
                if (ex.Message.Substring(0, 56) != "Specified argument was out of the range of valid values.")
                {
                    clsErrorLogData.LogError("Content", "Gridviiew_RowDataBound", ex.Source + "_" + Common_App.MyString(Session["CID"]), ex.Message, "");
                }
            }
        }
Princy
Top achievements
Rank 2
 answered on 05 Jul 2013
1 answer
58 views
is it possible to loop thru the "stand alone" radFilter and get the FieldNames + any Vaule used rather than have a huge GLOB of text to Parse thru?
i've been using RadFilters for over three years and don't really need a link to a tutorial unless it specifically shows this function. i was wondering if it's even possible.
usually i wind up w/ this to deal with:
 WHERE  (WORKORDERNUMBER LIKE '12345%' AND TRUNC(INVOICEDATE) >= TO_DATE('7/1/2013 12:00:00 AM','MM/DD/YYYY HH12:MI:SS AM') AND PROFITCENTERCODE LIKE '0708%')

this is great for tacking onto a dynamic query - but, i'd like to be able to capture which field was used and what value was passed.
thx
rik


 

 

<telerik:RadFilter ID="VolSummaryRadFilter" runat="server" Skin="WebBlue" ShowApplyButton="true" OnFieldEditorCreating="VolSummaryRadFilter_FieldEditorCreating"

 

 

 

OnPreRender="VolSummaryRadFilter_PreRender" OnApplyExpressions="VolSummaryRadFilter_Apply" Visible="false" OnItemCommand="VolSummaryRadFilter_ItemCommand">

 

 

 

<FieldEditors>

 

 

 

 

<telerik:RadFilterDateFieldEditor FieldName="INVOICEDATE" DisplayName="Invoice Date"

 

 

 

DataType="System.DateTime" MinDate="1/1/1900" />

 

 

 

 

<

 

 

telerik:RadFilterTextFieldEditor FieldName="PROFITCENTERCODE" DisplayName="Profit Ctr Code"

 

 

 

 

 

 

 

DataType="System.String" />

 

 

 

 

<

 

 

telerik:RadFilterTextFieldEditor FieldName="WORKORDERNUMBER" DisplayName="WorkOrder #" DataType="System.String" />

 

 

 

</FieldEditors>

 

 

 

</telerik:RadFilter>

 

Kostadin
Telerik team
 answered on 05 Jul 2013
3 answers
224 views
Hi,
i am new to telerik controls.i used RAD Progress Area control in my project.if i use it with out update panel,it works as expected.when i place it with in update panel the progress area is not closing even after the process is over.i add RadProgressContext.OperationComplete = true;.
but no luck.how to do this.
Thanks.
Shinu
Top achievements
Rank 2
 answered on 05 Jul 2013
5 answers
181 views

When using radfilter in radwindow like the following example, This radwindow/radfilter is shared my all the gird filter through my site.

http://demos.telerik.com/aspnet-ajax/filter/examples/filterinradwindow/defaultcs.aspx

If I have GridDateTimeColumn on the grid and have TimePicker and DatePicker as PickerType for separate column, On the filter, how can I check the GridDateTimeColumn PickerType to show date only (no time icon) when PickerType is DatePicker and show time only ( no date icon) when PickerType is TimePicker ?

Thanks

Antonio Stoilkov
Telerik team
 answered on 05 Jul 2013
11 answers
192 views
RadTimePicker pop Window is not working with Google Chrome & Apple Safari  .
Though it is working fine with IE & Mozilla Firefox.  
Daniel
Telerik team
 answered on 05 Jul 2013
1 answer
93 views
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<WeBOC.DAL.Vessel>" %>
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<script runat="server">
 
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        RadGrid1.DataSource = ViewData["Vessels"];               
    }
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
 
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 
    <form id="form2">
     
 
    <h2>Vessels<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
        </telerik:RadScriptManager>
    </h2>
     
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"
        CellSpacing="0" GridLines="None" Skin="WebBlue"
        onneeddatasource="RadGrid1_NeedDataSource" AllowPaging="True"  PagerStyle-Mode="NextPrevNumericAndAdvanced">
        <MasterTableView>
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
 
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="VIR_NO" HeaderText="VIR No." />
                <telerik:GridBoundColumn DataField="INBOUND_VOY_NO" HeaderText="I/B Voyage" />
                <telerik:GridBoundColumn DataField="OUTBOUND_VOY_NO" HeaderText="O/B Voyage" />
                <telerik:GridBoundColumn DataField="VESSEL_NAME" HeaderText="Vessel Name" />
                <telerik:GridBoundColumn DataField="ARRIVAL_DATE" HeaderText="Arrived" />
                <telerik:GridBoundColumn DataField="STATE" HeaderText="Phase" />               
                <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column"
                    UniqueName="TemplateColumn">
                    <ItemTemplate>
                            <asp:HyperLink ID="HyperLink1" runat="server" Text="View"
                            NavigateUrl='<%#Url.Action("Inspector","Vessel",new{id=Modal.VSSL_CALL_ID}) %>'></asp:HyperLink>
                        </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
 
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
        </MasterTableView>
 
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
 
    </telerik:RadGrid>
 
     
    </form>
 
</asp:Content>


Have a look at the above code, when it runs, it stuck at  NavigateUrl='<%#Url.Action("Inspector","Vessel",new{id=Modal.VSSL_CALL_ID}) %>'>

and says that object reference not set to an instance of an object. How do i achieve the functionality that when i click on this hyperlink, the id of the selected row will pass to the desired controller?

Thanks
Ovais
Andrey
Telerik team
 answered on 05 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?