Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
171 views
I have two page 
PoliklinlList.aspx
Tanilar.ascx

I use Tanilar.ascx web user control in the Polklinik page.
Ajax manager is in the Poliklinik page.
There are two radgrid in web user controls: radTanilar and radSeciliTanilar
I want to add some value from radTanilar  to radSeciliTanilar after adding I want to show it in the page.But radSeciliTanilar  isn't refresh itself although my web user control is in the updatecontrol of ajax settings.

.

I manage to call my ajax manager from web user control like:
function TanilarRowClick(sender, eventArgs) {
            var id = eventArgs.getDataKeyValue("ID");
            document.getElementById("grdTanilarDClickedRowIndex").value = id;
            $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("taniekle");
 
        }

When I click the radTanilar  row, TanilarRowClick event run and myRadAjaxManager1_AjaxRequest which is in the PoliklinlList page is run also.

myRadAjaxManager settings like this:   (ucpTani is the Id of web user controls')
)
<telerik:RadAjaxManager ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager1_AjaxRequest"
        runat="server">
        <AjaxSettings>               
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                       <telerik:AjaxUpdatedControl ControlID="ucpTani" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>    
</telerik:RadAjaxManager>


When I add my controls(radseciliTanilar and radTanilar) which are in web user controls manually on code like this:

RadGrid grdSeciliTanilar = (RadGrid)ucpTani.FindControl("grdSeciliTanilar");
RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadAjaxManager1, grdSeciliTanilar);
RadAjaxManager1.AjaxSettings.AddAjaxSetting(grdTani, grdSeciliTanilar);

 I get error like this:

Server Error in '/' Application.
 
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
 
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:
 
 
[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
   System.Web.UI.ControlCollection.AddAt(Int32 index, Control child) +9585723
   Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) +221
 
[HttpException (0x80004005): Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error.]
   Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) +286
   Telerik.Web.UI.RadAjaxControl.PerformRender() +498
   Telerik.Web.UI.RadAjaxControl.OnPageRender(HtmlTextWriter writer, Control page) +1819
   Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +155
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +268
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1284

when I add RadAjaxManagerProxy to my user control I get the same error.



Radoslav
Telerik team
 answered on 25 Jul 2012
9 answers
479 views
I have a RadGrid control that has been created dynamically and added to the page.

I have enabled paging for it by setting AllowPaging = true.

I have also set the EnableViewState = true for both RadGrid and its MasterTableView.

I've read this page and am using NeedDataSource event already.

Now, Next Page button works fine and I can see that RadGrid_PageIndexChanged event is raised.

However, when I click the Previous Page button, it doesn't work and indeed the RadGrid_PageIndexChanged event is not raised at all!

Why? How to fix this?

Thanks,
Pavlina
Telerik team
 answered on 25 Jul 2012
3 answers
201 views

Dear All,
I am developing product in asp.net using c sharp and I have listbox in my page and i have list items in Listbox which is added staticaly here i need to insert value against partcular listbox item and i have listbox items namely List1,List2,List3,...List10.and also i have one TextBox to insert values.

but here should follow sequencing order for example does not allow inserting List3 value when not inserted List2 value .. how to control this scenario.

my aspx code is,


<telerik:RadListBox ID="radlstExtensionFields" runat="server" Width="400" AutoPostBack="true"
                       OnSelectedIndexChanged="radlstExtensionFields_SelectedIndexChanged">
                       <Items>
                           <telerik:RadListBoxItem Text="List1" runat="server" Value="0" />
                           <telerik:RadListBoxItem Text="List2" runat="server" Value="1" />
                           <telerik:RadListBoxItem Text="List3" runat="server" Value="2" />
                           <telerik:RadListBoxItem Text="List4" runat="server" Value="3" />
                           <telerik:RadListBoxItem Text="List5" runat="server" Value="4" />
                           <telerik:RadListBoxItem Text="List6" runat="server" Value="5" />
                           <telerik:RadListBoxItem Text="List7" runat="server" Value="6" />
                           <telerik:RadListBoxItem Text="List8" runat="server" Value="7" />
                           <telerik:RadListBoxItem Text="List9" runat="server" Value="8" />
                           <telerik:RadListBoxItem Text="List10" runat="server" Value="9" />
                       </Items>
                   </telerik:RadListBox>
Bozhidar
Telerik team
 answered on 25 Jul 2012
1 answer
129 views
Hello everybody,
i'd like to show a RadAjaxLoadingPanel (called via JS) over an java applet.
Unfortunately, the applet hides the LoadingPanel.
I tried to change the z-index but, it doesn't work.

For other controls in this case there is the overlay-property but the RadAjaxLoadingPanel doesn't support it.
Is there any way to show the RadAjaxLoadingPanel over an java applet?

Best Regards,
Marcel

Galin
Telerik team
 answered on 25 Jul 2012
2 answers
115 views
Hey Guys,
I have a radGrid bound to an object data source declaratively.  That source looks at a search box and a category dropdown for search parameters.  The search button calls a rebind.  Everything works great.

