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

We are showing the records in Hierarchical view, if we are displaying more than 8000 rows in the rad grid.
it gives us below exception.

Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.


we have set maxJsonLength property as well but it did not help
 <system.web.extensions>
       <scripting>
           <webServices>

   <jsonSerialization maxJsonLength="5000000" />
           </webServices>
       </scripting>
   </system.web.extensions>

Could some one please help us out to overcome with this issue?

-Umesh
Chethan Rajashekaraih
Top achievements
Rank 1
 answered on 26 Sep 2012
3 answers
110 views

I have an incorrect grouping message on the last page of my Grid:

"Business Unit: Technical Services (Showing 3 of 11 items. Group continues on the next page.)"

This is incorrect - there are only 3 records in this group and they are the last 3 records of the set. The virtual item count appears to be set correctly. If I set my page size to 10 or 20 from 50, the message no longer shows. For a Page Size of 30 records, the message is "Showing 3 of 21 items".

How do I fix this message?

The grouping code is as follows: 

GridGroupByExpression expression1 = new GridGroupByExpression(),
                    expression2= new GridGroupByExpression(),
                    expression3 = new GridGroupByExpression();
 
                expression1.SelectFields.Add(GetGridGroupByField("Division", "Division"));
                expression1.GroupByFields.Add(GetGridGroupByField("Division", null));
                expression2.SelectFields.Add(GetGridGroupByField("BusinessUnit", "Business Unit"));
                expression2.GroupByFields.Add(GetGridGroupByField("BusinessUnit", null));
                expression3.SelectFields.Add(GetGridGroupByField("State", "State"));
                expression3.GroupByFields.Add(GetGridGroupByField("State", null));
 
                rg.MasterTableView.GroupByExpressions.Add(expression1);
                rg.MasterTableView.GroupByExpressions.Add(expression2);
                rg.MasterTableView.GroupByExpressions.Add(expression3);

Radoslav
Telerik team
 answered on 26 Sep 2012
3 answers
83 views
HI,
I have a DataTable with Customer Data. I'm binding rad grid dynamically, because upton 3rd column, datatable has static columns after that from 4th columns all columns are Dynamic, so for that I've designed rad grid in dynamic binding and also binded column with Edit and Delete buttons. But the rad grid control item command event is not firing. Below is my code
void BindsGrid(int pageIndex = 0)
       {
 
           SetupTableService pgs = new SetupTableService();
           DataTable dt = pgs.ExportFuelGrade(SupplierId);
           int i = 0;
           if (gvFuelsGrades.MasterTableView.Columns.Count > 0)
           {
               gvFuelsGrades.MasterTableView.Columns.Clear();
               gvFuelsGrades.DataSource = null;
               gvFuelsGrades.DataBind();
                
           }
           foreach (DataColumn col in dt.Columns)
           {
               GridBoundColumn boundCol = new GridBoundColumn();
               string column = string.Format("{0}", dt.Columns[i].ColumnName);
               boundCol.DataField = column;
               boundCol.HeaderText = column;
               // templateCol.UniqueName = column.Replace(" ", string.Empty);
               gvFuelsGrades.MasterTableView.DataKeyNames = new string[] { "FuelId" };
               boundCol.ItemStyle.Width = Unit.Pixel(500);
               boundCol.ItemStyle.Wrap = true;
               if (boundCol.HeaderText == "FuelId" || boundCol.HeaderText == "OilGrade" || boundCol.HeaderText == "FuelGradeId" || boundCol.HeaderText == "ProductGroupId")
                   boundCol.Visible = false;
               gvFuelsGrades.MasterTableView.Columns.Add(boundCol);
                
               i++;
           }
            
           gvFuelsGrades.ClientIDMode = System.Web.UI.ClientIDMode.Static;
           gvFuelsGrades.CurrentPageIndex = pageIndex;
            
           gvFuelsGrades.AllowPaging = true;
           gvFuelsGrades.Width = Unit.Pixel(1000);
           gvFuelsGrades.DataSource = dt;
           gvFuelsGrades.DataBind();
            
            
           //(gvFuelsGrades.MasterTableView.GetColumn("Actions") as GridTemplateColumn).OrderIndex = gvFuelsGrades.Columns.Count+1;
           GridTemplateColumn templateCol = new GridTemplateColumn();
           templateCol.ItemTemplate = new GridActionTemplate("Actions");
           templateCol.HeaderText = "Actions";
           templateCol.OrderIndex = gvFuelsGrades.Columns.Count + 2;
           gvFuelsGrades.MasterTableView.Columns.Add(templateCol);
           gvFuelsGrades.Rebind();
           //(gvFuelsGrades.MasterTableView.GetColumn("Actions") as GridTemplateColumn).Visible = CanEdit() | CanDelete();
       }


