Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
144 views
I am trying to create a custom EditForm for use with the RadGrid.  When I edit or insert a record, the other records in the grid display incorrectly.  

My app:
- simple ASP.NET 4.5 web application
- OS: Windows 8.1
- IDE: VS2013.  
- Telerik version - I am a consultant and using the DLLs provided by my client, so I don't have any sort of Telerik SDK installed.  The version of Telerik.Web.UI.dll I am using is 2013.1.417.35 (17MB, dated 5/12/2014 7:50pm).
- Browser: Google Chrome Version 36.0.1985.125 m.  I also tested on IE 11 11.0.9600.17207 (Update version 11.0.10).

TestGrid.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestGrid.aspx.cs" Inherits="TestGrid" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="dataGrid">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="dataGrid" LoadingPanelID="RadAjaxLoadingPanel1"/>
                        <telerik:AjaxUpdatedControl ControlID="divMsgs" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
        <div>
            <telerik:RadGrid runat="server" ID="dataGrid" AutoGenerateColumns="False" Width="300px">
                <MasterTableView DataKeyNames="Id" CommandItemDisplay="Top" EditMode="EditForms">
                    <Columns>
                        <telerik:GridEditCommandColumn />
                        <telerik:GridBoundColumn HeaderText="Id" DataField="Id" Display="False" UniqueName="Id" />
                        <telerik:GridBoundColumn HeaderText="Name" DataField="Name" UniqueName="Name" />
                        <telerik:GridBoundColumn HeaderText="Age" DataField="Age" UniqueName="Age" />
                    </Columns>
                    <EditFormSettings EditFormType="Template">
                        <FormTemplate>
                            <table>
                                <thead>
                                    <th colspan="2">Person Info</th>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td>Name</td>
                                        <td><asp:TextBox ID="tbName" runat="server" Text='<%# Bind("Name") %>' /></td>
                                    </tr>
                                    <tr>
                                        <td>Age</td>
                                        <td><asp:TextBox ID="tbAge" runat="server" Text='<%# Bind("Age") %>' /></td>
                                    </tr>
                                    <tr>
                                        <td align="right" colspan="2">
                                            <asp:Button ID="btnUpdate" runat="server" 
                                                Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                                CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' />
                                            &nbsp;
                                            <asp:Button ID="btnCancel" runat="server" 
                                                Text="Cancel" CausesValidation="False" CommandName="Cancel" />
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </FormTemplate>
                    </EditFormSettings>
                </MasterTableView>
            </telerik:RadGrid>
        </div>
    </form>
</body>
</html>

TestGrid.aspx.cs:

using System;
using System.Collections;
using System.Diagnostics;
using Telerik.Web.UI;

public partial class TestGrid : System.Web.UI.Page {
    protected void Page_Load(object sender, EventArgs e) {
        dataGrid.NeedDataSource += dataGrid_NeedDataSource;
        dataGrid.InsertCommand += dataGrid_InsertCommand;
        dataGrid.UpdateCommand += dataGrid_UpdateCommand;
    }

    void dataGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) {
        dataGrid.DataSource = People;
    }

    public People People {
        get {
            var obj = this.ViewState["_people"];
            if (obj != null) return (People)obj;
            var people = People.AllPeople;
            this.ViewState["_people"] = people;
            return people;
        }
    } 

    void dataGrid_UpdateCommand(object sender, GridCommandEventArgs e) {
        var values = new Hashtable();
        e.Item.OwnerTableView.ExtractValuesFromItem(values, e.Item as GridEditableItem);
        foreach (DictionaryEntry de in values) Debug.WriteLine("{0}={1}", de.Key, de.Value);
        People.UpdatePerson(values);
        this.ViewState["_people"] = People;
    }

    void dataGrid_InsertCommand(object sender, GridCommandEventArgs e) {
        var values = new Hashtable();
        e.Item.OwnerTableView.ExtractValuesFromItem(values, e.Item as GridEditableItem);
        People.AddPerson(values);
        this.ViewState["_people"] = People;
        
    }
}

App_Code\Person.cs:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

