Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
173 views

I have a TreeList that loads onclick of a button (btnGeoDetailsFacilities) which calls RadGeoTreeListFacilities_Bind() this function grabs the parents. All of that works fine, I get parent rows.

Problem:

The problem is when I click the expand node the Treelist and headers disappear and no event is called. If I click the “btnGeoDetailsFacilities” button a second time RadTreeList1_ChildItemsDataBind is called and the grid loads with child items expanded as it should have when I clicked the expand button.

Question:

Why are the Tree and headers disappearing on expand and how do I get it to work properly e.g. show children when I click expand? As show here http://demos.telerik.com/aspnet-ajax/treelist/examples/databinding/loadondemand/defaultvb.aspx

Code:

<telerik:RadAjaxPanelID="RadAjaxPanel1"LoadingPanelID="RadAjaxLoadingPanel"runat="server">

            <telerik:RadTreeListrunat="server"ID="RadGeoTreeList"Visible="true"DataKeyNames="FacilitiesreportingId"ParentDataKeyNames="VERA3"AutoGenerateColumns="false"

            Width="100%"Height="400"ShowTreeLines="true"AllowLoadOnDemand="true">

                <Columns>

                    <telerik:TreeListBoundColumnDataField="Origin"HeaderText="Origin"UniqueName="Origin"></telerik:TreeListBoundColumn>

                    <telerik:TreeListBoundColumnDataField="Destination"HeaderText="Destination"UniqueName="Destination"></telerik:TreeListBoundColumn>

                    <telerik:TreeListBoundColumnDataField="FinanceNumber"HeaderText="Finance Number"UniqueName="FinanceNumber"></telerik:TreeListBoundColumn>

                    <telerik:TreeListBoundColumnDataField="Address"HeaderText="Address"UniqueName="Address"></telerik:TreeListBoundColumn>

                    <telerik:TreeListBoundColumnDataField="City"HeaderText="City"UniqueName="City"></telerik:TreeListBoundColumn>

                    <telerik:TreeListBoundColumnDataField="State"HeaderText="State"UniqueName="State"></telerik:TreeListBoundColumn>

                    <telerik:TreeListBoundColumnDataField="ZipCode"HeaderText="Zip"UniqueName="ZipCode"></telerik:TreeListBoundColumn>

                    <telerik:TreeListBoundColumnDataField="Distance"HeaderText="Driving Distance"UniqueName="Distance"></telerik:TreeListBoundColumn>

                    <telerik:TreeListBoundColumnDataField="Area"HeaderText="Area"UniqueName="Area"></telerik:TreeListBoundColumn>

                    <telerik:TreeListBoundColumnDataField="PFC"HeaderText="PFC"UniqueName="PFC"></telerik:TreeListBoundColumn>

                    <telerik:TreeListBoundColumnDataField="OnRolls1"HeaderText="OnRolls"UniqueName="OnRolls1"></telerik:TreeListBoundColumn>

                    <telerik:TreeListBoundColumnDataField="Residual"HeaderText="Residual"UniqueName="Residual"></telerik:TreeListBoundColumn>

                    <telerik:TreeListBoundColumnDataField="Withheld"HeaderText="Withheld"UniqueName="Withheld"></telerik:TreeListBoundColumn>

                    <telerik:TreeListBoundColumnDataField="Optional1"HeaderText="OPT"UniqueName="Optional1"></telerik:TreeListBoundColumn>

                    <telerik:TreeListBoundColumnDataField="VERA1"HeaderText="VER"UniqueName="VERA1"></telerik:TreeListBoundColumn>

                </Columns>

            </telerik:RadTreeList>

        </telerik:RadAjaxPanel>

        <telerik:RadAjaxLoadingPanelID="RadAjaxLoadingPanel"runat="server"/>

 

<telerik:RadAjaxManagerrunat="server"ID="RadAjaxManager1"ClientEvents-OnRequestStart="mngRequestStarted"EnableAJAX="true">

              <AjaxSettings>

            <telerik:AjaxSettingAjaxControlID="btnGeoDetailsFacilities">

                           <UpdatedControls>

                    <telerik:AjaxUpdatedControlControlID="RadGeoTreeList"LoadingPanelID="RadAjaxLoadingPanel"/>

                           </UpdatedControls>

                     </telerik:AjaxSetting>

</AjaxSettings>

              <ClientEventsOnRequestStart="mngRequestStarted"/>

       </telerik:RadAjaxManager>

 

 

 

