Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
155 views
According to this blog post, requests must be bigger than 8K to be compressed.

However I find that my AJAX call I did without RadCompression is 56 bytes, with it is 170+ bytes.

How come it grew, albeit slightly?

How do I get/set the threshold?

Thanks.
Daniel
Telerik team
 answered on 19 Aug 2009
2 answers
176 views
Hi,

I have created a TabStrip where the content each tab is loaded on demand as shown on the demos. The content  of each tab is a User Control and added at runtime through the PageViewCreated event.

Each tab loads as expected but when I tried to attach an OnClientSelectedIndexChanged event (combo1_selected ) to a combo box on the second tab it displayed a "combo1_selected" is undefined.  The script for this event is defined in the user control.

I tried to add this user control to a separate webform and it works fine.

Please help.

Thank you very much,
rei
rei
Top achievements
Rank 1
 answered on 19 Aug 2009
4 answers
130 views
Hi!

I've got a problem with the onclientslide function. What I am trying to do is set the value of the slider in a label. The problem is that the slider and the label are in the PagerTemplate of an gridview.

So when the gridview has only 1 page, the pagertemplate doesn't exist. I can add the javascript function in codebehind and that works fine for a normal page.

But my gridview is in an updatepanel which is in a usercontrol. The first time when the whole page is rendered, the gridview is empty so there is no pagertemplate, after i search the results will be shown in the gridview and the gridview has a pager template. But because it's an async postback, the whole page doesn't render and i cant register javascrip, so the function will not work.

this is my pagertemplate inside the gridview control
<PagerTemplate> 
  <telerik:RadSlider ID="slider" runat="server" Orientation="Horizontal" Skin="Office2007"   
            AutoPostBack="true" OnValueChanged="Slide_Changed" DataValueField="lblpage" OnClientSlide="clientSlide" /> 
  <label>Pagina </label> 
  <asp:Label ID="SlideLabel" runat="server" /> 
  <asp:Label ID="lblpage" runat="server" Text='<%# " van " + ItemsGridView.PageCount %>' /> 
</PagerTemplate> 

This is the function where i try to add the javascript to the slider

protected void ItemsGridView_DataBound(object sender, EventArgs e)  
    {  
      GridViewRow rowPager = ItemsGridView.BottomPagerRow;  
      if (rowPager != null)  
      {  
        RadSlider slider = (RadSlider)rowPager.Cells[0].FindControl("slider");  
        slider.MinimumValue = 1;  
        slider.MaximumValue = ItemsGridView.PageCount;  
        slider.Value = ItemsGridView.PageIndex + 1;  
        Label sliderLabel = (Label)rowPager.Cells[0].FindControl("SlideLabel");  
        sliderLabel.Text = (ItemsGridView.PageIndex + 1).ToString();  
 
          
          
        string script = @"
         <script type='text/javascript'>
           function clientSlide(sender, eventArgs)
          {                
            var myLabel = document.getElementById('" + sliderLabel.ClientID + @"');
            myLabel.innerHTML = sender.get_value();             
          }
        </script>";  
 
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "clientslider", script);  
        slider.OnClientSlide = "clientSlide";  
      } 
Marlou
Top achievements
Rank 1
 answered on 19 Aug 2009
7 answers
1.9K+ views
OK, this is the css I had for the old styling.  I cannot for the life of me figure out how to properly reference the new classes and the documentation is not current.  I don't really care what skin I use, as long as I can get a handle on getting the references. 

I would appreciate if someone could maybe take what I have here and update it (at least partially) and also let me know how I should reference the style in the Grid control.

 /* TELERIK RAD GRID */  
   
    
.RadGrid_Office2007  
{  
    border:solid 1px #bfbfbf;  
}  
      
.Custom .GridRow_Office2007 td,  
.Custom .GridAltRow_Office2007 td,  
.Custom .GridEditRow_Office2007 td,  
.Custom .GridFooter_Office2007 td,  
.Custom .GridGroupFooter_Office2007 td  
{  
    border:1px #e5e5e5;  
    border-style:none none solid solid;  
    padding-top:4px;  
    padding-bottom:4px;  
}  
 
