Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
135 views
Hello,

I have created RadFilterDataFieldEditor by following article: http://www.telerik.com/community/forums/aspnet-ajax/filter/error-when-building-custom-radfilterdatafieldeditor.aspx
It works good if the FilterContainerID property is not set. If I set this property to my RadGrid it does not work correctly.
Editor is shown ok if I add filter expression, but after I click the Apply button, default editor is shown instead RadFilterDataFieldEditor. After next postback I get error with invalid viewstate data.

Here is the Code:
<telerik:RadFilter runat="server" ID="filter" FilterContainerID="articles" ShowApplyButton="true"
    OnFieldEditorCreating="filter_FieldEditorCreating">
    <FieldEditors>
        <telerik:RadFilterTextFieldEditor FieldName="Title" />
        <km:RadFilterDropDownEditor DataSourceID="dsStates" DataTextField="Name" DataValueField="ArticleStatusId"
            FieldName="StatusId" />
        <telerik:RadFilterTextFieldEditor FieldName="AuthorFullName" />
        <telerik:RadFilterNumericFieldEditor FieldName="Rating" />
        <telerik:RadFilterNumericFieldEditor FieldName="TimesRated" />
        <telerik:RadFilterDateFieldEditor FieldName="CreatedDate" />
        <telerik:RadFilterDateFieldEditor FieldName="ModifiedDate" />
    </FieldEditors>
</telerik:RadFilter>
<telerik:RadGrid ID="articles" runat="server" OnNeedDataSource="articles_NeedDataSource"
    EnableLinqExpressions="false" ShowFooter="True" AllowFilteringByColumn="True"
    AllowSorting="True" ShowGroupPanel="True" AllowPaging="true" PageSize="10">
    <MasterTableView AutoGenerateColumns="False" EnableHeaderContextMenu="true" IsFilterItemExpanded="false">
        <Columns>
            <telerik:GridBoundColumn DataField="Title" HeaderText="Title" />
            <telerik:GridDropDownColumn DataField="StatusId" HeaderText="Status" DataSourceID="dsStates" ListTextField="Name" ListValueField="ArticleStatusId" />
            <telerik:GridBoundColumn DataField="AuthorFullName" HeaderText="Author" />
            <telerik:GridBoundColumn DataField="Rating" HeaderText="Rating" />
            <telerik:GridBoundColumn DataField="TimesRated" HeaderText="TimesRated" />
            <telerik:GridBoundColumn DataField="CreatedDate" HeaderText="Created" />
            <telerik:GridBoundColumn DataField="ModifiedDate" HeaderText="Modified" />
        </Columns>
    </MasterTableView>
    <GroupingSettings ShowUnGroupButton="true" CaseSensitive="false" />
    <ClientSettings AllowDragToGroup="True" AllowColumnsReorder="True" />
</telerik:RadGrid>

Codebehind:
protected void filter_FieldEditorCreating(object sender, RadFilterFieldEditorCreatingEventArgs e)
{
    if (e.EditorType == "RadFilterDropDownEditor")
    {
        e.Editor = new RadFilterDropDownEditor();
    }
}

Thank you
Jiri
JiriSchmitt
Top achievements
Rank 1
 answered on 20 Jan 2011
1 answer
154 views
Hi guys,

i'm using the RADFileExplorer control and i'm having some problem with localization.
I need to change the language of the control in my page according with the one of the user (selected from db).
So i added the App_GlobalResources folder to my solution, copied some localized resx files (es: RadEditor.Dialogs.es-ES.resx, RadEditor.Dialogs.it-IT.resx, ecc ...). In the page_load event i set the language radfileexplorer.Language = 'it-IT', for example, but nothing happen! But if i rename the it file to RadEditor.Dialogs.resx the control is translated!
I'm missing something ?

Best regards,
GE
gianemilio redaelli
Top achievements
Rank 1
 answered on 20 Jan 2011
1 answer
51 views
3 answers
85 views
Hi

I have a very large report which is divided into 60 pages. I only show the footer on the last page.
If I move to for example page 10 and press export, everything but the footer (aggregate ="sum") will be exported. I always work if I export from the first page.

What have I missed?


Thanks in advance

/Teresia
Princy
Top achievements
Rank 2
 answered on 20 Jan 2011
1 answer
87 views
The telerik radgrid rows are overlaping as you can see in the attachement. Can anyone got this problem and if you know the fix please share with me.
Shinu
Top achievements
Rank 2
 answered on 20 Jan 2011
