Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
94 views
I created a page with a tabstrip control and a Multipage control. The MultipPageID of the Tabstrip is set to the ID of the Multippage. In the codebehind, I load the tabs. I have the Tabstrip_TabClick event coded and the MultipPage_PageViewCreated coded.

The first time I click on a tab, the TabClick event fires, where I add a new pageview for the tab.
If I click a different tab, the PageViewCreated event fires before the TabClick event. At this point, I have no clue what tab was clicked, and don't know what to load. I tried using the tabstrip.selected property, but that shows the tab that was selected before I clicked the new tab.

What is going on here? How do I get the TabClick event to fire BEFORE the PageViewCreated?

EDIT: I just realized what is happening. The first time, there was't a pageview, so it had nothing to load in the PageViewCreated event. So, it executed the tabstrip_tabclick event. The second time I clicked a tab, it reloaded the first pageview and then created new pageview via the tabclick event. The third tab loads the first two pageviews via the pageviewcreated event, then the tabclick event for the third tab and then the new pageviewcreated event for the third tab.

Ok, now I understand...
Steve
Top achievements
Rank 1
 asked on 14 Sep 2013
1 answer
115 views
I have code like this:

MyRadDatePicker.SelectedDate = DateTime.Now

and the text box doesn't update.

Do I need to call an update function or something?
Raymond
Top achievements
Rank 1
 answered on 13 Sep 2013
12 answers
1.0K+ views
I'm trying to implement a "classic" solution where filtering, sorting and paging happens at db level and the retrieved resultset is only the one needed. That way it should be lighter to handle bigger database since if you have a page of 50 items you only set those 50 items as datasource.
I would like to keep a tradeoff between this performance boost and the automatic functionalities the grid offers (mostly in the CRUD scendario, of course I'll have to handle all the selects for paged and filtered datasets)
Anyway... I'm trying to accomplish this with NeededDataSource (I was wondering if ObjectDataSource is better for this.. is it?)
I'm finding my way through paging and this is quite straightforward: 

Protected Sub RadGrid1_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs)
    Dim dataSource As New MyUsersManager
    Dim query As New PagedQuery
    Dim result As ResultPage(Of MyUser)
 
    query.ItemsPerPage = RadGrid1.MasterTableView.PageSize
    query.PageNumber = RadGrid1.MasterTableView.CurrentPageIndex + 1
 
    result = dataSource.GetPage(query)
 
    RadGrid1.MasterTableView.VirtualItemCount = result.TotalItems
    RadGrid1.MasterTableView.DataSource = result.Items
End Sub

The problem is that I always get page index 0... even if the pager updates and I'm on page 2 or 3 I always get pagindex 0 in the NeedDataSource events... why?

I wonder how can I factor in the filtering and the sorting... How can I retrieve the filtering parameters and sorting (maybe even multisorting) parameters inside NeedDataSource? Should I create page properties that are updated from filtering and sorting events and then read from NeedDataSource event, or is there a more straightforward way to do it?

What about grouping? Will this work with my custom implementation? I suppose it won't show the summaries for grouped paging anymore (like "you are viewing n records of group x and still more y records on next page" or such) but will it work the same? Or do I have to retrieve the whole 1 milion records dataset to benefit from grouping? Same for footer summaries, will those work on a single page basis or do they only work with the full db?

I think this should be a common scenario for larger implementation for e-commerce sites, or where db grows to a considerable size in general  (like for example in a multiapp SaaS framework wich serves multiple sites from a single app and the DB has data from all the sites)

Thanks in advance
Massimiliano
Top achievements
Rank 1
 answered on 13 Sep 2013
1 answer
123 views
Hello,

I'm attempting to allow my users to select multiple items inside a RadPanelBar.  To accomplish this, I have programmatically added CheckBoxes inside each RadPanelItem.  However, they are appearing on their own line.  Is there a way to align the CheckBoxes to the same line as the text of the RadPanelItem?  I have included an image for reference.

Also, If there is an easier way to display hierarchical data allowing multiple selection, I'm open to the idea of using another control instead.  (Could RadTreeView and/or RadTreeList be options?)

Thank you for your help!

Regards,
Brian Chambers
Brian
Top achievements
Rank 1
 answered on 13 Sep 2013
1 answer
109 views
Hello,
I am using a Rad Editor control on my webpage. I am using custom CSS file to populate the styles classes in "Apply CSS" drop down. The issue i am facing is IE specific. In my CSS file i have some classes defined as