.Custom .GridRow_Office2007    
{    
    background:none #ffffff;    
    line-height:20px;  
}    
.Custom .GridAltRow_Office2007     
{    
    background:none #f2f2f2;    
    line-height:20px;  
}    
.Custom .GridEditRow_Office2007     
{    
    background:none #ffffe1;    
}    
.Custom .SelectedRow_Office2007     
{    
    background:none #ffffe1;    
     
}    
.Custom .SelectedRow_Office2007 td,  
.Custom .SelectedRow_Office2007>td:first-child  
{  
    border-color:#f2f2f2;  
}  
.Custom .GridRowOver_Office2007   
{    
    background:none #666666;    
}    
 
.Custom .GridPager_Office2007   
{  
    background: #edf5e5;  
      
    color:#333333;  
}  
.Custom .GridPager_Office2007 td  
{  
    border:1px solid #bfbfbf;  
    border-left:0px;  
    border-right:0px;  
    padding:1px 4px 2px;  
}  
 
.Custom .PagerLeft_Office2007  
{  
    padding:5px;  
    float:right;  
}  
.Custom .PagerRight_Office2007  
{  
    padding:5px;  
    float:left;  
}  
.Custom .GridHeader_Office2007  
{  
    color: #666666;  
    font-weight: bold;  
    border-left:1px solid #e5e5e5;  
    border-bottom: solid 1px #e5e5e5;  
    background:none #f2f2f2;  
    padding:5px;  
}  
.Custom .GridHeader_Office2007 a, a:link, a:visited  
{  
    text-decoration:none;  
    font-weight:bold;  
    color:#666666;  
}  
.Custom .GridHeader_Office2007 a:hover, a:active  
{  
    text-decoration:underline;  
    font-weight:bold;  
    color:#666666;  
}  
 
 
.Custom .InnerHeaderStyle_Office2007  a, a:link, a:visited  
{  
    text-decoration:none;  
    font-weight:bold;  
    color:#666666;  
       
}  
.Custom .InnerHeaderStyle_Office2007  a:hover, a:active  
{  
    text-decoration:underline;  
    font-weight:bold;  
    color:#666666;  
}  
 
.Custom .InnerHeaderStyle_Office2007  
{   
    color: #666666;  
    font-weight: bold;  
    border-left:1px solid #e5e5e5;  
    border-bottom: solid 1px #e5e5e5;  
    background:none #f2f2f2;  
    padding:5px;  
}  
 
 
 
.Custom input[type="text"]  
{  
    FONT: 11px Arial, Helvetica, sans-serif;  
    COLOR: #333333;  
    MARGIN: 0px 0px 0px 0px;  
    TEXT-ALIGN: left;  
    BORDER: solid 1px #7f9db9;  
      
} 

The grid reference:
<telerik:RadGrid ID="RadGridCE" runat="server"            
            Skin="Office2007" 
            CssClass="Custom" 
            > 


Thanks!
Dimo
Telerik team
 answered on 19 Aug 2009
1 answer
156 views

