Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
128 views
I have a customer request. After entering all the information for a new appointment in the advanced form of the scheduler, is it possible to save the appointment, but not closing the advanced form? In stead the customer wants to clear the form and continue entering a new appointment. 

The customer wants to add numerous appointments, so it would ease the job if he doesn't need to close the form and open it again for every appointment.

I picture having three buttons, - "Save and close", "Save and create new" and "Cancel".

Is this possible?

Regards, Jill-Connie Lorentsen
Plamen
Telerik team
 answered on 22 Apr 2013
1 answer
140 views
I am trying to create a Data Grid in a web part which will be loaded dynamically with user activity feeds.
Users are calculated according to the input provided by the user.
I am using email address as the input so at one time you can display one users events and again change the email address click the button that displays another user's email address.

I have written the code but i am not getting desired out put.
Any assistance please. I am having problem with the needdatasource.

the problem here is i dont see the data table it says null reference to the object at / application.
my datasource is null at first time this page loads because i have not calcualated that. once the page loads then i get the input which will calculate the data source.
other time if i change the email address i get the user changed but again the datasource is not changed and i dont see new data table with new data or if there is no data i should see no records.
any help will be very much appreciated please..............

Here is my code
public partial class CustomFeedUserControl : UserControl
 
    {
 
        private const string ActivityName = "ActivityName";
 
        private const string SiteName = "SiteName";
 
        private const string Date = "Date";
 
        private const string ActivitySummary = "ActivitySummary";
 
        private DataTable sitedetailstable;
 
        private ActivityManager activityManager;
 
        private ActivityEventsCollection activityEvents;
 
        private Boolean error = false;
 
        private string errorText = "";
 
        SyndicationItem syndicationItem;
 
        List<String> categories = new List<string>();
 
        SPWebApplication webapp = SPContext.Current.Site.WebApplication;
 
  
 
  
 
        private String Email = "";
 
  
 
  
 
        protected void Page_Load(object sender, EventArgs e)
 
        {
            //if (!Page.IsPostBack) Nothing here as i am creating the grid ondemand
            //{
            //    LoadData();
            //    RadGridSiteDetails.Visible = false;
            //}        
 
        }
 
  
 
        void LoadData()
 
        {
            RadGridSiteDetails.DataSource = Sitedetailstable.DefaultView;
        }
 
  
 
        public void LoadDatasource(String userloginname)
 
        {
            string siteUrl = SPContext.Current.Site.Url;
 
            SPSecurity.RunWithElevatedPrivileges(delegate
 
            {
                using (SPSite site = new SPSite(siteUrl))
                {
                    try
                    {
                        SPServiceContext context = SPServiceContext.GetContext(site);
                        UserProfileManager userProfileManager = new UserProfileManager(context);
                        UserProfile profile = userProfileManager.GetUserProfile(userloginname);
                        if (profile != null)
                        {
                            test.Text = profile.DisplayName;
                            this.activityManager = new ActivityManager(profile);
                            this.activityEvents = this.activityManager.GetActivitiesByUser(profile);
                           }
                    }
 
                    catch (UserNotFoundException ex)
 
                    {
                        this.error = true;
                        this.errorText = ex.Message;
                   }
 
                    catch (NullReferenceException ex)
                    {
                        this.error = true;
                        this.errorText = ex.Message;
                    }
 
                }
 
            });
        }
 
  
 
 
 
        private DataTable ReturnUserDatadetails( )
 
        {
            sitedetailstable = new DataTable();
            string sitetitle = null;
            string summary;
            sitedetailstable.Columns.Add(ActivityName, System.Type.GetType("System.String"));
            sitedetailstable.Columns.Add(SiteName, System.Type.GetType("System.String"));
            sitedetailstable.Columns.Add(Date, System.Type.GetType("System.String"));
            sitedetailstable.Columns.Add(ActivitySummary, System.Type.GetType("System.String"));
            if (this.activityEvents.Count > 0)
 
            {
                foreach (ActivityEvent activityEvent in this.activityEvents)
                {
      syndicationItem = activityEvent.CreateSyndicationItem(this.activityManager.ActivityTypes, ContentType.Html);
                 Sitetitle = syndicationItem.Summary.Text.ToString();
                    summary = Regex.Replace(syndicationItem.Summary.Text;
                    if ((Sitetitle != null) && (Sitetitle != ""))
                    {
                        DataRow newrow = Sitedetailstable.NewRow();
                        newrow[ActivityName] = activityEvent.Name;
                        newrow[SiteName] = Sitetitle;
                        newrow[Date] = activityEvent.PublishDate.HasValue ?
                         activityEvent.PublishDate.Value.ToLocalTime().ToString("dd MMM yyyy hh:mm tt") :
                          string.Empty;
                        newrow[ActivitySummary] = summary.Substring(summary.IndexOf(":") + 1);
                        categories.Add(activityEvent.Name.ToString());
                        Sitedetailstable.Rows.Add(newrow);
                    }
 
                }
 
  
 
            }
                return Sitedetailstable;
 
        }
 
  
 
        protected void RadGridSiteDetails_SortCommand(object sender, Telerik.Web.UI.GridSortCommandEventArgs e)
 
        {
 
            LoadData();
        }
 
  
 // this is the button event that gets clicked from the user to generate reporty
        protected void UserReport_Click(object sender, EventArgs e)
 
        {
            Email = UserEmailInput.Text;
            SPPrincipalInfo user = SPUtility.ResolvePrincipal(webapp, null, Email, SPPrincipalType.User, SPPrincipalSource.All, true);
            if (user != null)
            {
                LoadDatasource(user.LoginName);
                LoadData();
               RadGridSiteDetails.Visible = true;
 
            }
 
  
 
            else
 
            {
 
                test.Text = "No user Found with that Email Address";
 
            }
 
  
 
        }
 
  
 
        protected void RadGridSiteDetails_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
 
        {
 
            LoadData();
 
        }
 
  
 
  
 
  
 
  
 
  
 
  
 
  
 
  
 
    }
Iris
Top achievements
Rank 1
 answered on 22 Apr 2013
3 answers
925 views
I know that this question has been asked multiple times, and i have searched the forum but it's still not working for me.

Here's the background:
On my page, I have a grid and a combobox. The grid uses datatable that is created dynamically when the the user selects some value from the combo box. Initially, when the page loads, only the combobox is visible and the grid is not visible. When the user selects a group name from the combobox, RadComboBox's SelectedIndexChanged is fired and it will populate the DataTable (this datatable is initially null) based on the selected group name (I also save the selected group name in a variable on the page). This will then call Rebind() method to rebind the grid using the table, and consequently fired the NeedDataSource event. At this point, the grid is properly populated. However if I clicked the Edit button or try to filter the columns, the grid will disappear. When I try to debug this, I found that when the edit button is clicked, the DataTable is now null, hence the reason why the grid is not displayed due to the null datasource. Even the variable that holds the selected group name is also reset.

I'm stuck here. Can anyone tell me how to get around this? Why were the datatable and the variable reset even though the page is not reloaded? Is there a way to stop the program from resetting the datatable and the variables?

 Please help.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;
  
namespace Project1
{
    public partial class frmUserGroupPrivillage : System.Web.UI.Page
    {
        private DataTable table;
        private bool displayNullDataSourceErrorMessage = false;  // enable error message to
             // be hidden the first time the page is loaded
        private string groupID, groupName;
        protected void Page_Load(object sender, EventArgs e)
        {
                // reset error and status messages' visibility
                errorMessage.Visible = false;
                statusMessage.Visible = false;
  
                //get module authorization for the logged in user
                Authorization a = new Authorization();
  
                bool[] authorization = a.GetModuleAuthorization(userID, "UserGroupPrivilege");
  
                if (authorization != null)
                {
                    // is the user is allowed to view this page?
                    if (authorization[0])
                    {
                        //the user is allowed to view this page
                        DisplayUserContent(authorization);
                    }
                    else
                    {
                        // the user is not allowed to view this page.
                          //Hence redirect user to main page
                        Response.Redirect("Default.aspx");
                    }
                }
                else
                {
                    //unable to get authorization information
                    errorMessage.Text = a.authorizationErrorMessage;
                    errorMessage.Visible = true;
                }
        }
  
        //Post: display or not display add, edit and delete buttons based on user's
          // privilege level
        private void DisplayUserContent(bool[] authorization)
        {
            // should update button inside edit form to be be displayed?
            if (authorization[2])
            {
                GridColumn editColumn = RadGrid1.Columns.FindByUniqueName("EditCommandColumn");
                editColumn.Visible = true;
             }
        }
  
        protected void RadComboBox1_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {
            displayNullDataSourceErrorMessage = true;
            errorMessage.Visible = false;
            groupID = e.Value.Trim();
            groupName =  e.Text.Trim();
  
            // rebind the grid if and only if the table is successfully populated
            if (PopulateTable(groupID, groupName))
            {
                RadGrid1.Rebind();
                  
                // make the grid visible not that it has data to display
                RadGrid1.Visible = true;
            }
        }
         
        // pre: invoked by radgrid1 when when it found that there is no data source during data binding
        // post: returns the datasource for the grid
        protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            if (table != null)
            {
                RadGrid1.DataSource = table;
            }
            else
            {
                // do not display the error message when the user first viewed the module
                if (displayNullDataSourceErrorMessage)
                {
                    // the data table is null
                    errorMessage.Text = "Error. Unable to get grid data source from DataTable. The User Group Privilege cannot be displayed";
                    errorMessage.Visible = true;
                    errorMessage.Focus();
                }
            }
        }
      
        // pre: info: asuthorization information from database.
        //      accessType: 1 to indicate view, 2 to indicate add, 3 to indicate edit, 4 to indicate delete
        // post: returns the boolen status for the view, add, edit, OR delete privilege
        private bool GetBoolStatus(string info, int accessType)
        {
            bool status = false;      
            char[] c = info.ToCharArray();
            switch (accessType)
            {
                case 1:
                    {
                        // caller method wants to know the View status
                        status = (c[0] == '1');
                        break;
                    }
                case 2:
                    {
                        // caller method wants to know the View status
                        status = (c[2] == '1');
                        break;
                    }
                case 3:
                    {
                        // caller method wants to know the View status
                        status = (c[4] == '1');
                        break;
                    }
                case 4:
                    {
                        // caller method wants to know the View status
                        status = (c[6] == '1');
                        break;
                    }
                default:
                    {
                        //should not get here
                        break;
                    }
            }
            return status;
        }
  
        protected void RadGrid1_EditCommand(object sender, GridCommandEventArgs e)
        {
            bool b = PopulateTable(groupID, groupName);
        }
  
        // post : return true if the table is successfully populated
        private bool PopulateTable(string userGroupID, string userGroupName)
        {
            string query = "SELECT RTRIM(user_group_id) AS user_group_id, RTRIM(user_group) AS user_group "
                                        + "WHERE user_group_id = '" + userGroupID + "'";
  
            int recordCount = 0;
  
            db db = new db();
            if (db.Load())
            {
                // query record corresponding to the selected userID ONLY
                if (db.QuerySQL(query, ref recordCount) && recordCount == 1)
                {
                    // create a new data table
                    table = new DataTable();
  
                    // declare columns for table
                    table.Columns.Add("Module Name", typeof(string));
                    table.Columns.Add("View", typeof(bool));
                    table.Columns.Add("Add", typeof(bool));
                    table.Columns.Add("Edit", typeof(bool));
                    table.Columns.Add("Delete", typeof(bool));
  
                    // get the number of columns in "records" table
                    int tableColumnsCount = db.SqlDataSet.Tables["records"].Columns.Count;
  
                    //get the selected group's privilege information
                    DataRow tempRow = db.SqlDataSet.Tables["records"].Rows[0];
  
                    // add records to the table by iterating the tempRow
                    DataColumn tempColumn;
                    for (int i = 0; i < tableColumnsCount; i++)
                    {
                        //get the column in at position i inside table
                        tempColumn = db.SqlDataSet.Tables["records"].Columns[i];
  
                        // get the COLUMN NAME for tempColumn DEBUG
                        string moduleInfo = tempColumn.ColumnName.Trim();
  
                        switch (moduleInfo)
                        {
                            case "user_group":
                                {
                                    // do nothing
                                    break;
                                }
                            case "user_group_id":
                                {
                                    // do nothing
                                    break;
                                }
                            default:
                                {
                                    // variables to hold the privilage information in bool type
                                    bool viewStatus = false;            //dummy default value because the compiler refused to compile
                                    bool addStatus = false;             //dummy default value because the compiler refused to compile
                                    bool editStatus = false;            //dummy default value because the compiler refused to compile
                                    bool deleteStatus = false;          //dummy default value because the compiler refused to compile
  
                                    // switch based on the COLUMN NAME for the columns with 0 is set to indicate true
                                    if (moduleInfo.Equals("reconcile") || moduleInfo.Equals("report") || moduleInfo.Equals("admin")))
                                    {
                                        // get the value in tempRow at column position i. Set status to true if the value is "0"
                                        viewStatus = "0".Equals(tempRow[tempColumn].ToString().Trim());
                                    }
  
                                    // switch based on the COLUMN NAME for the columns with 1 is set to indicate true
                                    if (moduleInfo.Equals("SpeedKey") || moduleInfo.Equals("WebReports"))
                                    {
                                        // get the value in the cell at tempRow and tempColumn. Set status to true if the value is "1"
                                        string info = tempRow[tempColumn].ToString().Trim();
                                        viewStatus = GetBoolStatus(info, 1);
                                        addStatus = GetBoolStatus(info, 2);
                                        editStatus = GetBoolStatus(info, 3);
                                        deleteStatus = GetBoolStatus(info, 4);
                                    }
  
                                    //add a new row to table
                                    table.Rows.Add(moduleInfo, viewStatus, addStatus, editStatus, deleteStatus);
                                    break;
                                }
                        }
                    }
                    return true;
                }
                else
                {
                    //either the connection cannot be opened or there is more than one record returned
                    if (recordCount == 1 || recordCount == 0)
                    {
                        //connection could not be opened
                        errorMessage.Text = db.LastError;
                        errorMessage.Visible = true;
                        errorMessage.Focus();
                    }
                    else
                    {
                        // there is more than one record returned
                        errorMessage.Text = "Error. There is more than one privilege information for UserGroup " + userGroupName + ". "
                                                + "Please ensure that there is only one privilege information per user group.";
                        errorMessage.Visible = true;
                        errorMessage.Focus();
                    }
                }
                return false;
            }
            else
            {
                // cannot load db
                errorMessage.Text = db.LastError;
                errorMessage.Visible = true;
                errorMessage.Focus();
                return false;
            }
        }
    }
}