PublicSub RadGeoTreeListFacilities_Bind()

 

        geoDataList = ds.GetDistanceGridFacilities(oLat, oLon, radius, facilityNumber)

 

        Dim g = (From item In geoDataList _

                Where item.VERA3 = Nothing _

                Select item).ToList()

 

        RadGeoTreeList.DataSource = g

        Cache("geoData") = geoDataList

    EndSub

 

‘why does this get called twice onload?

ProtectedSub RadTreeList1_NeedDataSource(ByVal sender AsObject, ByVal e AsTreeListNeedDataSourceEventArgs) Handles RadGeoTreeList.NeedDataSource

        If IsCallback Or IsPostBack Then

            If Session("GeoTreeListMode") = "facilities"Then

                RadGeoTreeListFacilities_Bind()

            ElseIf Session("GeoTreeListMode") = "studies"Then

                RadGeoTreeList_Bind()

            EndIf

        EndIf

    EndSub

 

ProtectedSub RadTreeList1_ChildItemsDataBind(ByVal sender AsObject, ByVal e AsTreeListChildItemsDataBindEventArgs) Handles RadGeoTreeList.ChildItemsDataBind

        Dim id AsInteger = Convert.ToInt32(e.ParentDataKeyValues("FacilitiesreportingId").ToString())

 

        Dim g = (From item In geoDataList _

                Where item.VERA3 = id _

                Select item).ToList()

 

        e.ChildItemsDataSource = g

    EndSub

 

ProtectedSub OnClick_btnGeoDetailsFacilities(sender AsObject, e As System.EventArgs)

        Session("GeoTreeListMode") = "facilities"

End Sub

 

 

PublicClassFacilityItem

    Private _Origin AsString

    PublicProperty Origin() AsString

        Get

            Return _Origin

        EndGet

        Set(ByVal value AsString)

            _Origin = value

        EndSet

    EndProperty

 

    Private _Destination AsString

    PublicProperty Destination() AsString

        Get

            Return _Destination

        EndGet

        Set(ByVal value AsString)

            _Destination = value

        EndSet

    EndProperty

 

    Private _Distance AsString

    PublicProperty Distance() AsString

        Get

            Return _Distance

        EndGet

        Set(ByVal value AsString)

            _Distance = value

        EndSet

    EndProperty

 

 

    Private _Address AsString

    PublicProperty Address() AsString

        Get

            Return _Address

        EndGet

        Set(ByVal value AsString)

            _Address = value

        EndSet

    EndProperty

 

    Private _City AsString

    PublicProperty City() AsString

        Get

            Return _City

        EndGet

        Set(ByVal value AsString)

            _City = value

        EndSet

    EndProperty

 

    Private _State AsString

    PublicProperty State() AsString

        Get

            Return _State

        EndGet

        Set(ByVal value AsString)

            _State = value

        EndSet

    EndProperty

 

    Private _ZipCode AsString

    PublicProperty ZipCode() AsString

        Get

            Return _ZipCode

        EndGet

        Set(ByVal value AsString)

            _ZipCode = value

        EndSet

    EndProperty

 

    Private _FinanceNumber AsString

    PublicProperty FinanceNumber() AsString

        Get

            Return _FinanceNumber

        EndGet

        Set(ByVal value AsString)

            _FinanceNumber = value

        EndSet

    EndProperty

 

    Private _FacilityName AsString

    PublicProperty FacilityName() AsString

        Get

            Return _FacilityName

        EndGet

        Set(ByVal value AsString)

            _FacilityName = value

        EndSet

    EndProperty

 

 

    Private _Optional1 AsInteger

    PublicProperty Optional1() AsInteger

        Get

            Return _Optional1

        EndGet

        Set(ByVal value AsInteger)

            _Optional1 = value

        EndSet

    EndProperty

 

    Private _Withheld AsInteger

    PublicProperty Withheld() AsInteger

        Get

            Return _Withheld

        EndGet

        Set(ByVal value AsInteger)

            _Withheld = value

        EndSet

    EndProperty

 

    Private _OnRolls1 AsInteger

    PublicProperty OnRolls1() AsInteger

        Get

            Return _OnRolls1

        EndGet

        Set(ByVal value AsInteger)

            _OnRolls1 = value

        EndSet

    EndProperty

 

    Private _Area AsString

    PublicProperty Area() AsString

        Get

            Return _Area

        EndGet

        Set(ByVal value AsString)

            _Area = value

        EndSet

    EndProperty

 

    Private _PFC AsString

    PublicProperty PFC() AsString

        Get

            Return _PFC

        EndGet

        Set(ByVal value AsString)

            _PFC = value

        EndSet

    EndProperty

 

    Private _Residual AsInteger

    PublicProperty Residual() AsInteger

        Get

            Return _Residual

        EndGet

        Set(ByVal value AsInteger)

            _Residual = value

        EndSet

    EndProperty

 

    Private _FacilitiesreportingId AsInteger

    PublicProperty FacilitiesreportingId() AsInteger

        Get

            Return _FacilitiesreportingId

        EndGet

        Set(ByVal value AsInteger)

            _FacilitiesreportingId = value

        EndSet

    EndProperty

 

    Private _VERA1 AsInteger

    PublicProperty VERA1() AsInteger

        Get

            Return _VERA1

        EndGet

        Set(ByVal value AsInteger)

            _VERA1 = value

        EndSet

    EndProperty

 

    Private _VERA3 AsInteger

    PublicProperty VERA3() AsInteger

        Get

            Return _VERA3

        EndGet

        Set(ByVal value AsInteger)

            _VERA3 = value

        EndSet

    EndProperty

 

    'Public Sub New(ByVal strOrigin As String, ByVal strDestination As String, ByVal strCity As String, ByVal strState As String, ByVal strZipCode As String, ByVal strAddress As String, _

    '               ByVal strDistance As String, ByVal strFacilityName As String, ByVal strFinanceNumber As String, ByVal strArea As String, ByVal strPFC As String, ByVal intOnRolls1 As Integer, _

    '               ByVal intVERA1 As Integer, ByVal intResidual As Integer, ByVal intOptional1 As Integer, ByVal intWithHeld As Integer, ByVal intFacilitiesreportingId As Integer, ByVal intVERA3 As Integer)

 

    '    Origin = strOrigin

    '    Destination = strDestination

    '    City = strCity

    '    State = strState

    '    ZipCode = strZipCode

    '    Address = strAddress

    '    Distance = strDistance

    '    FacilityName = strFacilityName

    '    FinanceNumber = strFinanceNumber

    '    Area = strArea

    '    PFC = strPFC

    '    OnRolls1 = intOnRolls1

    '    VERA1 = intVERA1

    '    VERA3 = intVERA3

    '    Residual = intResidual

    '    Optional1 = intOptional1

    '    FacilitiesreportingId = intFacilitiesreportingId

    '    Withheld = intWithHeld

    'End Sub

 

 