[Serializable]
public class Person {
    static int _nextId;

    private int m_id;

    public int Id {
        get { return m_id; }
        set { 
            m_id = value;
            _nextId = Math.Max(m_id + 1, _nextId);
        }
    }

    public string Name { get; set; }
    public int Age { get; set; }
    public Person(int id, string name, int age) {
        Id = id;
        Name = name;
        Age = age;
    }
    public Person() {}
    public void AssignId() {
        Id = _nextId;
    }

    public override string ToString() {
        return string.Format("#{0}: {1} [{2}]", Id, Name, Age);
    }

    public void Update(Hashtable values) {
        Name = (string)values["Name"];
        Age = int.Parse((string)values["Age"]);
    }
}

[Serializable]
public class People : List<Person> {
    public People() {
        Add(new Person(1, "David", 43));
        Add(new Person(2, "Rebecca", 40));
    }
    public void UpdatePerson(Hashtable values) {
        var person = this.FirstOrDefault(p => p.Id == int.Parse((string)values["Id"]));
        if (person == null) throw new NullReferenceException("Person not found (" + values["Id"] + ")");
        person.Update(values);
    }
    public void AddPerson(Hashtable values) {
        var person = new Person();
        person.AssignId();
        person.Update(values);
        Add(person);
    }

    static People s_people;
    public static People AllPeople { get { return s_people ?? (s_people = new People()); } }
}

I have attached three files:
- Pic1.png: Viewing the data (works fine)
- Pic2.png: Edit the "David" record
- Pic3.png: Insert a new record

I tried viewing source after clicking Insert, but it appears that source in that case is simply the source I see when I view the data.  The custom edit form controls don't appear in that source. 

Note that this is the same behavior as in this post:

http://www.telerik.com/forums/problem-editform-template--edit-and-new-record 
David
Top achievements
Rank 1
 answered on 31 Jul 2014
5 answers
153 views
Hi there,

I am wondering if there is any support for a floating column chart.  I tried to make my own by creating a Series with a white background, however, the column itself has a gray border.

John
Danail Vasilev
Telerik team
 answered on 31 Jul 2014