and ITemplate Class
class GridActionTemplate : ITemplate
  {
      public event CommandEventHandler Command;
      private void OnCommand(CommandEventArgs e)
      {
          if (Command != null)
          {
              Command(this, e);
          }
 
      }
      private void imgEdit_Command(object sender, GridCommandEventArgs e)
      {
          OnCommand(e);
      }
      public void InstantiateIn(System.Web.UI.Control container)
      {
          lControl = new LiteralControl();
          lControl.ID = "lControl";
          imgEdit = new ImageButton();
          imgEdit.CommandName = "edit";
          imgEdit.ID = "btnEdit";
          imgEdit.ImageUrl = "~/Static/Images/Actions/edit.png";
           
 
          imgDelete = new ImageButton();
          imgDelete.CommandName = "delete";
          imgDelete.ImageUrl = "~/Static/Images/Actions/delete.gif";
           
          Table tbl = new Table();
          TableRow tr = new TableRow();
          TableCell td = new TableCell();
          td.Controls.Add(imgEdit);
          tr.Cells.Add(td);
          td = new TableCell();
          td.Controls.Add(imgDelete);
          tr.Cells.Add(td);
          tbl.Rows.Add(tr);
          container.Controls.Add(imgEdit);
          container.Controls.Add(imgDelete);
      }
      
      protected LiteralControl lControl;
      protected ImageButton imgEdit;
      protected ImageButton imgDelete;
      protected ImageButton imgView;
      private string colname;
      public GridActionTemplate(string cName)
      {
          colname = cName;
      }
  }

Help me in this regards  with making my rad grid fire item command.


Regards
Phaneendra
Radoslav
Telerik team
 answered on 26 Sep 2012
0 answers
34 views
Somthing gone wrong but now i posted
Swapnil
Top achievements
Rank 1
 asked on 26 Sep 2012
1 answer
171 views
Hi,

is it possible to completely hide particular NestedViewTemplate according to specific DataItem.Property? ..or to disable expanding functionality of the item at all?

Thanks,
Petr
Shinu
Top achievements
Rank 2
 answered on 26 Sep 2012
5 answers
171 views
Hi,

I want to do ClientSide Inset/Update/Delete with RadGrid in an MVC application.
Something Like inline editing in RadGrid. The data should remain at client side unless and until the user click teh submit button and send the data to server..
Is this possible, can anyone help me with this..

Thanks,
Huzefa
Maria Ilieva
Telerik team
 answered on 26 Sep 2012
1 answer
63 views

I have a RadGrid entirely created via code during runtime.

When I use this setting below, the pager works just fine:

myGrid.MasterTableView.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;

However, when I change it into this:

myGrid.MasterTableView.PagerStyle.Mode = GridPagerMode.NextPrevNumericAndAdvanced;

...I get the following javascript exception on every grid action (paging, sorting), and the actual postback is never executed:

   SCRIPT438: Object doesn't support property or method '$' 
  Ajax.js, line 574 character 8 

(http://aspnet-scripts.telerikstatic.com/ajaxz/2012.2.912/Ajax/Ajax.js)

That line reads:

if($telerik.$(a).css("opacity")>0||$telerik.$(a.getElementsByClassName("raDiv")[0]).css("opacity")>0){
    g=false;
}

Could you think of a reason how this error could possibly related to the advanced pager?

Andrey
Telerik team
 answered on 26 Sep 2012
1 answer
286 views

I have a website running Sitefinity that I recently upgraded from 5.1 SP1 to 5.1 SP2 (RadControls v2012.2.607.40). Prior to the upgrade RadTextBox styling was working properly in that I could define a css class rule that included a width property and use it for the RadTextBox's CssClass property and everthing worked as expected.  Since the 5.1 SP2 upgrade none of my width properties are applied and the RTB seems to be defaulting to 160px width.

Here's what my markup and css look like:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ZRTBTest.aspx.cs" Inherits="SitefinityWebApp.ZRTBTest" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
    <style>
        .rtbWrp
        {
            font-family: Tahoma,Verdana,sans-serif;
            font-size: 12px;
            width: 600px;
            background-color: #c0c0c0;
            padding: 5px;
        }
         
        .rtb550, .rtb450, .rtb350
        {
            padding: 3px !important;
            vertical-align: middle !important;
            margin-bottom: 15px !important;
            border: 1px solid #ff0000 !important;
        }
         
        .rtb550
        {
            width: 550px !important;
        }
         
        .rtb450
        {
            width: 450px !important;
        }
         
        .rtb350
        {
            width: 350px !important;
        }
    </style>
</head>
<body>
 
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager> <div>
        <div class="rtbWrp">
            <telerik:RadTextBox ID="RadTextBox1" runat="server" CssClass="rtb550">
            </telerik:RadTextBox></div>
        <div class="rtbWrp">
            <telerik:RadTextBox ID="RadTextBox2" runat="server" CssClass="rtb450">
            </telerik:RadTextBox>
        </div>
        <div class="rtbWrp">
            <telerik:RadTextBox ID="RadTextBox3" runat="server" CssClass="rtb350">
            </telerik:RadTextBox>
        </div>
    </div>
    </form>
</body>
</html>

Everything looks fine in Firefox (15.0.1), Chrome (21.0.1180.89) and IE 8 (see rtb_firefox_chrome_ie8standards.PNG).  In IE9 Standards mode the width of the text boxes is clipped at 160px (see rtb_ie9_standardsmode.PNG).  I could swear this was working in the last version.

Anyone else seeing this?

Thanks -- Steve

Galin
Telerik team
 answered on 26 Sep 2012
3 answers
109 views
Can you please give me an ASP.NET 4.0 VB.NET example of uploading to /images/post/ directory and renaming the image to a session value - with a 1, 2, 3, 4 etc saved after each file name?  The 1, 2, 3, 4 is just used to signify different images or else the images would just overwrite each other.

I will only be upload .jpg images!

Thanks!
Princy
Top achievements
Rank 2
 answered on 26 Sep 2012
3 answers
155 views
how to do crud with rad grid using in  built grid properties
AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticInserts="true"
Shinu
Top achievements
Rank 2
 answered on 26 Sep 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?