Until I turn grouping on.  The grouping works great on first page load, but on subsequent search button postbacks and therefore rebind() calls, there are no records found, even though that search works ok with grouping off.

Anyone know why this might be ?  Find my page below:

<fieldset>
        <legend>Search Help Centre</legend>
        <ul>
            <li>
                <label for="tbSearchText">Search text</label>
                <asp:TextBox ID="tbSearchText" runat="server" />
            </li>
            <li>
                <label for="catSelector">Category</label>
                <ah:CategorySelector ID="catSelector" runat="server" CategoryParentCat="Faq" InsertEmpty="All" />
            </li>
            <li> :</li>
            <li><label for="btnSearch"> </label><telerik:RadButton ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" /></li>
        </ul>
    </fieldset>
 
    <telerik:RadGrid ID="rgFaq" runat="server" DataSourceID="objFaq" GroupingEnabled="true" OnItemDataBound="rgFaq_ItemDataBound" AllowPaging="True" PageSize="200" AllowSorting="False" AutoGenerateColumns="False">
        <MasterTableView DataKeyNames="kbId" ShowHeader="false">
            <GroupByExpressions>
                <telerik:GridGroupByExpression>
                    <GroupByFields>
                        <telerik:GridGroupByField FieldName="CategoryId" />
                    </GroupByFields>
                </telerik:GridGroupByExpression>
            </GroupByExpressions>
            <Columns>
                <telerik:GridTemplateColumn>
                    <ItemTemplate>
                        <%#Eval("kbTitle") %>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
         
    <asp:ObjectDataSource ID="objFaq" EnablePaging="true" SelectMethod="SearchFaqList" SelectCountMethod="SearchFaqList_Count" runat="server" TypeName="ArtsHub.BLL.Faq.Faq">
        <SelectParameters>
            <asp:ControlParameter ControlID="tbSearchText" DefaultValue="" Name="searchText" Type="String" ConvertEmptyStringToNull="false" />
            <asp:ControlParameter ControlID="catSelector" PropertyName="SelectedCategoryId" Name="CategoryId" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
protected void btnSearch_Click(object sender, EventArgs e)
{
    rgFaq.DataBind();
}
 
protected void rgFaq_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridGroupHeaderItem)
    {
        GridGroupHeaderItem item = (GridGroupHeaderItem)e.Item;
        DataRowView groupDataRow = (DataRowView)e.Item.DataItem;
        item.DataCell.Text = groupDataRow["CategoryId"].ToString();
    }
}


Thanks for any help.
Simon
Top achievements
Rank 1
 answered on 25 Jul 2012
1 answer
518 views
Hi,

I have a grid in which I have a single details table. I have set the HierarchyLoadMode="Client".
In my details table I have other columns along with two GridTemplate columns, whose Itemtemplate contains RadNumeric textboxes.
For the Grid in CommandItem I ahve a RadToolBar in which I have a "Save" button.

On the "Save" button click on the server side I want to access all the column values along with the two rad numeric text box values for the DeatilsTable, in the code behind.

Please tell me how to do so. This is what I have defined for the grid

