Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
117 views
Greetings,
                  My Scenario is as follows,I have a RadCombobox which contains two items
                            1.Select (value=0)
                             2.Office(value=1)
            On pageload every theing is working fine ie grid is loading when office is selected .The problem is that when combobox item "select" is chosen the grid is again loading.i want to show the grid as null as in the page load.

            According to my point of view the problem is NeedDataSource event is not calling except from PageLoad.

            Pls help me to solve the issue. Here is my code


 private void fill_Grid()
        {
               clsCheckListMaster chklstmaster = new clsCheckListMaster();
                ds = chklstmaster.get_CommodityInInventry(Convert.ToInt32(cmbbxOffice.SelectedValue));
                ViewState["ds"] = ds;
                if (ds.Tables[0].Rows.Count > 0)
                {

                    gdCheckListMaster.DataSource = ViewState["ds"];
                   // gdCheckListMaster.DataBind();
                    
                }
                
                

            
        }

        protected void gdCheckListMaster_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            if (cmbbxOffice.SelectedIndex > 0)
            {

                fill_Grid();
                gdCheckListMaster.DataSource =ViewState["ds"];

            }
            else
            {
                ViewState["ds"] = null;

            }
            
        }
 protected void gdCheckListMaster_PreRender(object sender, EventArgs e)
        {
            if (cmbbxOffice.SelectedIndex > 0)
            {
                gdCheckListMaster.Rebind();
                clsCheckListMaster chklstmaster = new clsCheckListMaster();

                for (int i = 0; i < gdCheckListMaster.Items.Count; i++)
                {
                    CheckBox chkbxDaily = (CheckBox)gdCheckListMaster.Items[i].FindControl("chkbxDaily");
                    CheckBox chkbxWeekly = (CheckBox)gdCheckListMaster.Items[i].FindControl("chkbxWeekly");
                    CheckBox chkbxYearly = (CheckBox)gdCheckListMaster.Items[i].FindControl("chkbxYearly");
                    DataSet ds1 = chklstmaster.getDetails_ChklstmsterANDRtlcmdtylst();
                    if (ds1.Tables[0].Rows.Count > 0)
                    {
                        for (int j = 0; j < ds1.Tables[0].Rows.Count; j++)
                        {
                            if (int.Parse(gdCheckListMaster.Items[i][gdCheckListMaster.Columns[0]].Text) == int.Parse(ds1.Tables[0].Rows[j]["INTERNALCOMMODITYID"].ToString()))
                            {
                                if (int.Parse(ds1.Tables[0].Rows[j]["DAILY"].ToString()) == 1)
                                {
                                    chkbxDaily.Checked = true;
                                    chkbxDaily.Enabled = false;
                                }
                                if (int.Parse(ds1.Tables[0].Rows[j]["WEEKLY"].ToString()) == 1)
                                {
                                    chkbxWeekly.Enabled = false;
                                    chkbxWeekly.Checked = true;
                                }
                                if (int.Parse(ds1.Tables[0].Rows[j]["YEARLY"].ToString()) == 1)
                                {
                                    chkbxYearly.Enabled = false;
                                    chkbxYearly.Checked = true;
                                }
                            }
                        }
                    }

                }
            }
            else
            {
                ViewState["ds"] = null;
            }
Princy
Top achievements
Rank 2
 answered on 03 Dec 2010
1 answer
47 views
Hi all, 

I have set my chart by default invisible, on dynamic data binding, I want to make it visible but when it become visible, PlotArea does not match with scale... please see the snapshot below... and help me fixing this problem
Yavor
Telerik team
 answered on 03 Dec 2010
1 answer
194 views
Hi,

I remember that there is a method "SetMaxRequestQueueSize" that we could use to change the queue size of Ajax request.

However, in the latest version (v2010.3.1109.40) of RadAjaxManager,  I could not find this method.

How could I change the Max Ajax queue size with the latest RadAjaxManager?

Ping
Maria Ilieva
Telerik team
 answered on 03 Dec 2010
3 answers
114 views
Looking for expert guidance on how to enable only current date + next 7 days in date picker only.
Only that range is selectable, all other dates disable.

Thanks
Maria Ilieva
Telerik team
 answered on 03 Dec 2010
3 answers
181 views
It 's simple, I only show custom edit form from web user control ( not need to bind data ). Ex: each User, I want to show a picture from picture.acsx when I click on row.
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True"
    AllowPaging="True" AllowSorting="True"  DataSourceID="ObjectDataSource1"
    GridLines="None" Skin="Black" AllowMultiRowSelection="True"
    onitemcommand="RadGrid1_ItemCommand"
    AutoGenerateEditColumn="True" ShowStatusBar="True"  >
     
<MasterTableView DataSourceID ="ObjectDataSource1" >
<EditFormSettings UserControlName="picture.ascx" EditFormType="WebUserControl">
                    <EditColumn UniqueName="EditCommandColumn1">
                    </EditColumn>
                </EditFormSettings>
</MasterTableView>
    <ClientSettings AllowColumnsReorder="True" EnablePostBackOnRowClick="true">
         
    </ClientSettings>
</telerik:RadGrid>
I had insert
<EditFormSettings UserControlName="picture.ascx" EditFormType="WebUserControl">
                    <EditColumn UniqueName="EditCommandColumn1">
                    </EditColumn>
                </EditFormSettings>
both
protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
       {
        
               e.Item.OwnerTableView.IsItemInserted = false;
               e.Item.OwnerTableView.EditFormSettings.UserControlName = "picture.ascx";
            
       }

But it doesn't work. What 's wrong ??? or I missed anything ??? I had read:
+ http://www.telerik.com/help/aspnet-ajax/grdcustomeditforms.html
+http://www.telerik.com/help/aspnet-ajax/grddifferenteditformsoneditandinsert.html
and demo http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultcs.aspx
But I don't still understand . Because I don't need bind data from grid to webusercontrol. Thanks a lot !!!
Dheeraj
Top achievements
Rank 1
 answered on 03 Dec 2010
1 answer
33 views

Hi All,

I have a radchart (having drill-down feature), once user clicks the bars, the 2nd chart gets open with refined data.
My need is that, on click of the 2nd chart's series or seriesItem or legends  user need to reach again to top chart.

I know through legends, but how can i tackle when user clicks series/seriesItem.

Velin
Telerik team
 answered on 03 Dec 2010
5 answers
343 views
Hello,

I have a RadGrid with the export to excel command enabled, and a RadFilter to filter the grid data.

When I try to export the grid to excel after applying filters, an exception occurs.
But the grid exports fine to excel if no filters are applied.

Please explain how to fix or workaround the problem.

Exception Info:

Script controls may not be registered after PreRender.

Description:An unhandled exception occurred during the execution of the current webrequest. Please review the stack trace for more information about the error andwhere it originated in the code.

Exception Details:System.InvalidOperationException: Script controls may not be registeredafter PreRender.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: Script controls may not be registered after PreRender.]   System.Web.UI.ScriptControlManager.RegisterScriptControl(TScriptControl scriptControl) +206   System.Web.UI.ScriptManager.RegisterScriptControl(TScriptControl scriptControl) +67   Telerik.Web.UI.RadInputControl.RegisterScriptControl() +42   Telerik.Web.UI.RadWebControl.ControlPreRender() +15   Telerik.Web.UI.RadInputControl.ControlPreRender() +12   Telerik.Web.UI.RadNumericTextBox.OnPreRender(EventArgs e) +152   System.Web.UI.Control.PreRenderRecursiveInternal() +80   System.Web.UI.Control.PreRenderRecursiveInternal() +171   System.Web.UI.Control.PreRenderRecursiveInternal() +171   System.Web.UI.Control.PreRenderRecursiveInternal() +171   System.Web.UI.Control.PreRenderRecursiveInternal() +171   System.Web.UI.Control.PreRenderRecursiveInternal() +171   System.Web.UI.Control.AddedControl(Control control, Int32 index) +8682853   System.Web.UI.ControlCollection.Add(Control child) +80   Telerik.Web.UI.RadFilter.CreateFilterItems() +504   Telerik.Web.UI.RadFilter.CreateControlHierarchy() +13   Telerik.Web.UI.RadFilter.CreateChildControls() +78   System.Web.UI.Control.EnsureChildControls() +87   Telerik.Web.UI.RadFilter.RecreateControl() +44   Telerik.Web.UI.RadFilter.ContainerFieldDescriptorsReady(Object sender, RadFilterFildDesciptorsEventArgs e) +27   Telerik.Web.UI.RadGrid.OnFieldDescriptorsReady(RadFilterFildDesciptorsEventArgs e) +65   Telerik.Web.UI.RadGrid.UpdateFilterControl() +130   Telerik.Web.UI.GridTableView.SavePagingData(Boolean useDataSource, GridPagingManager paging) +228   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +1001   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +500   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +57   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +114   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142   Telerik.Web.UI.GridTableView.PerformSelect() +4   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73   Telerik.Web.UI.GridTableView.DataBind() +224   Telerik.Web.UI.RadGrid.DataBind() +80   Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) +2132   Telerik.Web.UI.RadGrid.RebindForExport() +95   Telerik.Web.UI.Grid.Export.TableViewExporter.ExcelExportRenderForm(HtmlTextWriter nullWriter, Control form) +853   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +8677897   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40   Telerik.Web.UI.Grid.Export.TableViewExporter.ExcelExportRenderPage(HtmlTextWriter nullWriter, Control page) +93   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19   System.Web.UI.Page.Render(HtmlTextWriter writer) +29   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25   Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +640   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19   System.Web.UI.Page.Render(HtmlTextWriter writer) +29   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266

