Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
61 views

I have a hierarchy grid that is populated on demand (server side) using the NeedDataSource and DetailTableDataBind events (single level detail table) based on your example provided in the documentation.

Everything works fine but I have noticed that if 2 child levels are opened/expanded at the same time the second one does not refresh correctly. When I click to expand to see the details in another row I have correct number of pages but no data in the grid.

If I only have one sub level expanded/opened at the time everything works fine – for example I close/hide the details before I open/expand another row.

What else do I need to do to fix the refresh issue.

Tsvetina
Telerik team
 answered on 07 Jun 2011
3 answers
110 views
Today i am happy to found telerik's FormDecorator to style my standard asp.net web control, and it's free, there is no reason i don't give it a try.

I open a new blank new ASP.NET 4.0 project to test, but after a 10+ times postback.
telerik control's response.write a prompt message about : ( To remove this message, please purchase a developer version )

I have Attached a screenshot below.

Below is the markup of my test project.
And i have few question,

1. Is it the RadScriptManager1 and RadSkinManager1 not include in free FormDecorator suite?
2. I have remove the RadScriptManager1 ,but it show error
:
"The control with ID 'RadFormDecorator1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it."
So, do i have to use the classic ScriptManager come from ASP.NET 4.0?

3. Where can i add my free license information for register? web.config? of place a app_license.dll in /bin folder like "De*Express" and "Comp*nentArt" ?

Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true">
    </telerik:RadSkinManager>
    <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Office2007"
        DecoratedControls="All" />
    <asp:Button ID="Button1" runat="server" Text="Button" />
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1">
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AdventureWorksLT2008ConnectionString %>"
        SelectCommand="SELECT top 10 * FROM [SalesLT].[Customer]"></asp:SqlDataSource>
    </form>
</body>
</html>

And
Default.aspx.cs
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
 
public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
}

and web.config
<?xml version="1.0"?>
<configuration>
  <connectionStrings>
    <add name="AdventureWorksLT2008ConnectionString" connectionString="Data Source=LOCALHOST\SQLEXPRESS;Initial Catalog=AdventureWorksLT2008;Integrated Security=True" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.0">
    </compilation>
    <pages>
      <controls>
        <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" />
      </controls>
    </pages>
    <httpHandlers>
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
    </httpHandlers>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
      <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
    </handlers>
  </system.webServer>
</configuration>
Lini
Telerik team
 answered on 07 Jun 2011
4 answers
125 views
HI
if i ll pass query parameter (?Id=0) value is 0 radgrid should be  opened  initinsertmode by defult orelse query  parameter (?id=10) is 10 or any value ,radgrid should be opened Correct index item in editmode by default .its all should be done in page load event.

what can i do for this?if u send me a sample application for this, it ll be very helpful to me.

nanthakumar thangavel
Top achievements
Rank 1
 answered on 07 Jun 2011
19 answers
626 views
Hi

I am using the radgrid 5.1.2.0 and I can't hide the plus and minus images in the group header. I have been following the example in this help file

ms-help://telerik.radgrid.51.Net2/telerik.radgrid.51.Net2/grdPreventGroupsExpansion.html

but it's not working

I've set the client settings on the grid like so:

<

rad:RadGrid id="dgStock" runat="server" Width="400px" Skin="Windows"

<

ClientSettings Resizing-AllowColumnResize="true" />

then i have this in the code behind

Protected Sub RadGrid1_ColumnCreated(ByVal sender As Object, ByVal e As Telerik.WebControls.GridColumnCreatedEventArgs) Handles dgStock.ColumnCreated

If TypeOf e.Column Is GridGroupSplitterColumn Then

e.Column.HeaderStyle.Width = Unit.Pixel(1)

e.Column.ItemStyle.Width = Unit.Pixel(1)

e.Column.Resizable =

False

End If

End Sub


but the expand collapse buttons are still there.

I also tried adding this code

Private Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles dgStock.PreRender

For Each column As GridColumn In dgStock.MasterTableView.RenderColumns

If (TypeOf column Is GridGroupSplitterColumn) Then

column.HeaderStyle.Width = Unit.Pixel(1)

column.ItemStyle.Width = Unit.Pixel(1)

column.Resizable =

False

End If

Next

End Sub

The grouping of the grid is achieved as shown below

<

GroupByExpressions>

<

rad:GridGroupByExpression><SelectFields>

<

rad:GridGroupByField FieldName="StockType" FieldAlias="StockType" FormatString="" HeaderText=""></rad:GridGroupByField>