<telerik:RadGrid ID="rgBrokerageSettlements" runat="server" AutoGenerateColumns="False"
            BorderStyle="None" Width="100%" EnableLinqExpressions="false" OnNeedDataSource="rgBrokerageSettlements_NeedDataSource"
            OnItemCommand="rgBrokerageSettlements_ItemCommand"
            OnDetailTableDataBind="rgBrokerageSettlements_DetailTableDataBind">
            <MasterTableView DataKeyNames="SettlementHeaderSK" ClientDataKeyNames="SettlementHeaderSK"
                Name="rgBrokerageSettlementsMasterTable" HierarchyLoadMode="Client" AllowSorting="false"
                PagerStyle-Mode="NextPrevAndNumeric" EditMode="InPlace" TableLayout="Fixed" CommandItemDisplay="Top">
                <CommandItemTemplate>
                    <telerik:RadToolBar ID="rtbBrokerageSettlements" runat="server" Width="100%" OnButtonClick="rtbBrokerageSettlements_ButtonClick"
                        OnClientButtonClicking="rgBrokerageSettlements_OnClientButtonClicking">
                        <Items>
                            <telerik:RadToolBarButton Text="Save" ImageUrl="~/Images/save.png" Value="Save" CommandName="Save" />
                        </Items>
                    </telerik:RadToolBar>
                </CommandItemTemplate>
                <Columns>
                    <telerik:GridClientSelectColumn UniqueName="Select" HeaderStyle-Width="25px" ItemStyle-HorizontalAlign="Center"
                        HeaderStyle-HorizontalAlign="Center" />
                    <telerik:GridBoundColumn UniqueName="Document" DataField="Document" HeaderText="Document"
                        DataType="System.String">
                        <HeaderStyle Width="70px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn DataField="DocDate" HeaderText="Doc Date" UniqueName="DocDate"
                        DataType="System.String" SortExpression="DocDate" HeaderStyle-Width="70px">
                        <ItemTemplate>
                            <asp:Label ID="lblDocDate" runat="server" Text='<%# Eval("DocDate") %>' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>                   
                </Columns>
                <DetailTables>
                    <telerik:GridTableView Name="rgBrokerageSettlementsDetail" AllowFilteringByColumn="False"
                        EnableHeaderContextMenu="false">
                        <Columns>
                            <telerik:GridBoundColumn UniqueName="ItemAndDescription" DataField="ItemAndDescription"
                                HeaderText="Item" DataType="System.String">
                                <HeaderStyle Width="125px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="ItemAmt" DataField="ItemAmt" HeaderText="Item Amount"
                                DataType="System.String">
                                <HeaderStyle Width="125px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="ProgramAmt" DataField="ProgramAmt" HeaderText="Program Amt"
                                DataType="System.String">
                                <HeaderStyle Width="125px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="UnpaidAmt" DataField="UnpaidAmt" HeaderText="Unpaid Amt"
                                DataType="System.String">
                                <HeaderStyle Width="125px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn DataField="" HeaderText="Approved Amt" UniqueName="ApprovedAmt"
                                DataType="System.String" SortExpression="" HeaderStyle-Width="70px">
                                <ItemTemplate>
                                    <telerik:RadNumericTextBox ID="radnumtxtbxApprovedAmtDetailsGrid" runat="server"
                                        Width="80px" NumberFormat-NegativePattern="$ -n" NumberFormat-PositivePattern="$ n"
                                        IncrementSettings-InterceptArrowKeys="false">
                                        <ClientEvents OnBlur="radnumtxtbxApprovedAmtDetailsGrid_OnBlur" />
                                    </telerik:RadNumericTextBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn DataField="" HeaderText="Write off Amt" UniqueName="WriteOffAmt"
                                DataType="System.String" SortExpression="" HeaderStyle-Width="70px">
                                <ItemTemplate>
                                    <telerik:RadNumericTextBox ID="radnumtxtbxWriteOffAmtDetailsGrid" runat="server"
                                        Width="80px" NumberFormat-NegativePattern="$ -n" NumberFormat-PositivePattern="$ n"
                                        IncrementSettings-InterceptArrowKeys="false">
                                        <ClientEvents OnBlur="radnumtxtbxWriteOffAmtDetailsGrid_OnBlur" />
                                    </telerik:RadNumericTextBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn UniqueName="" DataField="" HeaderText="Remaining Amt" DataType="System.String">
                                <HeaderStyle Width="125px" />
                            </telerik:GridBoundColumn>
                        </Columns>
                    </telerik:GridTableView>
                </DetailTables>
            </MasterTableView>
            <ClientSettings AllowExpandCollapse="true">
                <Selecting AllowRowSelect="true" />
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                <ClientEvents OnRowSelected="rgBrokerageSettlements_RowSelected" OnRowDeselected="rgBrokerageSettlements_RowDeselected"
                    OnGridCreated="ResizeGrid" OnHierarchyExpanding="rgBrokerageSettlements_OnHierarchyExpanding"
                    OnRowSelecting="rgBrokerageSettlements_RowSelecting" />
            </ClientSettings>
        </telerik:RadGrid>
Marin
Telerik team
 answered on 25 Jul 2012
1 answer
136 views
From my searching around, I can't seem to find a definitive answer to this. I want my user-defined method to run once after the Upload button is clicked.

The FileExplorer ItemCommand event executes with ever file selected (I have EnableAsyncUpload as True). ItemCommand would cause my user-defined method to run per uploaded file, when I only want the method to run after the final upload.

I tried to keep track of RadFileExplor1.Upload.UploadedFiles.Count, thinking I could execute my method when MyCount == UploadedFiles.Count. The UploadedFiles.Count returns zero (0) on the Page_Load event (when the page is initially opened), but when Page_Load runs again on a postback (after clicking the Upload button), UploadedFiles.Count always throws a null exception.

So how do I get my method to run once immediately after the Upload button is clicked?

Thank You,
Steven
Princy
Top achievements
Rank 2
 answered on 25 Jul 2012
7 answers
318 views
1) I export radgrid to PDF fine but one column is not wide enough in PDF output. How can I increase the column size before it actually exports the data to PDF?

2) One column's values are shown as hyperlink in PDF as well as in Excel. How can I tell it to export the values as text as opposed to links when exporting the radgrid to PDF and to Excel?

Thank you.
Shinu
Top achievements
Rank 2
 answered on 25 Jul 2012
3 answers
107 views
http://www.trirand.net/demoaspnetmvc.aspx - in the 'ship name' column. It has a nice auto complete filter which I can't see in the RadControls demos, the closest I found were: http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/filteringcombo/defaultcs.aspx
Shinu
Top achievements
Rank 2
 answered on 25 Jul 2012
1 answer
113 views
Hi
We need to add an extra column to Scheduler and in that column to display the week number and some other data: http://screencast.com/t/QB0pLhgL - check yellow square
What is the best way of doing this?
For the moment we tried creating a separate table and to align (glue it) to the scheduler table, but is a bit trickier than expected.
Any help is appreciated.
Ivana
Telerik team
 answered on 24 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?