Aspx snippets:

<script type="text/javascript"
    //<![CDATA[ 
        function RequestStart(sender, args) { 
            if (args.get_eventTarget().indexOf("ExportToExcelButton") != -1) { 
                args.set_enableAjax(false); 
            } 
        } 
    //]]> 
    </script> 

<telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> 
     
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" onajaxrequest="RadAjaxManager1_AjaxRequest" ClientEvents-OnRequestStart="RequestStart"
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="gridClientes" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="gridClientes"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="gridClientes" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
        <ClientEvents OnRequestStart="RequestStart" /> 
    </telerik:RadAjaxManager> 

<div><telerik:RadFilter ID="RadFilter1" runat="server" FilterContainerID="gridClientes" ShowApplyButton="True" /></div
                    <telerik:RadGrid ID="gridClientes" runat="server" GridLines="None" 
                        AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True" 
                        OnSortCommand="gridClientes_SortCommand" OnPageIndexChanged="gridClientes_PageIndexChanged" OnPageSizeChanged="gridClientes_PageSizeChanged" 
                        OnNeedDataSource="gridClientes_NeedDataSource" OnItemCommand="gridClientes_ItemCommand" OnUpdateCommand="gridClientes_UpdateCommand" OnItemDataBound="gridClientes_ItemDataBound" 
                        PageSize="50"
                         <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" EditMode="InPlace"
                            <CommandItemSettings ShowExportToExcelButton="true" ExportToExcelText="Exportar a Excel" ShowRefreshButton="False" ShowAddNewRecordButton="False" /> 
                             
                            <Columns> 
                               <Columns> 
                                <telerik:GridBoundColumn DataField="Field1" SortExpression="Field1" UniqueName="Field1"></telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="Field2" SortExpression="Field2" UniqueName="Field2"></telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="Field3" SortExpression="Field3" UniqueName="Field3"></telerik:GridBoundColumn> 
                            </Columns> 
                         </MasterTableView> 
                         <ClientSettings EnableRowHoverStyle="True" ReorderColumnsOnClient="True" AllowColumnsReorder="True"
                            <ClientEvents OnRowSelected="gridClientes_OnRowSelected" /> 
                            <Selecting AllowRowSelect="True" /> 
                            <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling> 
                            <Resizing AllowColumnResize="true" /> 
                         </ClientSettings> 
                         <ExportSettings FileName="clientes"  OpenInNewWindow="True" IgnorePaging="True"  Excel-Format="ExcelML" ExportOnlyData="True"></ExportSettings> 
                         <PagerStyle AlwaysVisible="true" Position="Bottom" /> 
                    </telerik:RadGrid> 