</

SelectFields>

<

GroupByFields>

<

rad:GridGroupByField FieldName="StockType" FieldAlias="StockType" FormatString="" HeaderText=""></rad:GridGroupByField>

</

GroupByFields>

</

rad:GridGroupByExpression>

</

GroupByExpressions>


Many thanks for your help
andrea

Prathap
Top achievements
Rank 1
 answered on 07 Jun 2011
5 answers
98 views
Hello,
             I have a RadGrid in my page. The ID of the RadGrid is "_uxSuccession". if the id has underscore in front then the grid will not work properly that is we cannot select Row in the Grid. If the Id will not contain underscore in front then the Radgrid will  work properly that is we can select the row of the rad grid. If the id contain underscore in front then no row click event will arise after clicking the row. please help me as soon as possible.

Thanks,
Velkumar
Tsvetoslav
Telerik team
 answered on 07 Jun 2011
3 answers
106 views
Hi there,

I am sure it is something very trivial, but I've spent couple of hours on that already and I think I am missing some obvious thing at that point.

I am trying to have something similar to next demo: http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/filteringcombo/defaultcs.aspx

However, filtering just doesn't work at all. Typing in the ComboBox is not doing anything.

Here is my sample application:
<telerik:RadScriptManager ID="m1" runat="server"/>
<telerik:RadComboBox ID="b1" runat="server" AutoPostBack="true"
                AllowCustomText="true" Filter="Contains"
                Style="vertical-align: middle;" Width="100px" Label="Filter:">
   <Items>
       <telerik:RadComboBoxItem Text="None" Value="0" />
        <telerik:RadComboBoxItem Text="Contains" Value="1"/>
        <telerik:RadComboBoxItem Text="StartsWith" Value="2" />
   </Items>
</telerik:RadComboBox>
As you can see example is very simple and there is literally nothing in there.

I also tried setting DataTextField to Text or Value. Doesn't matter - still no results.
I also tried to do DataBind() from server side code to ObservableCollection<string> and Dictionary<string,string> with no results as well.

Please advise.

Thanks,
Nick
Shinu
Top achievements
Rank 2
 answered on 07 Jun 2011
1 answer
73 views
Hello,

I am setting up a grid similar to the one found at :

http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/exporting/defaultvb.aspx


Except, I would like to have the export button on the left side instead of far right. 

Is that possible?

Thank you,

Sadiq N.
Princy
Top achievements
Rank 2
 answered on 07 Jun 2011
0 answers
55 views
Retracted. Sorry to bother. 
Karl Wilkens
Top achievements
Rank 1
 asked on 07 Jun 2011
6 answers
157 views
HI,

I need to traverse through radgrid dataitems on client to perform some logic.  It looks like my code works fine in readonly and update mode, however it does not work when
I am trying to insert any item in the grid.  Basically I do not know how to get reference to the "to be inserted item".

For example, if I am inserting first item in the grid then
masterTableView.get_dataItems().length returns 0.
So the Question is:
1. how do I reference the "To be inserted item"
2. how do I get a reference an element/control inside "To be inserted item")
Please Help...

Here is my javascript function:
function getTaxableOrderSubTotal()
{
     
    var taxableOrderSubTotalAmnt = 0.00;
    var radGrid = $find('<%= RadGrid1.ClientID %>');
    var masterTableView;
    var tableViewRows;
    var length = 0;
 
    if (radGrid) {
        masterTableView = radGrid.get_masterTableView();
    }
    if (masterTableView) {
        tableViewRows = masterTableView.get_dataItems();
    }
 
    if (tableViewRows) {
        length = tableViewRows.length;
    }
 
    if (masterTableView) {
        if (length > 0) {
            for (var i = 0; i < length; i++) {
                var dataItem = masterTableView.get_dataItems()[i];
                var isLITaxable = false;
 
                if (dataItem) {
                    // 1. Get Taxable Check box value
                    var chkTxbl = dataItem.findElement("chkTaxableLI");
                    var liTotalPrice = 0.00;
 
                    if (chkTxbl && chkTxbl.checked) {
 
                        // Get Total lineITem Price:
                        // if litTotalPrice control is found the
                        //item is in readonly mode
                        // if txtTotalPrice control is found then
                        // item is in edit mode
                        if (dataItem.findElement("litTotalPrice")) {
                            liTotalPrice = dataItem.findElement("litTotalPrice").value;
                        }
                        else if (dataItem.findElement("txtTotalPrice")) {
                            liTotalPrice = dataItem.findElement("txtTotalPrice").value;
                        }
 
                        taxableOrderSubTotalAmnt = parseFloat(taxableOrderSubTotalAmnt) + parseFloat(liTotalPrice);
                    }
                }
            }
        }

    }
 
    return taxableOrderSubTotalAmnt;
}
Jeremy
Top achievements
Rank 1
 answered on 07 Jun 2011