h3,.style1{
font-weight: bold;
font-size: 14px;
color: #000000;
}


This works fine in all browsers except in IE, it displays two classes :-
style1 - this refers to h3,.style1
style1 - this refers to .style1

Please let me know how can i fix this.

Thanks
Sumit
Ianko
Telerik team
 answered on 13 Sep 2013
1 answer
128 views
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Collections;
using Telerik.Web.UI;
using System.IO;
using System.Web.Services;
 
namespace My_Workshop.A4f
{
    public partial class DataSource : System.Web.UI.Page
    {
        public AllClass AllClass = new AllClass(); SqlConnection con = AllClass.dbConnection();
        //获取页码
        public void getcnt()
        {
            AllClass.SearchDef Def = new AllClass.SearchDef();
            Def.AssPat = this.RadAssPat; Def.Business = this.RadBusi; Def.ProSeries = this.RadPro; Def.PtoTyp = this.RadPtoTyp;
            Def.Disposal = this.RadDisposal1; Def.DefMat = this.RadDefMat; Def.STimd = this.TxtSTim.Text; Def.OTimd = this.TxtOTim.Text;
            Def.ProCode = this.RadProCode; Def.Modul = this.RadModul; Def.CusCode = this.RadCusCode; Def.CityOffice = this.RadCityOffice;
            Def.PlantCode = this.RadPlantCode; Def.OilWay = this.RadOilWay.Text; Def.AssPlant = this.RadAssPlant1;
            Def.AssPatCod = this.RadPat; Def.STima = this.TxtSTima.Text; Def.OTima = this.TxtOTima.Text;
            string sc = "select count(*) from tbDef where(1=1) " + AllClass.getwdd(Def);
            ViewState["cnt"] = AllClass.ExecuteScalar(sc, con).ToString();
        }
        //显示
        public void show(int currentpage)
        {
            AllClass.SearchDef Def = new AllClass.SearchDef();
            Def.AssPat = this.RadAssPat; Def.Business = this.RadBusi; Def.ProSeries = this.RadPro; Def.PtoTyp = this.RadPtoTyp;
            Def.Disposal = this.RadDisposal1; Def.DefMat = this.RadDefMat; Def.STimd = this.TxtSTim.Text; Def.OTimd = this.TxtOTim.Text;
            Def.ProCode = this.RadProCode; Def.Modul = this.RadModul; Def.CusCode = this.RadCusCode; Def.CityOffice = this.RadCityOffice;
            Def.PlantCode = this.RadPlantCode; Def.OilWay = this.RadOilWay.Text; Def.AssPlant = this.RadAssPlant1;
            Def.AssPatCod = this.RadPat; Def.STima = this.TxtSTima.Text; Def.OTima = this.TxtOTima.Text;
            int pagesize = this.RadDataPager1.PageSize;
            string sw = AllClass.getwdd(Def);
            string s = "select top " + pagesize +
    "DefID,MendDat,Business,OilSystem,CusNam,AssDat,AssPlant,DefMat,ProSeries,AssPatCod,AssPat,Disposal,Modul,PlantNam from tbDef where DefID not in(select top " + pagesize * (currentpage) +
    " DefID from tbDef where(1=1) " + sw + "order by DefID desc)" + AllClass.getwdd(Def) + "order by DefID desc";
            AllClass.showdata0(s, con, this.RadGrid2);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ((Label)(this.Page.Master.FindControl("LblSitMap"))).Text = "故障明细管理";
                this.TxtOTim.Text = DateTime.Now.ToString("yyyy-MM-dd");
                this.TxtSTim.Text = DateTime.Now.ToString("yyyy-01-01");
                DataTable dtt = new DataTable();
                this.RadGrid2.MasterTableView.NoMasterRecordsText = "欢迎您!";
                this.RadGrid2.DataSource = dtt;
                this.RadGrid2.DataBind();
                dtt.Dispose();
            }
 
 
        }
 