Thanks in advance.
Nikolay Rusev
Telerik team
 answered on 03 Dec 2010
1 answer
72 views
I read a lot of posts relating to column widths, but i didn't come across what i was looking for.  Please forgive me if this is a repost.

I have a problem that can be quite clearly seen in the Scrolling demo here:
http://demos.telerik.com/aspnet-ajax/grid/examples/client/scrolling/defaultcs.aspx

Turn the static headers on and off and watch the sizes of the columns.

When i have the client scrolling + static headers turned on, my grid no longer automatically sizes the columns in a reasonable way.  I have a grid with a number of very small columns, and a couple of large descriptive ones.  With scrolling and static headers off, it looks great.  The big descriptive columns take up the majority of the space, and the smaller columns are allocated almost nothing - tight around the data.

As soon as static headers + scrolling is on, the widths are almost random.  The description columns will now only get *slightly* more than others - and none of the columns are tight around the data.  When the description fields are shrunk down, they wrap such that each row is now giant - it makes it basically unreadable.

Bottom Line:
Is there any possible way i can do something to maintain the great auto sizing, but still get static headers + scrolling?

-RP


EDIT: i feel like i should probably point out that i cannot hard code my column widths here - not even in percentages.  The number of columns being displayed, as well as the data contained within, will vary greatly.  The default auto sizing handles that perfectly, but is upset by the static + scroll.
Dimo
Telerik team
 answered on 03 Dec 2010
