Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
227 views
Sir ,

I am new for telerik. Am using the  hierarchical  radgrid. But causing error when enableviewstate=false.
NeedDataSource called before ItemCommand.So my grid not able to fetch the proper data as its not gets the parentid in NeedDataSource.

If enableviewstate=true my hierarchical  radgrid working fine but the parent columns header goes disappers.

Am creating radgrid columns dynamically.

The main thing is that am not getting my parent ticket it first as NeedDatasource calling first than itemdatacommand.


Events are like this.

initializParentGrid() 

 protected void radrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
      ;;;;;;;;;;;;
bindGrid();
}

 protected void radrid 
_ItemCommand(object source, GridCommandEventArgs e)
    {

 if (e.CommandName == "ExpandCollapse")
        {
            GridTableView gtv = radrid 
.MasterTableView.Items[e.Item.ItemIndex].ChildItem.NestedTableViews[0];
            Telerik.Web.UI.DataKey gdka = radrid 
        .MasterTableView.DataKeyValues[e.Item.ItemIndex];


            hdnDetailTableIndex.Value = e.Item.ItemIndex.ToString();


            if (gdka != null)
                hdnParentTicketid.Value = gdka["ParentId"].ToString();


}


Please suggest.
Jayesh Goyani
Top achievements
Rank 2
 answered on 25 Jul 2012
10 answers
219 views
Hi,

I have 2 rad grids. First one is master and second one is detail. I can delete rows from both grids independently by pressing "Delete" button on toolbar above each grid. I also have "Refresh" buttons in toolbar of both grids.

The problem is with detail grid. When I delete item(s) the grid doesn't refresh. Calling Rebind method doesn't help. The only thing that helps is to press "Refresh" button in toolbar of master grid and select the row in master grid by mouse that was previously selected. After that I can see refreshed detail grid.

So, I don't need to press "Refresh" button in toolbar of master grid and select the row in master grid by mouse. I can refresh the master grid programmatically and only want to reselect the item that was originally selected also programmatically. I've tried this:

item.Selected = true;

But, it only visually selects the item in master grid and doesn't refresh the detail grid.

So, how to select the item in master grid programmatically in order to get the same effect as selecting it by mouse?

Thank you in advance.
Shinu
Top achievements
Rank 2
 answered on 25 Jul 2012
0 answers
100 views
Hi
I have created a web site which has Master Page.
At left side there is a tree view control. after clicking on it a HTML file must be shown on right side in the content page.
I have the html files but i don't know hot show them load them into content area.
please help me.
Tooraj
Top achievements
Rank 1
 asked on 25 Jul 2012
1 answer
105 views
Hi,

I have two line series.I set the first serie color to BLUE, then I set the second serie color to RED.
I don't know why the second serie always appear BLUE. I think this might be simple but I can't visualize the solution.
Can anyone help? The code Follows below:

private void PopulateChart3(string seriesID)
{
    RadChart1.Clear();
    SapeDBDataContext db = new SapeDBDataContext();
 
    int ID = Convert.ToInt32(seriesID);
    var windh = from p in db.SAPE_WindSeries where p.id_localidade == ID where p.valorh != null select p;
    var windp = from p in db.SAPE_WindSeries where p.id_localidade == ID where p.valorp != null select p;
 
    ChartSeries s = new ChartSeries();
    s.Type = Telerik.Charting.ChartSeriesType.Line;
    s.Appearance.LabelAppearance.Visible = false;
    s.Name = "Historic";
    s.Appearance.LineSeriesAppearance.Color = System.Drawing.Color.Blue;
 
    foreach (var wi in windh)
    {
        ChartSeriesItem item = new ChartSeriesItem();
        item.XValue = Convert.ToInt32(wi.dia);
        item.YValue = Convert.ToDouble(wi.valorh);
        s.Items.Add(item);
    }
 
    ChartSeries s2 = new ChartSeries();
    s2.Type = Telerik.Charting.ChartSeriesType.Line;
    s2.Appearance.LabelAppearance.Visible = false;
    s2.Appearance.LineSeriesAppearance.Color = System.Drawing.Color.Red;
    s2.Name = "Projected";
     
 
    foreach (var wi in windp)
    {
        ChartSeriesItem item2 = new ChartSeriesItem();
        item2.XValue = Convert.ToInt32(wi.dia);
        item2.YValue = Convert.ToDouble(wi.valorp);
        s.Items.Add(item2);
    }
 
    RadChart1.Series.Add(s);
    RadChart1.Series.Add(s2);
}

Thanks,

Marcio Nascimento
Maxime
Top achievements
Rank 1
 answered on 25 Jul 2012
1 answer
169 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
470 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
199 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
125 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
113 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
511 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?