2 answers
141 views
Hello all first time poster here, I have a bit of a problem with a RadGrid GridTemplateColumn and a dropdownlist is saving back a blank string. Here is the code I am using. I don't know how much you need so I will post the minimum.
<telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" runat="server" OnUpdateCommand="RadGrid1_UpdateCommand"
        ShowStatusBar="true" AutoGenerateColumns="False" AllowSorting="True" AllowMultiRowSelection="False"
        AllowPaging="False" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
        AllowAutomaticUpdates="True" OnItemUpdated="RadGrid1_ItemUpdated" OnItemDeleted="RadGrid1_ItemDeleted"
        OnItemInserted="RadGrid1_ItemInserted" OnInsertCommand="RadGrid1_InsertCommand" OnItemDataBound="RadGrid1_ItemDataBound"
        OnItemCreated="RadGrid1_ItemCreated" Width="950">
        <MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="ID" AllowMultiColumnSorting="True"
            Width="100%" CommandItemDisplay="Top" Name="Questions">
            <DetailTables>
                <telerik:GridTableView DataKeyNames="ID" DataSourceID="SqlDataSource2" Width="100%"
                    runat="server" CommandItemDisplay="Top" Name="Answers">
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="QuestionID" MasterKeyField="ID"></telerik:GridRelationFields>
                    </ParentTableRelation>
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1">
                            <HeaderStyle Width="20px"></HeaderStyle>
                            <ItemStyle CssClass="MyImageButton"></ItemStyle>
                        </telerik:GridEditCommandColumn>
                        <telerik:GridBoundColumn SortExpression="QuestionID" HeaderText="Question" HeaderButtonType="TextButton"
                            DataField="QuestionID" UniqueName="QuestionID" ReadOnly="true">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="AnswerText" HeaderText="Answer Text" HeaderButtonType="TextButton"
                            DataField="AnswerText" UniqueName="AnswerText">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="PanelAmount" HeaderText="Panel Amount" HeaderButtonType="TextButton"
                            DataField="PanelAmount" UniqueName="PanelAmount">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn  SortExpression="IsEnd" HeaderText="Is End"
                            HeaderButtonType="TextButton" DataField="IsEnd" UniqueName="IsEnd">
                            <ItemTemplate>
                                <asp:Label ID="LabelIsEnd" runat="server"><%# DataBinder.Eval(Container.DataItem, "IsEnd")%></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:CheckBox ID="CheckBoxIsEnd" runat="server" Checked='<%#Eval("IsEnd") %>' />
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn SortExpression="JumpToQuestion" HeaderText="Jump To Question"
                            HeaderButtonType="TextButton" DataField="JumpToQuestion" UniqueName="JumpToQuestion">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn  SortExpression="StartSurvey" HeaderText="Start Survey"
                            HeaderButtonType="TextButton" DataField="StartSurvey" UniqueName="StartSurvey">
                            <ItemTemplate>
                                <asp:Label ID="LabelStartSurvey" runat="server"><%# DataBinder.Eval(Container.DataItem, "StartSurvey")%></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:CheckBox ID="CheckBoxStartSurvey" runat="server" Checked='<%#Eval("StartSurvey") %>' />
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumnAnswer">
                        </telerik:GridButtonColumn>
                    </Columns>
                </telerik:GridTableView>
            </DetailTables>
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1">
                    <HeaderStyle Width="20px"></HeaderStyle>
                    <ItemStyle CssClass="MyImageButton"></ItemStyle>
                </telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn SortExpression="ID" HeaderText="ID" HeaderButtonType="TextButton"
                    DataField="ID" UniqueName="ID" ReadOnly="true">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn SortExpression="QuestionText" HeaderText="Question Text"
                    HeaderButtonType="TextButton" DataField="QuestionText" UniqueName="QuestionText">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn  SortExpression="QuestionType" HeaderText="Question Type"
                    HeaderButtonType="TextButton" DataField="QuestionType" UniqueName="QuestionType">
                    <ItemTemplate>
                        <asp:Label ID="LabelQuestionType" runat="server"><%# DataBinder.Eval(Container.DataItem, "QuestionType")%></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:DropDownList ID="DropDownListQUestionType" runat="server"></asp:DropDownList>
                        <%--<asp:DropDownList ID="DropDownListQUestionType" runat="server" SelectedValue='<%#Eval("QuestionType") %>'></asp:DropDownList>--%>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn SortExpression="QuestionPosition" HeaderText="Question Position"
                    HeaderButtonType="TextButton" DataField="QuestionPosition" UniqueName="QuestionPosition">
                </telerik:GridBoundColumn>
                <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumnQuestion">
                </telerik:GridButtonColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Local_TypingTool_NewConnectionString %>"
        UpdateCommand="UPDATE [Screener_Questions] SET [QuestionText] = @QuestionText, [QuestionType] = @QuestionType, [QuestionPosition] = @QuestionPosition WHERE [ID] = @ID"
        SelectCommand="SELECT [ID], [QuestionText], [QuestionType], [QuestionPosition] FROM Screener_Questions WHERE [Survey_ID] = @Survey_ID"
        InsertCommand="INSERT INTO [Screener_Questions] ([Survey_ID], [QuestionText], [QuestionType], [QuestionPosition]) VALUES (@Survey_ID, @QuestionText, @QuestionType, @QuestionPosition)"
        DeleteCommand="DELETE FROM [Screener_Questions] WHERE [ID] = @ID">
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Survey_ID" Type="Int32" />
            <asp:Parameter Name="QuestionText" Type="String" />
            <asp:Parameter Name="QuestionType" Type="Int32" />
            <asp:Parameter Name="QuestionPosition" Type="Int32" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="ID" Type="Int32" />
            <asp:Parameter Name="QuestionText" Type="String" />
            <asp:Parameter Name="QuestionType" Type="Int32" />
            <asp:Parameter Name="QuestionPosition" Type="Int32" />
        </UpdateParameters>
        <SelectParameters>
            <asp:Parameter Name="Survey_ID" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>

protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            GridEditableItem editedItem = e.Item as GridEditableItem;
            DropDownList list = editedItem.FindControl("DropDownListQUestionType") as DropDownList;
            Session["updatedValueQUestionType"] = list.SelectedValue;
        }

When I run the code I see the dropdownlist and it has data and it shows the correct drop down value when displayed.
On the RadGrid1_UpdateCommand it does see the value to hold it in the session but for some reason it actauly saves it back as a blank string.

Princy
Top achievements
Rank 2
 answered on 31 Jul 2014
1 answer
136 views
Hi

I am using radasyncupload to add avatars to my website profile and there is a radimageeditor in the same page. I want to upload a file directly and open it directly in the image editor for cropping. Any solution?

Thankyou
Shinu
Top achievements
Rank 2
 answered on 31 Jul 2014
3 answers
600 views
Hi,

I was hoping to keep any ticked check boxes ticked when my radgrid rebinds. I found this tutorial: http://www.telerik.com/help/aspnet-ajax/grid-selecting-row-with-checkbox-server-side.html however my "onCheckedItem" events never fire, instead my "needDataSource" event is fired and that is the end of it (I verified this using debug mode and checkpoints). I'm assuming this is because I'm using advanced data binding unlike in the tutorial. I need to keep advanced data binding for features such as grid export. Also it's important the checkboxes are server side because I want to be able to build functions in c# which rely on what tick boxes are selected. Below is the code for my radgrid 

Let me know if you need any more code. Thanks in advance

[code]
​<telerik:RadGrid ID="batchGrid" runat="server"
AllowFilteringByColumn="True" AllowSorting="True"
CellSpacing="0" GridLines="None" OnNeedDataSource="batchGrid_NeedDataSource"
EnableViewState="False" AutoGenerateColumns="True" OnColumnCreated="batchGrid_ColumnCreated"
OnExportCellFormatting="batchGrid_ExportCellFormatting"><ExportSettings ExportOnlyData="true" HideStructureColumns="true" >
<Excel Format="Html"/>
 </ExportSettings> <ClientSettings AllowColumnsReorder="True" EnablePostBackOnRowClick="false" >
 <Selecting AllowRowSelect="false"/>
 <Resizing AllowResizeToFit="true" />
 </ClientSettings> <MasterTableView NoMasterRecordsText="No batch found containing this part, with the current filters">
<Columns>
 <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" AllowFiltering="false" Reorderable="false" >
 <ItemTemplate>
 <asp:CheckBox ID="MyCheckBox" runat="server" OnCheckedChanged="ToggleRowSelection" AutoPostBack="true" />
 </ItemTemplate>
 <HeaderTemplate>
 <asp:CheckBox ID="headerChkbox" runat="server" OnCheckedChanged="ToggleSelectedState" AutoPostBack="true" />
 </HeaderTemplate>
 </telerik:GridTemplateColumn>
 </Columns>
 <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
 <HeaderStyle Width="20px" />
 </RowIndicatorColumn>
 <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
 <HeaderStyle Width="20px" />
 </ExpandCollapseColumn>
 <EditFormSettings>
 <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
 </EditFormSettings>
 </MasterTableView> <FilterMenu EnableImageSprites="False" ></FilterMenu>
</telerik:RadGrid>
[/code]
Princy
Top achievements
Rank 2
 answered on 31 Jul 2014
3 answers
124 views
I created a radgrid bound to a webservice (by using ClientSettings/DataBinding). and found that I could not get the grid to go into edit mode at all. I wanted to have a grid with an edit button column, and simply click the button to popup an autogenerated edit form for that grid row, but it doesn't even attempt to open the popup or go into edit mode.

I tried a simple project where I set up a radgrid bound using another method (needdatasource) and set up the editing how I wanted it, and it all worked. But when I add markup for databinding the edit mode completely stops working.

Am I trying to achieve something impossible?
Konstantin Dikov
Telerik team
 answered on 31 Jul 2014