0 answers
114 views
Hi ALL,

        I have one treeview on left panel which will bind from database, treeview have N no. of parents and each parent have N no. of childs and each child have N number sub child.

On right side i have one textbox, when user enter some value and if it is one of treenode (Parent/Child/SubChild) then it should be selected..and on that particular selected node i need to fire treeview_nodechange event to bind right side grid.When user try to search text from textbox than treeview may be collapse or expanded, but once page load tree always be collapse.


Parent1
 
    Child11

    Child12
 
           Sub Child21

           Sub Child22
 
           Sub Child23

Parent2

     Child21

           Sub Child21

           Sub Child22

     Child22


Here on page load grid will be collapsed, when user try to search text like "Child11" then Parent1 should be expand and Child11 should be selected.

Same suppose user try to search "Sub Child22" than Parent2 and Child21 should be expand and "Sub Child21" should be selected

And in both case treeview_nodechange event should be fire.

I try this using

                   RadTreeView1.FindNodeByText(SearchText).Selected := true;

Its running properly for parent node only, while i am trying with any child or sub child node it will give me error and got the node as null.

Please help me on same.

Thanks
            
Kaushal
Top achievements
Rank 1
 asked on 03 Dec 2010
5 answers
108 views
Hello guys,

I encounter a very weird problem; I have a page which basically kills my IIS 7.5 (Win7 X32) - requesting it takes very, very long time with a non-ending message "downloading picture nfeswr;t3e4uiowugbhhzfxdcb nvdzf.hgdx ....  WebResource.axd blah...blah"; in the end IIS process blocks and I have to restart the service. Requesting the same page from the Visual Studio 2008 development server works fast and without any issues; do you have a clue about what can cause this behaviour?

Thanks,
Cris
rahul
Top achievements
Rank 1
 answered on 03 Dec 2010
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?