<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="frmUserGroupPrivilege.aspx.cs" Inherits="Project1.frmUserGroupPrivillage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 98%;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Title" runat="server">
    User Group Privilege Management
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadComboBox1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="errorMessage" />
                    <telerik:AjaxUpdatedControl ControlID="RadComboBox1" />
                    <telerik:AjaxUpdatedControl ControlID="statusMessage" />
                    <telerik:AjaxUpdatedControl ControlID="Label1" />
                    <telerik:AjaxUpdatedControl ControlID="Label2" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="errorMessage" />
                    <telerik:AjaxUpdatedControl ControlID="statusMessage" />
                    <telerik:AjaxUpdatedControl ControlID="Label1" />
                    <telerik:AjaxUpdatedControl ControlID="Label2" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
<br />
 
    <table align="center" class="style1">
        <tr>
            <td>
            <asp:Label ID="errorMessage" runat="server" Text="Error Message" Visible="False"
                    CssClass="frmElement_ErrorText"></asp:Label>
                 <br />
                To begin, please select a user group from the combo box below:<br />
                 <br />
 
                 <telerik:RadComboBox ID="RadComboBox1" Runat="server"
                    EmptyMessage="Select User Group to be viewed" Skin="Vista"
                    DataSourceID="GroupNameDataSource" DataTextField="user_group"
                    DataValueField="user_group_id"
                    onselectedindexchanged="RadComboBox1_SelectedIndexChanged"
                    AutoPostBack="True" Width="250px">
                </telerik:RadComboBox>
 