1 answer
493 views
Hi,
        I have a scenario in which I need to upload some files which are in Session variable to RadAsyncUpload. Please help me with a code I used this but it shows casting error.
aspx:

<telerik:RadAsyncUpload ID="FileUploadTest" MultipleFileSelection="Automatic" OnClientFileUploading="onClientFileUploading" PostBackTrigger="btnSubmitChennai"  
                    OnClientValidationFailed="OnClientValidationFailed" AllowedFileExtensions=".pdf,.doc,.docx,.xls,.xlsx,.csv,.txt,.rtf,.mp3,.wma,.mpg,.flv,.avi,.jpg,.jpeg,.png,.gif,.tiff,.xps,.zip"
                    AllowedMimeTypes="application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, text/csv, text/plain, application/rtf, audio/mpeg3, audio/x-mpeg-3, video/mpeg, video/x-mpeg, audio/x-ms-wma, audio/mpeg, video/mpeg,video/x-flv, video/x-msvideo, image/jpeg, image/png, image/gif, image/tiff, application/vnd.ms-xpsdocument,application/zip, application/x-compressed, application/x-zip-compressed"
                    runat="server">
                </telerik:RadAsyncUpload>

aspx.cs

FileUploadTest= (UploadedFile)Session["FileUpload1"];

I used this also

FileUploadTest= (RadAsyncUpload)Session["FileUpload1"];
Plamen
Telerik team
 answered on 31 Jul 2014
1 answer
100 views
this is my code , i want to this from design side not code behind

<telerik:RadGrid ID="RadGridEmployeeCost" runat="server" AllowSorting="True" AllowPaging="true"
    AllowFilteringByColumn="true" CellSpacing="0" GridLines="None" HeaderStyle-Font-Bold="true"
    Skin="Web20" OnNeedDataSource="RadGridEmployeeCost_NeedDataSource" ShowGroupPanel="true"
    OnColumnCreated="RadGridEmployeeCost_ColumnCreated">
    <ClientSettings AllowDragToGroup="True" />
</telerik:RadGrid>
protected void RadGridEmployeeCost_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
       {
               ObjCon.Open();
               SqlCommand ObjCmd = new SqlCommand("SELECT name,address,TelPhone,EmailId,Qualification FROM WorkSummary", ObjCon);
               ObjCmd.ExecuteNonQuery();
               SqlDataAdapter ObjDa = new SqlDataAdapter(ObjCmd);
               DataSet ds = new DataSet();
               ObjDa.Fill(ds);
               RadGridEmployeeCost.DataSource = ds;
           }
       }
  
protected void RadGridEmployeeCost_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
       {
           if ((e.Column is GridBoundColumn && e.Column.UniqueName == "TelPhone" || e.Column.UniqueName == "EmailId" || e.Column.UniqueName == "Qualification"))
           {
               GridBoundColumn column = e.Column as GridBoundColumn;
               column.AllowFiltering = false;
           }
       }
share the code to do this
thanks
Shinu
Top achievements
Rank 2
 answered on 31 Jul 2014
4 answers
253 views
I am creating a RadGrid programmatically in VB.Net and have set the AllowFilteringByColumn  = True and setup a CommandItemTemplate that contains a RadButton.

You can see the rendered grid in the attached Grid.png and the error I am getting in the Telerik.Web.UI.WebResource.axd. It looks like a problem with creating multiple filter items. Error description - "description "Sys.WebForms.PageRequestManagerServerErrorException: Multiple controls with the same ID 'FilterTextBox_CustomerNum' were found. FindControl requires that controls have unique IDs."" 

CustomerNum is the first column in the grid

Building the grid
Private Sub SetFilters(ByVal grid As RadGrid)
 
    grid.MasterTableView.AllowFilteringByColumn = gridConfiguration.EnableHeaderFiltering
    If gridConfiguration.EnableHeaderFiltering Then
        grid.MasterTableView.CommandItemTemplate = New RadGridCommandItemFilterTemplate
    End If
 
End Sub