        protected void tb_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            switch (e.Item.Text)
            {
                case "查询":
                    getcnt();
                    show(this.RadDataPager1.CurrentPageIndex);                    
                    break;
                default:
                    break;
            }
        }
        protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
            {              
                e.Item.Attributes.Add("OnDblClick", "window.radopen('DataView/DefDetail.aspx?DefID=" +
                    this.RadGrid2.MasterTableView.DataKeyValues[e.Item.ItemIndex]["DefID"]+ "', 'RadWindow1');");
            }
        }
         
 
        protected void RadDataPager1_TotalRowCountRequest(object sender, RadDataPagerTotalRowCountRequestEventArgs e)
        {
            e.TotalRowCount = Convert.ToInt32(ViewState["cnt"]);
        }
        protected void RadDataPager1_PageIndexChanged(object sender, RadDataPagerPageIndexChangeEventArgs e)
        {
            show(e.NewPageIndex);
        }
 
        string GenerateButtonText(string argument)
        {
            return String.Format("<span>{0}</span>", int.Parse(argument) + 1);
        }
 
        protected void RadDataPager1_FieldCreated(object sender, RadDataPagerFieldCreatedEventArgs e)
        {
            if (e.Item.Field is RadDataPagerButtonField && (e.Item.Field as RadDataPagerButtonField).FieldType == PagerButtonFieldType.Numeric)
                foreach (IButtonControl ctrl in e.Item.Controls)
                    ctrl.Text = GenerateButtonText(ctrl.CommandArgument);
        }
 
    }
}
public void showdata0(string s, SqlConnection con, RadGrid gv)
        {
            DataTable dt = AllClass.dt(s, con);
            gv.DataSource = dt;
            gv.DataBind();
            dt.Dispose();
        }
I got this Exception"RegisterRequiresControlState can only be called before and during PreRender."but asp:gridview works well
Daniel
Telerik team
 answered on 13 Sep 2013
1 answer
118 views
An error is found when calling client side method resetZoom on the Chart control.  Up to version 2013.2.611.45 everything was working fine but since the apply of the release 2013.2.903.45 the function call return an error.

Unhandled exception at line 15, column 16485 in http://localhost:49162/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=radScriptManager_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:c9cbdec3-c810-4e87-846c-fb25a7c08002:ea597d4b:b25378d2;Telerik.Web.UI,+Version=2013.2.903.45,+Culture=neutral,+PublicKeyToken=121fae78165ba3d4:en-US:57d8db9c-03e9-4d79-85fa-5fff26620928:16e4e7cd:86526ba7:874f8ea2:ed16cbdc:f7645509:24ee1bba:e330518b:2003d0b8:1e771326:c8618e41:f46195d3:aa288e2d:19620875:cda80b3:383e4ce8:a51ee93e:59462f1:7165f74:7918c3fa
 
0x800a139e - JavaScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
 
Details: Error parsing near '
 
 
 
<html xmlns="htt'.
Thanks in advance
Stephane
Petar Kirov
Telerik team
 answered on 13 Sep 2013
4 answers
138 views
Hello all.

I want the user to select a master data record (in a RadWindow) and fill most of the grid fields from that selection. At the moment it is solved by having an additional button outside the grid. Technically okay and working. But it is quite ugly and the user won't understand why there are buttons (save and refresh) inside and one outside.

The solution "put all buttons outside the grid" is not the elegant way. So I studied the documentation http://www.telerik.com/help/aspnet-ajax/grid-batch-editing.html

But I found no way to intercept, modify or override the add new record buttons behaviour.

Is there really no elegant way to have a custon insert routine?

Kind regards
Bernd
Bernd
Top achievements
Rank 2
 answered on 13 Sep 2013
2 answers
310 views
ASP .NET AJAX Q3 2012

I have a simple grid with a MasterTableView, some columns at that level, and then a child DetailTable/GridTableView.
I need a modal popup on the child GridTableView. 
I set this on the GridTableView:  EditMode=PopUp and <EditFormSettings EditFormType="AutoGenerated" PopUpSettings-Modal="true"></EditFormSettings>

When I click the edit icon for a row in the GridTableView, the modal popup appears, but the background is NOT greyed-out, and the controls "behind" the popup are available to the user. The popup is NOT modal.

If I instead change things so the MasterTableView has EditMode=PopUp and the EditFormSettings are at the MasterTableView level (just like your demos) the popup opens and displays as it should, modally and with the grey background.

Please validate that this is a bug, how I can get it fixed or if there is a work around or other ways to achieve what I'm trying to do.


Deborah
Top achievements
Rank 1
 answered on 13 Sep 2013
2 answers
115 views

We recently updated our ASP.NET AJAX controls from version 2012.03.1017.0 to 2013.02.717.0. Something that I noticed is that a telerik:GridBoundColumn with Visisble="false" would still bind and be accessible from the code behind with the older control, but no longer binds with the new control. Is this a known change or perhaps an unintended side effect?

By the way, the fix for this in our case was easy- we simply used a datakey instead of a hidden bound column.

Thank you.
Trey
Top achievements
Rank 1
 answered on 13 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?