<br />
                 <br />
                <telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" GridLines="None"
                    Skin="Vista" onneeddatasource="RadGrid1_NeedDataSource"
                    AutoGenerateEditColumn="True" oneditcommand="RadGrid1_EditCommand"
                    Visible="False">
<MasterTableView AllowFilteringByColumn="True" AllowSorting="True"
                        AutoGenerateColumns="True" AllowPaging="True" EditMode="InPlace">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
 
    <Columns>
        <telerik:GridEditCommandColumn ButtonType="ImageButton"
            CancelImageUrl="Images/Cancel.gif" EditImageUrl="Images/Edit.gif"
            FilterControlAltText="Filter EditCommandColumn column"
            InsertImageUrl="Images/Update.gif" UpdateImageUrl="Images/Update.gif"
            Visible="False">
            <ItemStyle HorizontalAlign="Center" Width="30px" />
        </telerik:GridEditCommandColumn>
    </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"
        UniqueName="EditCommandColumn1"></EditColumn>
</EditFormSettings>
</MasterTableView>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
                </telerik:RadGrid>
                                    <br />
 
    <asp:Label ID="statusMessage" runat="server" ForeColor="#006600" Text="StatusMessage"
        Visible="False"></asp:Label>
                <br />
 
    <asp:Label ID="Label1" runat="server" Text="Label1"></asp:Label>
 
                <br />
                <asp:Label ID="Label2" runat="server" Text="Label2"></asp:Label>
 
            </td>
        </tr>
    </table>
 
    <asp:SqlDataSource ID="GroupNameDataSource" runat="server"
        ConnectionString="<%$ ConnectionStrings:MyConnectionString %>" SelectCommand="SELECT RTRIM(user_group_id) AS user_group_id, RTRIM(user_group) AS user_group
