Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
195 views
Hi
I am Working on Rad Grid
I am bale to caluclate the numarical(int) values totals in footter 
BUT Problem araised in Money Datatype Coloumn
When i trying to caluclate the total for money datatype coloumn
It is dispalying the  all coloumn values in footter(not the SUM Values)
Plz help out to solve the problem
Thanks in advance

here is my C# Code

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using Telerik.Web.UI;

namespace ajaxKrunchBox
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           
        }

    
        protected void Button1_Click(object sender, EventArgs e)
        {

            Session["weekend"] = TextBox1.Text;
            Session["status"] = DropDownList4.Text;
            SqlCommand cmd = new SqlCommand("usp_CustomerPerformance_V2", new SqlConnection("Data Source=vijay;Initial Catalog=ULTIMATE_NEW;Integrated Security=True"));
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter("@Customer", DropDownList1.Text));
            cmd.Parameters.Add(new SqlParameter("@WeekEnding", TextBox1.Text));
            cmd.Parameters.Add(new SqlParameter("@Status", DropDownList4.Text));
            cmd.Parameters.Add(new SqlParameter("@noOfWks", DropDownList3.Text));
            cmd.Connection.Open();
            RadGrid1.DataSourceID = null;
            RadGrid1.DataSource = cmd.ExecuteReader();
            //Session["variable1"] = DropDownList1.Text;
            Session["varibale2"] = TextBox1.Text;
            Session["varibale4"] = DropDownList4;
            Session["varibale3"] = DropDownList3;
            RadGrid1.DataBind();
            RadGrid1.Visible = true;
           
          
            cmd.Connection.Close();
            cmd.Connection.Dispose();
          
        }

        int total1;
        int total2;
        int total3;
        int total4;
        int total5;
        int total6;
        String  total7;
        String total8;
        int total9;
        int total10;
         protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem dataItem = e.Item as GridDataItem;
                int fieldValue1 = int.Parse(dataItem["TYWkSales"].Text);
                total1 += fieldValue1;
                int fieldvalue2 = int.Parse(dataItem["LYWkSales"].Text);
                total2 += fieldvalue2;
                int fieldvalue3 = int.Parse(dataItem["TYL4WkSales"].Text);
                total3 += fieldvalue3;
                int fieldvalue4 = int.Parse(dataItem["LYL4WkSales"].Text);
                total4 += fieldvalue4;
                //int fieldvalue5 = int.Parse(dataItem["TYWkRRP"].Text);
                //total5 += fieldvalue5;
                //int fieldvalue6 = int.Parse(dataItem["LYWkRRP"].Text);
                //total6 += fieldvalue6;
                String fieldvalue7 = String.Format(dataItem["TYL4WkRRP"].Text);
                total7 += fieldvalue7;
                mydatatable
                //String fieldvalue8 = String.Format(dataItem["LYL4WkRRP"].Text);
                //total8 += fieldvalue8;
               
                int fieldvalue9 = int.Parse(dataItem["TYWkSOH"].Text);
                total9 += fieldvalue9;
                int fieldvalue10 = int.Parse(dataItem["LYWkSOH"].Text);
                total10 += fieldvalue10;
              
            }
            if (e.Item is GridFooterItem)
            {
                GridFooterItem footerItem = e.Item as GridFooterItem;
                footerItem["TYWkSales"].Text = "Total Units: " + total1.ToString();
                footerItem["LYWkSales"].Text = "Total Units: " + total2.ToString();
                footerItem["TYL4WkSales"].Text = "Total Units: " + total3.ToString();
                footerItem["LYL4WkSales"].Text = "Total Units: " + total4.ToString();
                //footerItem["TYWkRRP"].Text = "Total Price: " + total5.ToString();
                //footerItem["LYWkRRP"].Text = "Total Price: " + total6.ToString();
                footerItem["TYL4WkRRP"].Text = "Total Price: " + total7;
                footerItem["LYL4WkRRP"].Text = "Total Price: " + total8;
                footerItem["TYWkSOH"].Text = "Total Units: " + total9.ToString();
                footerItem["LYWkSOH"].Text = "Total Units: " + total10.ToString();
            }

           

            }
      
       

      

      

    }
}

Yavor
Telerik team
 answered on 09 Mar 2009
2 answers
63 views
Hi

I am working on hierarchy Grid where I am having Master table and 4 DetailTables. I am getting plus-minus image at Mastertable level only but not getting that at DetailTable level.

Please suggest how to get that all detailTable level.