CommandItemTemplate 
Friend Class RadGridCommandItemFilterTemplate
    Implements ITemplate
 
    Public showHideFilter As RadButton
 
    Public Sub New()
        MyBase.New()
    End Sub
 
    Public Sub InstantiateIn(ByVal container As Control) Implements ITemplate.InstantiateIn
 
        showHideFilter = New RadButton With {.ID = "showHideFilter", .Text = "Show / Hide Filters",
                                             .CommandName = "ShowHideFilters", .OnClientCheckedChanged = "showHideFilters()"}
        container.Controls.Add(showHideFilter)
 
    End Sub
 
End Class

Aspx

    <telerik:RadScriptManager ID="ScriptManager" runat="server">
    </telerik:RadScriptManager>
 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ConfigureGrid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ConfigureGrid" LoadingPanelID="AjaxLoadingPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
    <telerik:RadGrid runat="server" ID ="ConfigureGrid" GridLines="None" AutoGenerateColumns="false" Skin="WebBlue"/>
 
    <telerik:RadAjaxLoadingPanel ID="AjaxLoadingPanel" runat="server"/>
 
    <asp:SqlDataSource ID="PrimaryDataSource" runat="server"/>
</form>
 
<script type="text/javascript">
 
    function showFilterItem() {
        var grid = $find("<%=ConfigureGrid.ClientID%>");
        if (grid) {
            grid.get_masterTableView().showFilterItem();
        }
    }
 
    function hideFilterItem() {
        var grid = $find("<%=ConfigureGrid.ClientID%>");
        if (grid) {
            grid.get_masterTableView().hideFilterItem();
        }
    }
 
    function showHideFilters() {
        var radButton = document.getElementById("showHideFilter");
        if (radButton) {
            if (radButton.checked) {
                showFilterItem();
            }
            else {
                hideFilterItem();
            }
        }
    }
</script>



Princy
Top achievements
Rank 2
 answered on 31 Jul 2014
1 answer
114 views
I'm counting number of appearing of a datafield by:
<telerik:PivotGridAggregateField DataField="StatusText" Aggregate="Count" Caption="Counts" UniqueName="Counts" IsHidden="false">
</telerik:PivotGridAggregateField>

The problem appears when I run the pivotgrid, there's a field of (blank) keeps on coming up with a value of "1" unexpectedly. I can see one common point for all (blank) data, they seem to happen to any columns that has no data in it. For Instance, in January 1st. I have no data for that day and the grid gives a value "1" with statustext = (blank) as a substitution. 

What property can I set to stop this? Below is my RadPivotGrid Settings. Thanks.
<telerik:RadPivotGrid ID="RadPivotGrid_DataView" runat="server" ConfigurationPanelSettings-DefaultDeferedLayoutUpdate="false" Height="100%" AggregatesPosition="Rows" AllowSorting="True" OnItemCommand="RadPivotGrid_DataView_ItemCommand" OnCellCreated="RadPivotGrid_DataView_CellCreated" DataSourceID="Sql_Contract_Details" EnableToolTips="True" EnableZoneContextMenu="True" EnableConfigurationPanel="True" OnFieldCreated="RadPivotGrid_DataView_FieldCreated" Skin="Metro" OnCellDataBound="RadPivotGrid_DataView_CellDataBound" Culture="en-GB" OnItemNeedCalculation="RadPivotGrid_DataView_ItemNeedCalculation" AllowPaging="True" PageSize="30">
                       <PagerStyle ChangePageSizeButtonToolTip="Change Page Size" PageSizeControlType="RadComboBox" AlwaysVisible="True" />
                       <Fields>...</Fields>
                       <ClientSettings EnableFieldsDragDrop="True">
                           <Scrolling AllowVerticalScroll="True"></Scrolling>
                       </ClientSettings>
                       <ConfigurationPanelSettings EnableOlapTreeViewLoadOnDemand="True" DefaultDeferedLayoutUpdate="True" LayoutType="OneByFour"></ConfigurationPanelSettings>
                   </telerik:RadPivotGrid>
Pavlina
Telerik team
 answered on 31 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
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?