1 answer
114 views
I am trying to rebind a "cb_SAACode" when "cb_bondClass" selected index is changed.  "cb_SAACode" seems to be rebinding but it is not refreshing on the page.  I tried to use the "FindControl" method to find "cb_SAACode" but it doesn't seem to help at all.  Attached are the code snippets. Note, this is not the full code so it will not compile. Thanks for the help.

Front-end
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script>...</script>
    </telerik:RadCodeBlock>
 
    <asp:Panel ID="pnltest" runat="server">
        <telerik:RadAjaxManager ID="RAManager1" EnableAJAX="true" runat="server" OnAjaxRequest="RAManager1_AjaxRequest">
        </telerik:RadAjaxManager>
        <asp:UpdatePanel ID="testUP" runat="server" UpdateMode="Always" class="showcreation">
            <ContentTemplate>
                <fieldset class="fieldsetwidth">
                    <table class="fTable">
                        <tr>
                            <td>
                                <asp:Label ID="lbl_BondClass" runat="server" Text="Bond Class:" />
                            </td>
                            <td>
                                <telerik:RadComboBox ID="cb_bondClass" runat="server" OnDataBinding="cb_BC_DataBinding"
                                    AutoPostBack="true" OnSelectedIndexChanged="cb_bondClass_SelectedIndexChanged"
                                    SkinID="BondClassRadComboBox">
                                    <HeaderTemplate>
                                        <ul>
                                            <li class="bondClassColOne">Bond Class </li>
                                            <li class="bondClassColTwo">Description </li>
                                        </ul>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <ul>
                                            <li class="bondClassColOne">
                                                <%# DataBinder.Eval(Container, "Text")%>
                                            </li>
                                            <li class="bondClassColTwo">
                                                <%# DataBinder.Eval(Container, "Attributes['Description']")%>
                                            </li>
                                        </ul>
                                    </ItemTemplate>
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </ContentTemplate>
        </asp:UpdatePanel>
    </asp:Panel>
    <telerik:RadPanelBar ID="rpb_BondCreation" runat="server" ExpandMode="MultipleExpandedItems"
        Width="727" Skin="Simple">
        <Items>
            <telerik:RadPanelItem Text="Statistics" Expanded="false" runat="server">
                <Items>
                    <telerik:RadPanelItem Value="Statistics" runat="server">
                        <ContentTemplate>
                            <table class="formContent" cellspacing="1">
                                <tr>
                                    <td>
                                        <asp:ValidationSummary ID="ValidationSummary2" runat="server" HeaderText="There were errors on the page:"
                                            DisplayMode="BulletList" ShowMessageBox="true" ValidationGroup="vg_btn_CalculatePremium"
                                            ShowSummary="false" />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <table>
                                            <tr>
                                                <td>
                                                    <asp:Label ID="lbl_SAACode" runat="server" Text="SAA Code:" />
                                                </td>
                                                <td>
                                                    <telerik:RadComboBox ID="cb_SAACode" runat="server" HighlightTemplatedItems="true"
                                                        Skin="Simple" DropDownWidth="600px" EnableLoadOnDemand="True" Width="100px" OnClientSelectedIndexChanged="fillSAACode"
                                                        OnDataBound="cb_SAACode_DataBound">
                                                        <HeaderTemplate>
                                                            <table>
                                                                <tr>
                                                                    <td style="width: 50px">
                                                                        SAA
                                                                    </td>
                                                                    <td style="width: 300px">
                                                                        DESC
                                                                    </td>
                                                                    <td style="width: 150px">
                                                                        GENERAL
                                                                    </td>
                                                                    <td style="width: 100px">
                                                                        RATECLASS
                                                                    </td>
                                                                    <td style="visibility: collapse;">
                                                                        SAACODEEFF
                                                                    </td>
                                                                    <td style="visibility: collapse;">
                                                                        SAACODEDIS
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <table>
                                                                <tr>
                                                                    <td style="width: 150px" id="saaVal">
                                                                        <%# DataBinder.Eval(Container, "Value")%>
                                                                    </td>
                                                                    <td style="width: 200px" id="saaDesc">
                                                                        <%# DataBinder.Eval(Container, "Text")%>
                                                                    </td>
                                                                    <td style="width: 150px" id="saaClass">
                                                                        <%# DataBinder.Eval(Container, "Attributes['GENERAL']")%>
                                                                    </td>
                                                                    <td style="width: 50px" id="saaRate">
                                                                        <%# DataBinder.Eval(Container, "Attributes['RATECLASS']")%>
                                                                    </td>
                                                                    <td style="visibility: collapse;">
                                                                        <%# DataBinder.Eval(Container, "Attributes['SAACODEEFF']")%>
                                                                    </td>
                                                                    <td style="visibility: collapse;">
                                                                        <%# DataBinder.Eval(Container, "Attributes['SAACODEDIS']")%>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </ItemTemplate>
                                                    </telerik:RadComboBox>
                                                    <asp:RequiredFieldValidator ID="saacodevalidator" runat="server" ControlToValidate="cb_SAACode"
                                                        ValidationGroup="vg_btn_process" ErrorMessage="SAA Code is required." Display="None">
                                                    </asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                            <%# DataBinder.Eval(Container, "Value")%>
                        </ContentTemplate>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
        </Items>
    </telerik:RadPanelBar>