Thanks
Pradip
pradip
Top achievements
Rank 1
 answered on 09 Mar 2009
1 answer
103 views
i have a database with 2 date columns one is starting date and one is ending date plus other fields...i linked them to the table but it didnt work the scheduler is always empty... here is my code

<telerik:RadScheduler ID="RadScheduler1" runat="server" 
        DataEndField="Installariondate" DataKeyField="Sales_Order" 
        DataRecurrenceField="Status" DataRecurrenceParentKeyField="Sales_Order" 
        DataSourceID="SqlDataSource2" DataStartField="Requireddate" 
        DataSubjectField="Nodecode" HoursPanelTimeFormat="htt" Skin="Office2007" 
        style="top: -1px; left: 1px" ValidationGroup="RadScheduler1" SelectedView="WeekView"  >
        <ResourceTypes ><telerik:ResourceType DataSourceID="sqldatasource2" KeyField="Sales_Order"  Name="Nodecode" TextField="Status" ForeignKeyField="Sales_Order"/></ResourceTypes>
        
        
    </telerik:RadScheduler>
did i do any thing wrong?? help
Peter
Telerik team
 answered on 09 Mar 2009
2 answers
608 views
I need to create a way for users to 'bulk edit' data in a datagrid, for example changing the AssignedTo value of every row in the datagrid (or at least every row where a checkbox is checked) at once. Here is how I was hoping to do it but I am not sure how.

The user has a grid full of data.
The first column is checkboxes.
The user checks the rows he wants to update

In the first row there would be a field that would correspond to the data in that column. For example there is an AssignedTo column. At the top of that column would be a combobox which the user would choose a name from and then hit a button and it would update all of the rows that were checked. If I can't put the edit controls in the first row of the grid I would be happy to put them outside of the grid as well.

I haven't found any examples of this. Could someone let me know if this is feasible and how I might go about it.

Thanks,
Blake
Blake
Top achievements
Rank 1
 answered on 09 Mar 2009
1 answer
124 views
Hi Everyone,

I have a master and detail table, and in my master table, I've positioned my edit/delete buttons all the way to the right.

How do I do the same thing in the detail table?

Thanks!
Daniel
Telerik team
 answered on 09 Mar 2009
1 answer
96 views
I have a RadAjaxManager setup to update a RadGrid with a FormTemplate.  The RadGrid enters edit mode just fine with the expected ajax  behavior but once the FormTemplate content is loaded, there is a Javascript error and none of the buttons in the FormTemplate work.  I used Firebox/Firebug to see it: "Node cannot be inserted at the specified point."  I've followed a similar post which recommends setting EnablePageHeadUpdate to false and tried that but although that does away with the error, the result is that the buttons now don't do anything.  My setup includes 1 level of nested master pages and the controls are placed in a page that inherits from the nested master page.  I'm not doing anything funky beside the setup on the sample Form Template RadGrid on this site.

Source: http://www.telerik.com/community/forums/aspnet/general-discussions/firefox-and-node-cannot-be-inserted-a-the-specified-point.aspx
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/templateformupdate/defaultcs.aspx
Iana Tsolova
Telerik team
 answered on 09 Mar 2009
4 answers
491 views
How do I remove the Top and Bottom padding to make the rows tighter in my grid. I keep seeing references to "overflow:hidden" but can't find the property.

I am using VB to create the grid with V 2008.3.1125.35

Thanks,

Rob
Rob Diamant
Top achievements
Rank 1
 answered on 09 Mar 2009
3 answers
121 views

Hi,

We are testing the grid connecting to a table with a million of records. We are using paging but it take time to load the next page. We do not want to use LINQ. How can we speed up this operation?

Thanks

Sebastian
Telerik team
 answered on 09 Mar 2009
7 answers
276 views
Hello,

RadGrid is loosing sizing set by users when paging.
Thanks for a way to keep it until it is corrected.

CS
Sebastian
Telerik team
 answered on 09 Mar 2009
2 answers
52 views
Hello,

Please contribute to solve my problem.

I am generating bar charts by binding it with data from my DB.It is a stackedBar chart.It is showing data correctly.
But i am facing a problem .Because when it shows values respective to bars.Then some vaues are coming on bar while are on plot area.It looks weired.I want that value for each bar should not come on bar.It may come where bar ends.What should i do so that every value come in the end of the bar insted of displaying on the bar of chart.

Please help if you have solution.Every post will be appriciated.

Thanks,
meet
Top achievements
Rank 1
 answered on 09 Mar 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?