1 answer
122 views
I assumed I would be able to find a solution to this issue very easily, but unfortunately I haven't been able to.

I have a pie chart that I want to simply display only 2 pieces.  I have a sql command that uses the UNION command to join my two queries into one column for the chart.  That is working fine, however I do not know how to change the pie charts legend to show the 2 colors, and add custom text for each color.

I changed the LegendDisplayMode to show ItemLabels.  Also, I am trying to set the legend text by using:
Protected Sub RadChart1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Charting.ChartItemDataBoundEventArgs) Handles RadChart1.ItemDataBound
        e.SeriesItem.Name = "Purchases"
        e.SeriesItem.Name = "Returns"
    End Sub

This obviously only shows "Returns" on the legend, and does so twice for both slice colors.  How do I change both of them?
Evgenia
Telerik team
 answered on 20 Jan 2011
5 answers
178 views

Hello.

I'm converting a SharePoint web farm from MOSS 2007 to SharePoint 2010 Enterprise, and my client uses the RadEditor for MOSS.  We currently have RadEditor 5.8.4.0 (radeditormoss.wsp) installed.  On one of our sites, we can't put any publishing pages in edit mode without getting the following error.  Does anyone know what might be causing this error?

01/13/2011 11:10:44.51  w3wp.exe (0x03D0)                        0x1414 SharePoint Foundation          Runtime                        tkau Unexpected System.MissingMethodException: Method not found: 'Boolean Microsoft.SharePoint.Publishing.WebControls.HtmlEditor.get_DisableBasicFormattingButtons()'.    at Telerik.SharePoint.RadHtmlField.SetEditorProperties()     at Telerik.SharePoint.RadHtmlField.OnLoad(EventArgs e)     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoi... faaa8390-d548-4d90-a646-4d9a457df63e

Thanks!
Stanimir
Telerik team
 answered on 20 Jan 2011
2 answers
122 views
I have FileExplorer reading from a virtual path setup in IIS with Integrated Windows Authentication.  It displays the files but when a user clicks to open one it prompts for user/pass info and nothing works, it keeps prompting.

what am I missing?
Dobromir
Telerik team
 answered on 20 Jan 2011
4 answers
220 views
Hi,

I have a dynamically created RadGrid. Now on expanding the child tables in the Grid, I want to get the name of the tableView on "grv_ItemCommand" event. Here is my code:
private void BindData()
        {
            clickedType = Session["type"].ToString();
            int id = ParentEntity.ParentEntityId;
            GridTableView tableView = new GridTableView(grv);
 
            switch (clickedType)
            {
                case "All Categories":
                    using (SpaceCategoriesService.SpaceCategoriesServiceClient s = new SpaceCategoriesService.SpaceCategoriesServiceClient())
                    {
                        grv.DataSource = s.GetCategoryTable();
                        tableView.Name = "Buildings";
                        tableView.DataMember = "Buildings";
                    }
                    break;
 
                case "SpaceCategories":
                    using (SpaceBuildingsService.SpaceBuildingsServiceClient s = new SpaceBuildingsService.SpaceBuildingsServiceClient())
                    {
                        grv.DataSource = s.GetBuildingByCategoryId(id);
                        tableView.Name = "Floors";
                        tableView.DataMember = "Floors";
                    }
                    break;
 
                case "SpaceBuildings":
                    using (SpaceFloorService.SpaceFloorServiceClient s = new SpaceFloorService.SpaceFloorServiceClient())
                    {
                        grv.DataSource = s.GetFloorsByBuildingId(id);
                        tableView.Name = "Rooms";
                        tableView.DataMember = "Rooms";
                    }
                    break;
 
                case "SpaceFloors":
                    using (SpaceRoomService.SpaceRoomServiceClient s = new SpaceRoomService.SpaceRoomServiceClient())
                    {
                        grv.DataSource = s.GetRoomByFloorId(id);
                    }
                    break;
 
                default:
                    throw new Exception("Unable to identify Entity.");
            }
 
            grv.MasterTableView.DetailTables.Clear();
            grv.MasterTableView.DetailTables.Add(tableView);
 
            GridTableView tab = new GridTableView(grv);
            switch (tableView.Name)
            {
                case "Buildings":
                    tab.DataMember = "Floors";
                    tab.Name = "Floors";
                    tableView.DetailTables.Clear();
                    tableView.DetailTables.Add(tab);
                    break;
 
                case "Floors":
                    tab.DataMember = "Rooms";
                    tab.Name = "Rooms";
                    tableView.DetailTables.Clear();
                    tableView.DetailTables.Add(tab);
                    break;
 
                default:
                    break;
            }
 
            if (tableView.Name == "Buildings")
            {
                GridTableView subTab = new GridTableView(grv);
                if (tab.Name == "Floors")
                {
                    subTab.DataMember = "Rooms";
                    subTab.Name = "Rooms";
                    tab.DetailTables.Clear();
                    tab.DetailTables.Add(subTab);
                }
 
            }
 
            grv.DataBind();
        }
 