FROM User_Group ORDER BY (user_group) "></asp:SqlDataSource>
 
<br />
    </asp:Content>
Iris
Top achievements
Rank 1
 answered on 22 Apr 2013
1 answer
58 views
Hi,
I wanted to use the gauge inside the hierarchical rad grid.
and i did as in this thread
http://www.telerik.com/community/forums/aspnet-ajax/gauge/how-to-use-gauge-inside-the-grid.aspx
But it works fine for normal radgrid and
when I am using hierarchical grid. I am not able to expand the details table in the grid.

here is my code.
ASPX:
<telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="Progress"
                                UniqueName="StatusIndicator">
                                <ItemTemplate>
                                    <center>
                                        <telerik:RadLinearGauge runat="server" ID="RadLinearGauge1" Scale-Vertical="false"
                                            Scale-MajorTicks-Visible="false" Scale-Labels-Visible="false" Width="120px" Height="20px">
                                            <Pointer Shape="BarIndicator">
                                                <Track Opacity="0.4" />
                                            </Pointer>
                                            <Scale Min="0" Max="100">
                                                <Ranges>
                                                    <telerik:GaugeRange Color="#c20000" From="0" To="100" />
                                                </Ranges>
                                            </Scale>
                                        </telerik:RadLinearGauge>
                                    </center>
                                </ItemTemplate>
                                <HeaderStyle Width="100px" HorizontalAlign="Center" />
                            </telerik:GridTemplateColumn>