End Class

 

 

Mock data:

'mergedList.Add(New FacilityItem("asdf", "asdf", "asdf", "asdf", "asdf", "asdf", "asdf", "asdf", "asdf", "asdf", "asdf", 1234, 1234, 1234, 1234, 1234, 222, 1))

        'mergedList.Add(New FacilityItem("header", "header", "header", "header", "header", "header", "header", "header", "header", "header", "header", 1234, 1234, 1234, 1234, 1234, 1, 0))

Marin
Telerik team
 answered on 01 Nov 2012
1 answer
81 views
In my database have column name "imageFile" to store the image "test.jpg". Now I want to display the "test.jpg" in RadAsyncUpload textbox when page is load. But I found cannot implement RadAsyncUpload.text. How do I implement this? is it possible? Thanks
Plamen
Telerik team
 answered on 01 Nov 2012
2 answers
73 views
Hi all,

In my radgrid, I can select multiple rows at  a time. How can I loop through labels of the selected items? Please help me to find an answer.

Thanks in advance

Tsvetoslav
Telerik team
 answered on 01 Nov 2012
5 answers
189 views
While many pivot tables are aggregates, there is plenty of usefullness to have the 3-d format of a pivot and still be able to handle if the user would like to update a cell value in the aggregate section. Is there anyway to do this?
Tsvetoslav
Telerik team
 answered on 01 Nov 2012
1 answer
97 views
In the grid whenever text within the tags is saved it is not visible in the data bound columns.

Ex. If this text <Coffee> is bound to the data column then it does not appear in the column , rather a blank space appears.

(This may be probably as while rendering its considering text as a tag as its b/w tags <>)

What can be the potential fix for this issue?

(I guess similar issue persist in this site in demo of grids. Inline Editing of grid columns. [on saving <Tea> as column value value does not save])
Marin
Telerik team
 answered on 01 Nov 2012