protected void grv_ItemCommand(object sender, GridCommandEventArgs e)
        {
            BindDetails(ParentEntity.ParentEntityId);
            HttpContext.Current.Session["id"] = ParentEntity.ParentEntityId;
            switch (Session["type"].ToString())
            {
                case "All Categories":
                    FormExtenderControl1.EntityType = new BaseEntities(BaseEntities.SpaceCategories);
                    break;
 
                case "SpaceCategories":
                    FormExtenderControl1.EntityType = new BaseEntities(BaseEntities.SpaceBuildings);
                    break;
 
                case "SpaceBuildings":
                    FormExtenderControl1.EntityType = new BaseEntities(BaseEntities.SpaceFloors);
                    break;
 
                case "SpaceFloors":
                    FormExtenderControl1.EntityType = new BaseEntities(BaseEntities.SpaceRooms);
                    break;
 
                default:
                    throw new Exception("Unable to identify Entity.");
            }
 
            clickedType = Session["type"].ToString();
 
            if (e.CommandName == "Modify")
            {
                btnSave.CommandName = "Modify";
                int id = GetID();
                FormExtenderControl1.EntityPrimaryKeyId = id;
                FormExtenderControl1.DataBind();
                mdlPopup.Show();
            }
 
            if (e.CommandName == "Delete")
            {
                int id = GetID();
                FormExtenderControl1.Delete(id);
                BindData();
            }
 
            if (e.CommandName == "Add")
            {
                btnSave.CommandName = "Add";
                FormExtenderControl1.EntityPrimaryKeyId = -1;
                FormExtenderControl1.DataBind();
                mdlPopup.Show();
            }
        }
 
        private Int32 GetID()
        {
             
            foreach (GridDataItem dataItem in grv.MasterTableView.DetailTables.OwnerGrid.Items)
            {
                 
                if (dataItem.Selected == true)
                {
                    Int32 ID = Int32.Parse(dataItem["Id"].Text);
                    return ID;
                }
            }
                        
            throw new ArgumentNullException("Id Not found");
        }
Please assist me....


thanks
Rohan
Rohan
Top achievements
Rank 1
 answered on 20 Jan 2011
2 answers
95 views
Here is the code that worked previously and is throwing an exception now.  Its purpose is to set the column header based on a datasets caption property.  I think I went from Q1 2010 to current.  I will also show some strange debug watch results.

Private Sub RadGrid_ColumnCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles RadGrid.ColumnCreated
    Dim field As String
    Try
        field = e.Column.HeaderText
        If Not field = Nothing And field <> "" Then
            If DataSet.Tables(TableName).Columns(field).ColumnName = "ID" Then
                'e.Column.Display = False ' this causes some strange formatting problems
            ElseIf DataSet.Tables(TableName).Columns(field).Caption() = _
                DataSet.Tables(TableName).Columns(field).ColumnName Then
                e.Column.Visible = False
            Else
                e.Column.HeaderText = DataSet.Tables(TableName).Columns(field).Caption()
                e.Column.HeaderStyle.Wrap = False
            End If
        End If
    Catch ex As Exception
    End Try
End Sub

The exception is being caught when trying to evaluate:DataSet.Tables(TableName).Columns(field).ColumnName

Here are the watch results on one of the passes.  The field xx_tablename is expected.  I am setting field = e.Column.HeaderText early on. 
DataSet.Tables(TableName).Columns(0).ColumnName xx_tablename String
e.Column.HeaderText xx_ tablename String
DataSet.Tables(TableName).Columns("xx_tablename").ColumnName xx_tablename String
field xx_ tablename String
DataSet.Tables(TableName).Columns(field).ColumnName Referenced object 'Item' has a value of 'Nothing'.
ex.message Object reference not set to an instance of an object. String

If I hard code variable field to "xx_tablename" in the beginning it does not error out and I get the result I want.
Kent
Top achievements
Rank 1
 answered on 20 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?