C#:
protected void OnItemDataBound1(object sender, GridItemEventArgs e)
   {
       if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
       {
           GridDataItem item = e.Item as GridDataItem;
           DataRowView currentRow = (DataRowView)item.DataItem;
           decimal currValue = decimal.Parse(currentRow.Row["pc"].ToString());
           RadLinearGauge radialGauge1 = (RadLinearGauge)item.FindControl("RadLinearGauge1");
           radialGauge1.Pointer.Value = currValue;
       }
   }
Please give solution for this.

Thanks
--Alex
Danail Vasilev
Telerik team
 answered on 22 Apr 2013
3 answers
293 views
as I can disable a row with a checkbox inside a radgrid if I have the following code in aspx.

<telerik:RadGrid ID="grdCaptDiaria" runat="server" AutoGenerateColumns="False"

AllowPaging="True" PageSize="10">

<HeaderStyle BorderStyle="Solid" BorderWidth="1px" Height="30px" HorizontalAlign="Center"

BorderColor="#B0B0B0" BackColor="#EBEBEB" Font-Bold="True" Font-Italic="False"

Font-Names="Arial,Helvetica,sans-serif" Font-Overline="False" Font-Size="10px"

Font-Strikeout="False" Font-Underline="False" ForeColor="#666666" Wrap="True" />

<ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"

Font-Underline="False" ForeColor="#999999" Wrap="True" />

<PagerStyle Mode="NumericPages" PagerTextFormat="{4}Página {0} de {1}, registros del {2} al {3} de {5}" />

<MasterTableView TableLayout="Fixed" NoMasterRecordsText="No existen Moliendas con los filtros proporcionados">

<Columns>

<telerik:GridBoundColumn HeaderText="Concepto" DataField="concepto" />

<telerik:GridTemplateColumn HeaderText="Unidad" HeaderStyle-Width="25%">

<ItemTemplate>

<asp:Label ID="lblUnidad" runat="server" Text="Ton"></asp:Label>

</ItemTemplate>

</telerik:GridTemplateColumn>

<telerik:GridTemplateColumn HeaderText="Valor" DataField="valor" HeaderStyle-Width="25%">

<ItemTemplate>

<asp:TextBox ID="txtValor" runat="server"></asp:TextBox>

</ItemTemplate>

</telerik:GridTemplateColumn>

<telerik:GridTemplateColumn HeaderText="No Captura" HeaderStyle-Width="25%">

<ItemTemplate>

<asp:CheckBox ID="chkNoCaptura" Checked="false" OnChange="javascript:enableTextBox();" on runat="server" />

</ItemTemplate>

</telerik:GridTemplateColumn>

</Columns>

 

</MasterTableView>

Princy
Top achievements
Rank 2
 answered on 22 Apr 2013
1 answer
385 views
Hi,

How do I collapse and expand the nested rad grid on click of the radio button onselectedindex change of the MasterGrid view of every row.
For the same I have the radio button onselectindexchange event associated in every row of the MasterGrid and find the child nested grid to bind. The Issue is that I am able to find the child grid and bind it but the child grid is not expanding and collapsing after bind.

Quick response appreciated !
Shinu
Top achievements
Rank 2
 answered on 22 Apr 2013
5 answers
346 views
Hi everyone

I am generating a pivot and need to have a row and column total.  This is dynamic, and my output looks like this:
I am using AutoGenerateColumns="True".

My output looks like this:
ZipCode       2012.01   2012.02 ... 2013.01
06477      1   7      8

I would like a total across, and full totalling on the bottom.  For now, I am doing it at the datset level, as I dont know what the cols look like.  However, I do know that any column beginning with a number needs to be totalled.

I tried a number of tricks, but I would like to get this to happen using a dynamic (calc) column and a dynamic footer item for each data column.  I tried a prerender solution, but I dont seem to have any columns available at that time.

Can anyone help?

Thanks
Radoslav
Telerik team
 answered on 22 Apr 2013
2 answers
140 views
I'm having problems on having radupload inside a radwindow.
Please refer to attached screenshot and below details:

1) I have attachment user control which has a radwindow with radupload as its content
2) This attachment user control is called anywhere so for this scenario, it was used inside another radwindow
3) Issue happens only on IE7 (not on IE8 and higher, Chrome, etc)

Attachment user control (ASCX)
<div style="display: none;">
    <asp:TextBox ID="txtId" runat="server" />
    <asp:TextBox ID="txtSecondaryId" runat="server" />
    <asp:TextBox ID="txtCategory" runat="server"/>
    <asp:TextBox ID="txtSection" runat="server"/>
    <asp:HiddenField ID="hdnIsImageOnly" runat="server" Value="" ClientIDMode="Static" />