11 answers
285 views
I have followed this sample:


and created a column type to fitler with a radcombobox.  I added a DataSourceID to my column and when I set it the whole thing works correctly.

However I would like to add another option to have fitlering based on the items currently in the list.  I overrode the PrepareCell method and add the unique items as they go by:

   public override void PrepareCell(TableCell cell, GridItem item) 
        { 
             
            base.PrepareCell(cell, item); 
 
            if (UseAvailableValuesForDataSource && item is GridDataItem) 
            { 
                if (rcBox.Items.FindItemByText(cell.Text) == null
                { 
                    rcBox.Items.Add(new RadComboBoxItem(cell.Text)); 
 
                } 
               
            } 
 
        } 
 

This fills the combobox with the unique values, however when I get back into the  SetCurrentFilterValueToControl & GetCurrentFilterValueFromControl the value of the selected item is empty and so the filter doesn't get set.  I tried storing a list in ViewState and restoring from there but that didn't seem to work.  (For some reason my ViewState items wouldn't be restored either?)

Is there anyway to filter based on the currently displayed items instead of getting the full set back from the datasource?

Thanks,
Won
Top achievements
Rank 1
 answered on 01 Nov 2012
3 answers
161 views
I need replace  some token in tooltip by User Name in server side.

I use
var mybuttonToolTip = button.get_tooltip();
mybuttonToolTip   = mybuttonToolTip.replace("{TOKEN}", currentUserName};
button.set_tooltip(mybuttonToolTip );  This event exist?

Leon
Top achievements
Rank 1
 answered on 01 Nov 2012
1 answer
97 views
Hi all,

I have a radgrid in which I need to populate a textbox(boundcolumn) when clicking on the insert button. The first textbox should populate value of 
boundcolumn(name) in the first row.

Thanks in advance.
Shinu
Top achievements
Rank 2
 answered on 01 Nov 2012
5 answers
166 views
Hi

I have created custom template column for filtering . Given below is code of MyCustomFilteringTemplateColumn.cs. I m using Entity datasource 


 //RadGrid will cal this method when the value should be set to the filtering input control(s)
        protected override void SetCurrentFilterValueToControl(TableCell cell)
        {
            base.SetCurrentFilterValueToControl(cell);
            RadComboBox combo = (RadComboBox)cell.Controls[0];
            if ((this.CurrentFilterValue != string.Empty))
            {
                combo.Text = this.CurrentFilterValue;
            }
        }

     

        //RadGrid will cal this method when the filtering value should be extracted from the filtering input control(s)
        protected override string GetCurrentFilterValueFromControl(TableCell cell)
        {
            RadComboBox combo = (RadComboBox)cell.Controls[0];
         
            this.CurrentFilterFunction = (combo.Text.Trim() != "") ? GridKnownFunction.EqualTo : GridKnownFunction.NoFilter;
            return combo.Text;

           
        }

        private void list_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
        {
            
             
                    Collection<Entities.ProjectUsersAndGroups> collDataSource = (Collection<Entities.ProjectUsersAndGroups>)FilterDataSource;
                    ((RadComboBox)o).DataTextField = this.DataField;
                    ((RadComboBox)o).DataValueField = this.DataField;
                    ((RadComboBox)o).DataSource = collDataSource;
                    ((RadComboBox)o).DataBind();
                    break;

           

        }

        private void list_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            GridFilteringItem filterItem = (GridFilteringItem)((RadComboBox)o).NamingContainer;
            if ((this.UniqueName == "Index"))
            {
                //this is filtering for integer column type 
                filterItem.FireCommandEvent("Filter", new Pair("EqualTo", this.DataField));
            }
            //filtering for string column type
            if (this.UniqueName == "ProjectCategoryName")
                this.UniqueName = "ProjectCategoryDetails.ProjectCategoryName";

            filterItem.FireCommandEvent("Filter", new Pair("Contains", this.DataField));


        }



While filtering I am getting error  "Expression expected " on this line   filterItem.FireCommandEvent("Filter", new Pair("Contains", this.DataField));".


Please help me out 
Won
Top achievements
Rank 1
 answered on 01 Nov 2012
2 answers
167 views
Hi,

I have a scenario where i need to do Paging, Sorting and Filtering only at client side and not on server side.
Abhijit Shetty
Top achievements
Rank 2
 answered on 01 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?