</asp:Content>


Back-end
namespace BSGSuretyRewrite.BondCreation
{
    [System.Web.Script.Services.ScriptService]
    public partial class BondCreation : System.Web.UI.Page
    {
        public string mError = string.Empty;
 
        public string sRollback = Environment.NewLine + " IF @@error <> 0  BEGIN ROLLBACK TRANSACTION RETURN END " + Environment.NewLine;
 
        public string qBType;
 
        protected void Page_Load(object sender, EventArgs e)
        {
            
            if (!Page.IsPostBack)
            {
                cb_IssuedBy.DataBind();
                ddl_TerminationProvisions.Attributes.Add("onChange", "onSelect();");
                this.btn_ClearAddress.Attributes["onClick"] = "return false;";
                cb_SameAddress.Attributes.Add("onclick", "javascript:OnCheck_Changed(this);");
 
                int bidNum = int.Parse(Request.QueryString["BidNum"]);
                qBType = Request.QueryString["bType"];
 
                cb_bondClass.DataBind();
                RadPanelItem item = (RadPanelItem)rpb_BondCreation.FindItemByValue("Statistics");
                RadComboBox combo = (RadComboBox)item.FindControl("cb_SAACode");
                combo.DataBind();
            }
        }
 
 
 
        protected void cb_bondClass_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            if (txt_BondType.Text == "Commercial")
                cb_Risk.DataBind();
 
            ClearSAAcode();
        }
 
 
        protected void ClearSAAcode()
        {
            RadPanelItem item = (RadPanelItem)rpb_BondCreation.FindItemByValue("Statistics");
            RadComboBox combo = (RadComboBox)item.FindControl("cb_SAACode");
            combo.Items.Clear();
            combo.DataBind();
 
            txt_SAADescription.Text = string.Empty;
            txt_SAAClass.Text = string.Empty;
            txt_RateClass.Text = string.Empty;
        }
 
        protected void cb_SAACode_DataBound(object sender, EventArgs e)
        {
            RadComboBox SAArcb = (RadComboBox)sender;
            if (SAArcb.Items.Count != 0)
            {
                SAArcb.Items.Clear();
                SAArcb.Text = string.Empty;
            }
 
            int bondType = -1;
            if (qBType == "Commercial")
                bondType = 1;
            else
                bondType = 0;
 
            List<Saa> mySAA = UtilityBond.GetSAACodeListByTypeandClass(cb_bondClass.SelectedValue, bondType);
 
            foreach (Saa s in mySAA)
            {
                RadComboBoxItem item = new RadComboBoxItem();
                item.Text = s.SAA_CODE.ToString();
                item.Value = s.SAA_DESC;
                item.Attributes.Add("GENERAL", s.GENERAL);
                item.Attributes.Add("RATECLASS", s.RATECLASS ?? "");
                item.Attributes.Add("SAACODEEFF", s.ClsCodeEff.ToString() ?? "");
                item.Attributes.Add("SAACODEDIS", s.ClsCodeDisable.ToString() ?? "");
                SAArcb.Items.Add(item);
                item.DataBind();
            }
            RadComboBoxItem item1 = new RadComboBoxItem();
            SAArcb.Items.Insert(0, item1);
        }
    }
}

Lukus
Top achievements
Rank 1
 answered on 06 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?