I have a scenario when user wolud like to submit all grid's filter criteria at once by pressing Enter or clicking on "Apply Filter" button.
My grid has several FilterTemplates with radcomboboxes and Calendar controls

 function submitFilter() { 
                                    debugger; 
                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>"); 
                                    var combo = $find('<%# ((GridItem)Container).FindControl("radComboBox1").ClientID %>'); 
                                    var ToPicker = $find('<%# ((GridItem)Container).FindControl("ToOrderDatePicker").ClientID %>'); 
                                    var FromPicker = $find('<%# ((GridItem)Container).FindControl("FromOrderDatePicker").ClientID %>'); 
 
                                    var fromDate = FormatSelectedDate(FromPicker); 
                                    var toDate = FormatSelectedDate(ToPicker); 
 
                                    tableView.filter('<%# _fieldName %>', fromDate + " " + toDate, "Between"); 
                                    tableView.filter("PolicyType", combo.get_selectedItem().get_text(), "EqualTo"); 

The problem here is that secont call to filter() function erase all previous filters.

Thanks in advance
Maxim
Yavor
Telerik team
 answered on 19 Aug 2009
2 answers
114 views
may i know how to add clientside events on the fly using javascript?

a method that is similar to this:

var panel = $find("radPanelControl");
panel.addOnClientClickedEvent("CustomEvent");

thanks. hope to hearing from u soon.

 

 

 

 

 

 

 

 

mac-mac
Top achievements
Rank 1
 answered on 19 Aug 2009
1 answer
280 views
Hi

I am using a RadGrid control on my web page (search page) which allow user to filter columns. inside my RadGrid I have a link which redirects user to another page and user can back to the search page again.
I was wondering is there any way that I can store the RadGrid's filter condition in a place like session and restore all of them when user is back to visit the page.

I used the following code but it just returns the string ,it didn't set the filter column with their search value in RadGrid.

        protected void Page_Load(object sender, EventArgs e) 
        { 
            if (!IsPostBack) 
            { 
                if (Session["RadGridFilterConditions"] != null) 
                { 
                    RadGrid1.MasterTableView.FilterExpression = Session["RadGridFilterConditions"].ToString(); 
                    RadGrid1.DataBind(); 
                } 
            } 
        } 
        protected void Page_PreRender(object sender, EventArgs e) 
        { 
            Session["RadGridFilterConditions"] = RadGrid1.MasterTableView.FilterExpression; 
        } 

Thanks,
Shinu
Top achievements
Rank 2
 answered on 19 Aug 2009
4 answers
121 views
Hello !

I have an error on Internet Explorer 8 with RadCombobox.

I open a RadWindow from the RadScheduler in which i have this :

<telerik:RadComboBox ID="CB_Groupe" runat="server" Skin="Black" DataSourceID="AccessDataSource3" 
DataTextField="nom_groupe" DataValueField="groupes_id" AutoPostBack="true" AppendDataBoundItems="true"  
AutoCompleteSeparator=";" MarkFirstMatch="true" Width="200px" Height="150px" Style="z-index: 100002;"> 
</telerik:RadComboBox> 

But on IE8, i have an error on the display, I made a video capture to show you the problem :
http://www.id3i.fr/vrac/erreuraffichageIE8.swf

When I pass the mouse over the control, the display is done, otherwise it does not appear.

Any ideas ?


Francois MARTIN
Top achievements
Rank 2
 answered on 19 Aug 2009
7 answers
203 views
Hello,

I'm trying to accomplish the following scenario with a  grid in hierachy model 3 levels deep using the OnNeedDataSource and OnDetailTableDataBind events. The grid can be refreshed with a button to get different data loaded using ajax and a forced databind() (server side) af refreshing the business layed on which the grid binds to.

1 - After load, no visiblitity of the filterrow
2 - Change visibility by using a radio button 
3 - changing preferably client side.
4 - after refreshing data the state of the filterrow should be preserved.
5 - on expanding the detailtable the filteritem of the datatable should also have the same visibility status as its mastertabelview

So far i've tried several soltutions, found here in this forum, but non of them worked for this scenario. 

i've written this piece of javascript to enable of disable the filters client side and this works.

       function showFilterItem() { 
            var grid = $find("<%= RadGrid1.ClientID %>"); 
            grid.get_masterTableView().showFilterItem(); 
            //get all detail tables in the hierarchy 
            var detailTablesArray = grid.get_detailTables(); 
 
 
            for (var x = 0; x < detailTablesArray.length; x++) { 
                detailTablesArray[x].showFilterItem(); 
            } 
        } 
        function hideFilterItem() { 
            var grid = $find("<%= RadGrid1.ClientID %>"); 
            grid.get_masterTableView().hideFilterItem(); 
            //get all detail tables in the hierarchy 
            var detailTablesArray = grid.get_detailTables(); 
 
            for (var x = 0; x < detailTablesArray.length; x++) { 
                detailTablesArray[x].hideFilterItem(); 
            } 
        } 
      
Please advice.
koen van daalen
Top achievements
Rank 1
 answered on 19 Aug 2009
4 answers
196 views
HI

I am having a radgrid and want to access the rows from an asp.net button clientside.

<

 

asp:LinkButton ID="LinkButton1" runat="server" OnClick="lnkbtnAddSlot_New_Click"

 

 

Width="97px" CssClass="sf-inputsLinkButton" OnClientClick="return AddSlot_New()">Add Slot_New</asp:LinkButton>

OnClientClick I want to access the no. of rows in radgrid and the values of the cells.

I used

 

 

var gvWorkingHours = $find("<%= gvWorkingHours_New.ClientID %>").get_masterTableView();

 

 


This is becoming null always.

for
(var i = 0; i < gvWorkingHours.get_masterTableView().get_dataItems().length; i++)

 

{

 

var row = Rows[i];

 

 

var textbox1 = row.findControl("txtSlotName"); //

 

 

 

 

}

Please suggest solution.

Below is the entire source  code.

------------
aspx page
---

 

<%

@ Page Language="C#" AutoEventWireup="true"

 

 

 

 

MasterPageFile

 

="~/EnterpiseConsoleFiles/MasterPage.master" CodeFile="Default.aspx.cs" Inherits="_Default" %>

 

<%

@ Register Assembly="RadCalendar.Net2" Namespace="Telerik.WebControls" TagPrefix="radCln" %>

 

<%

@ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="radA" %>

 

<%

@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>

 

 

 

 

<

 

asp:Content ID="content" runat="server" ContentPlaceHolderID="Cont">

 

 

 

 

 

 

<script type="text/javascript">

 

 

 

 

 

 

function TestHandler(sender, eventArgs)

 

{

 

var oldTime = eventArgs.oldTime;

 

 

var newTime = eventArgs.newTime;

 

 

var msg = "Time changed from ";

 

 

if (oldTime)

 

msg = msg + oldTime;

 

else

 

 

 

 

 

msg = msg +

"nothing";

 

msg = msg +

" to ";

 

 

if (newTime)

 

msg = msg + newTime;

 

else

 

 

 

 

 

msg = msg +

"nothing";

 

 

alert(msg);

}

 

function AddSlot_New()

 

{

 

debugger;

 

 

 

var gvWorkingHours = $find("<%= gvWorkingHours_New.ClientID %>").get_masterTableView();

 

 

for (var i = 0; i < gvWorkingHours.get_masterTableView().get_dataItems().length; i++)

 

{

 

var row = Rows[i];

 

 

var textbox1 = row.findControl("txtSlotName"); //

 

 

 

 

 

}

}

 

 

 

function DateSelected(sender, args)

 

{

 

var text = args.newTime;

 

alert(

'sree');

 

}

 

function error(sender, args)

 

{

 

var text = args.get_inputText;

 

alert(

'dhar');

 

}

 

</script>

 

 

 

 

 

 

 

 

<div>

 

 

 

 

 

 

<rad:RadGrid ID="gvWorkingHours_New" runat="server" Skin="SkeltaGrid" AutoGenerateColumns="false"

 

 

 

 

 

 

>

 

 

 

 

 

 

<MasterTableView>

 

 

 

 

 

 

<Columns>

 

 

 

 

 

 

<rad:GridTemplateColumn>

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

<asp:TextBox runat="server" ID="txtSlotName" CssClass="inputsNoExpression" Text='<%# Eval("SlotName") %>'></asp:TextBox>

 

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

 

</rad:GridTemplateColumn>

 

 

 

 

 

 

<rad:GridTemplateColumn>

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

<radCln:RadTimePicker ID="rtpFromTime" Width="31%" runat="server" TabIndex="2" EnableTyping="true"

 

 

 

 

 

 

TimeView-TimeFormat="HH:mm" DateInput-DateFormat="HH:mm" DateInput-DisplayDateFormat="HH:mm"

 

 

 

 

 

 

DateInput-EmptyMessage="From Time" DBSelectedDate='<%# Eval("FromTime") %>'>

 

 

 

 

 

 

<TimeView ID="tvFrom" runat="server" ShowHeader="False" Interval="00:30" Columns="3">

 

 

 

 

 

 

</TimeView>

 

 

 

 

 

 

 

<ClientEvents OnDateSelected="DateSelected" />

 

 

<DateInput>

 

 

<ClientEvents OnError="error" />

 

 

</DateInput>

 

 

</radCln:RadTimePicker>

 

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

 

</rad:GridTemplateColumn>

 

 

 

 

 

 

<rad:GridTemplateColumn>

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

<radCln:RadTimePicker ID="rtpToTime" Width="31%" runat="server" TabIndex="2" EnableTyping="true"

 

 

 

 

 

 

TimeView-TimeFormat="HH:mm" DateInput-DateFormat="HH:mm" DateInput-DisplayDateFormat="HH:mm"

 

 

 

 

 

 

DateInput-EmptyMessage="To Time" DBSelectedDate='<%# Eval("ToTime") %>'>

 

 

 

 

 

 

<TimeView ID="tvTo" runat="server" ShowHeader="False" Interval="00:30" Columns="3"

 

 

 

 

 

 

OnClientTimeSelected="TestHandler">

 

 

 

 

 

 

</TimeView>

 

 

 

 

 

 

</radCln:RadTimePicker>

 

 

</ItemTemplate>

 

 

 

 

 

 

</rad:GridTemplateColumn>

 

 

 

 

 

 

 

<rad:GridTemplateColumn>

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

<asp:CompareValidator ID="dateCompareValidator" runat="server" ControlToValidate="rtpToTime"

 

 

 

 

 

 

ControlToCompare="rtpFromTime" Operator="GreaterThan" Type="String" ErrorMessage="To Date must be greater than From Date">

 

 

 

 

 

 

</asp:CompareValidator>

 

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

 

</rad:GridTemplateColumn>

 

 

 

 

 

 

</Columns>

 

 

 

 

 

 

</MasterTableView>

 

 

 

 

 

 

</rad:RadGrid>

 

 

 

 

 

 

<asp:LinkButton ID="LinkButton1" runat="server" OnClick="lnkbtnAddSlot_New_Click"

 

 

 

 

 

 

Width="97px" CssClass="sf-inputsLinkButton" OnClientClick="return AddSlot_New()">Add Slot_New</asp:LinkButton>

 

 

 

 

 

 

</div>

 

 

 

 

 

 

</asp:Content>

 

code behind
-----------------

 

using

 

System;

 

 

 

using

 

System.Data;

 

 

 

using

 

System.Configuration;

 

 

 

using

 

System.Collections;

 

 

 

using

 

System.Web;

 

 

 

using

 

System.Web.Security;

 

 

 

using

 

System.Web.UI;

 

 

 

using

 

System.Web.UI.WebControls;

 

 

 

using

 

System.Web.UI.WebControls.WebParts;

 

 

 

using

 

System.Web.UI.HtmlControls;

 

 

 

using

 

Telerik.WebControls;

 

 

 

public

 

partial class _Default : System.Web.UI.Page

 

 

 

 

{

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

if (!IsPostBack)

 

{

SetInitialRowForSlots_New();

}

}

 

private void SetInitialRowForSlots_New()

 

{

 

DataTable dtSlots = new DataTable();

 

dtSlots.Columns.Add(

new DataColumn("SlotName", typeof(string)));

 

dtSlots.Columns.Add(

new DataColumn("FromTime", typeof(string)));

 

dtSlots.Columns.Add(

new DataColumn("ToTime", typeof(string)));

 

 

DataRow drSlot = dtSlots.NewRow();

 

drSlot[

"SlotName"] = string.Empty;

 

drSlot[

"FromTime"] = new TimeSpan(0, 0, 0);

 

drSlot[

"ToTime"] = new TimeSpan(0, 0, 0);

 

dtSlots.Rows.Add(drSlot);

gvWorkingHours_New.DataSource = dtSlots;

gvWorkingHours_New.DataBind();

}

 

protected void lnkbtnAddSlot_New_Click(object sender, EventArgs e)

 

{

 

DataTable dtSlots = new DataTable();

 

dtSlots.Columns.Add(

new DataColumn("SlotName", typeof(string)));

 

dtSlots.Columns.Add(

new DataColumn("FromTime", typeof(string)));

 

dtSlots.Columns.Add(

new DataColumn("ToTime", typeof(string)));

 

 

foreach (GridDataItem pkgItem in gvWorkingHours_New.MasterTableView.Items)

 

{

 

TextBox SlotName = pkgItem.FindControl("txtSlotName") as TextBox;

 

 

RadTimePicker FrTime = pkgItem.FindControl("rtpFromTime") as RadTimePicker;

 

 

RadTimePicker ToTime = pkgItem.FindControl("rtpToTime") as RadTimePicker;

 

 

DataRow dr = dtSlots.NewRow();

 

dr[

"SlotName"] = SlotName.Text;

 

dr[

"FromTime"] = new TimeSpan(((DateTime)(FrTime.DbSelectedDate)).TimeOfDay.Hours, ((DateTime)(FrTime.DbSelectedDate)).TimeOfDay.Minutes, 0);

 

dr[

"ToTime"] = new TimeSpan(((DateTime)(ToTime.DbSelectedDate)).TimeOfDay.Hours, ((DateTime)(ToTime.DbSelectedDate)).TimeOfDay.Minutes, 0);

 

dtSlots.Rows.Add(dr);

}

 

DataRow drEmpty = dtSlots.NewRow();

 

drEmpty[

"SlotName"] = string.Empty;

 

drEmpty[

"FromTime"] = new TimeSpan(0, 0, 0);

 

drEmpty[

"ToTime"] = new TimeSpan(0, 0, 0);

 

dtSlots.Rows.Add(drEmpty);

gvWorkingHours_New.DataSource = dtSlots;

gvWorkingHours_New.DataBind();

}

 

}


Regards
Sreedhar Ambati

Shinu
Top achievements
Rank 2
 answered on 19 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?