</div>
<div id="editDiv" runat="server">
    <div id="divUploadList">
 
        <asp:GridView ID="grdAttachment" runat="server" AutoGenerateColumns="False" BackColor="White"
            BorderColor="#FFFFFF" BorderStyle="None" BorderWidth="" CellPadding="3" Width="90%"                                       
            DataKeyNames="GlobalId" onrowdatabound="grdAttachment_RowDataBound" ShowHeader="false"
            onrowcommand="grdAttachment_RowCommand" GridLines="None">
            <Columns>
                <asp:TemplateField HeaderText="File Name">
                    <ItemStyle Width="95%" />
                    <ItemTemplate>
                        <asp:LinkButton runat="server" ID="lnkDelete" CommandArgument='<%# Eval("GlobalId") %>' CommandName="RemoveFile" OnClientClick="return confirm('Are you sure you want to remove this attachment?');" ><img style="border:none" src="../Images/eClose.png" /></asp:LinkButton
                        <asp:LinkButton runat="server" ID="lnkAttachment"><%# Eval("FileName") %></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>   
        <br />
        <asp:ImageButton runat="server" ID="btnAttach" ImageUrl="~/Images/Buttons/Attachment.gif" OnClick="btnAttach_Click" />
 
    </div>
    <div id="divUploader">
        <telerik:RadWindow ID="uploadDialog" runat="server" Title="Upload Attachment" Height="400px" style="z-index: 99997;" OffsetElementID="grdAttachment"
            Width="600px" Left="150px" Behaviors="Close,Move,Resize" AutoSize="true" AutoSizeBehaviors="Height" ReloadOnShow="true" ShowContentDuringLoad="false"
            Modal="true" VisibleStatusbar="false" IconUrl="~/Images/GFLogo.png" EnableShadow="true" VisibleOnPageLoad="false">       
        <ContentTemplate>
            <span class="notes">maximum upload file size: 10MB</span>
            <br />
            <div style="text-align: center;">         
                <telerik:RadUpload ID="uploadAttachment"  MaxFileSize="300000000"
                    runat="server" ClientIDMode="Static"
                    InitialFileInputsCount="1"/>
               <%-- <telerik:RadProgressArea runat="server" id="RadProgressArea1"  OnClientProgressUpdating="checkUploadedFilesSize"  style="position: fixed; top: 50% !important; left: 50% !important; margin: -93px 0 0 -188px;"/>
                <telerik:RadProgressManager runat="server" id="RadProgressManager1" />--%>
                <br />
                <asp:LinkButton runat="server" ID="btnUpload" CssClass="button" OnClick="btnUpload_Click" OnClientClick="return validateAttachment();"><span>Upload</span></asp:LinkButton>
            </div>
        </ContentTemplate>
    </telerik:RadWindow>
    </div>
</div>
<div id="viewDiv" runat="server">
    <asp:Repeater runat="server" ID="repAttachment" OnItemDataBound="repAttachment_ItemDataBound">                                       
        <ItemTemplate>
            <asp:LinkButton CommandArgument='<%# Eval("GlobalId") %>' runat="server" ID="lnkAttachment"><%# Eval("FileName") %></asp:LinkButton><br />
        </ItemTemplate>
    </asp:Repeater>
</div>

Thanks.

Regards,
Jayzle
Jayzle
Top achievements
Rank 1
 answered on 22 Apr 2013
6 answers
871 views
Hi All,
     I need help in the radgrid Insert, Update and Delete functionalities with delete record confirmation using SqlConnection.
    Please provide me any sample code to resolve my scenario.


Thanks,
Nagendra.
Harish
Top achievements
Rank 1
 answered on 22 Apr 2013
12 answers
362 views
We currently have a problem with our application when unloading a page (Closing tab, or navigating a new url). The page can contain up to 15 Grids, if I remove some grids the problem disappear but I remove functionality so this is not the solution.

The problems occured since I came back from holiday, and I'm looking for the whole day now, after looking into the code of my colleague, and the complete site, I imagined that the problem was the 4 new grids we added to the page. So I removed some grids and the problem disappear, regardless of the grids I am disabling.

It works perfectly in Firefox, and the unload of a page is done instantly, with IE7 it takes ages, and if there is too much grids we got an error : "Script is running slow.... Blahblah.. Do you want to stop the script ?.

Is there any trick to speed up the unload of the grids ? or just to skip them ? or anything else to avoid that error and waiting time when browsing to another page or closing the tab.

Thank you

Laurent Lequenne
Brian Stanek
Top achievements
Rank 2
 answered on 22 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?