Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
188 views
Hi,

When I click the delete button on my RadGrid, I get this error:


Input string was not in a correct format.

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.FormatException: Input string was not in a correct format.

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:

[FormatException: Input string was not in a correct format.]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +10161267
   System.Number.ParseDecimal(String value, NumberStyles options, NumberFormatInfo numfmt) +238
   System.String.System.IConvertible.ToDecimal(IFormatProvider provider) +88
   System.Convert.ChangeType(Object value, TypeCode typeCode, IFormatProvider provider) +750
   System.Web.UI.WebControls.Parameter.GetValue(Object value, String defaultValue, TypeCode type, Boolean convertEmptyStringToNull, Boolean ignoreNullableTypeChanges) +156
   System.Web.UI.WebControls.Parameter.GetValue(Object value, Boolean ignoreNullableTypeChanges) +298
   System.Web.UI.WebControls.SqlDataSourceView.AddParameters(DbCommand command, ParameterCollection reference, IDictionary parameters, IDictionary exclusionList, String oldValuesParameterFormatString) +808
   System.Web.UI.WebControls.SqlDataSourceView.ExecuteDelete(IDictionary keys, IDictionary oldValues) +343
   System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary oldValues, DataSourceViewOperationCallback callback) +4052080
   Telerik.Web.UI.GridTableView.PerformDelete(GridEditableItem editedItem, Boolean suppressRebind) +268
   Telerik.Web.UI.GridCommandEventArgs.ExecuteCommand(Object source) +2406
   Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +185
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +70
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +142
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +70
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981


Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927

I found that this data format string is the culprit:

<telerik:GridBoundColumn DataField="Price" DataFormatString="{0:c}" DataType="System.Decimal"
            HeaderText="Price" SortExpression="Price" UniqueName="Price">
        </telerik:GridBoundColumn>

Here is all of my code:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ProductCart.ascx.cs" Inherits="UserControls_Products_ProductCart" %> 
<%--<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel> 
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">--%> 
 
<%--</telerik:RadAjaxPanel> 
--%> 
 
<telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True"  
    AllowAutomaticInserts="True" AllowAutomaticUpdates="True"  
    AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True"  
    DataSourceID="SqlDataSource1" GridLines="None"
<MasterTableView AutoGenerateColumns="False" DataKeyNames="CartID,ProductID"  
        DataSourceID="SqlDataSource1"
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
        <telerik:GridBoundColumn DataField="CartID" HeaderText="CartID" ReadOnly="True"  
            SortExpression="CartID" UniqueName="CartID" Visible="false"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="ProductID" HeaderText="ProductID"  
            ReadOnly="True" SortExpression="ProductID" UniqueName="ProductID" Visible="false">        </telerik:GridBoundColumn> 
 
              <telerik:GridDropDownColumn DataField="ProductID"  
            DataSourceID="ObjectDataSource1" HeaderText="Product"  
            ListTextField="Name" ListValueField="ID" UniqueName="procolumn1"
        </telerik:GridDropDownColumn> 
        <telerik:GridBoundColumn DataField="Price" DataFormatString="{0:c}" DataType="System.Decimal"  
            HeaderText="Price" SortExpression="Price" UniqueName="Price"
        </telerik:GridBoundColumn> 
     
        <telerik:GridBoundColumn DataField="Quantity" DataType="System.Int32"  
            HeaderText="Quantity" SortExpression="Quantity" UniqueName="Quantity"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="TimeStamp" DataType="System.DateTime"  
            HeaderText="TimeStamp" SortExpression="TimeStamp" UniqueName="TimeStamp"
        </telerik:GridBoundColumn> 
    </Columns> 
</MasterTableView> 
</telerik:RadGrid> 
<asp:SqlDataSource ID="SqlDataSource1" runat="server"  
    ConflictDetection="CompareAllValues"  
    ConnectionString="<%$ ConnectionStrings:WilliamsFireConnectionString %>"  
    DeleteCommand="DELETE FROM [product_cart] WHERE [CartID] = @original_CartID AND [ProductID] = @original_ProductID AND [Price] = @original_Price AND [Quantity] = @original_Quantity AND [TimeStamp] = @original_TimeStamp"  
    InsertCommand="INSERT INTO [product_cart] ([CartID], [ProductID], [Price], [Quantity], [TimeStamp]) VALUES (@CartID, @ProductID, @Price, @Quantity, @TimeStamp)"  
    OldValuesParameterFormatString="original_{0}"  
    SelectCommand="SELECT * FROM [product_cart] WHERE ([CartID] = @CartID)"  
    UpdateCommand="UPDATE [product_cart] SET [Price] = @Price, [Quantity] = @Quantity, [TimeStamp] = @TimeStamp WHERE [CartID] = @original_CartID AND [ProductID] = @original_ProductID AND [Price] = @original_Price AND [Quantity] = @original_Quantity AND [TimeStamp] = @original_TimeStamp"
    <DeleteParameters> 
        <asp:Parameter Name="original_CartID" Type="String" /> 
        <asp:Parameter Name="original_ProductID" Type="String" /> 
        <asp:Parameter Name="original_Price" Type="Decimal" /> 
        <asp:Parameter Name="original_Quantity" Type="Int32" /> 
        <asp:Parameter Name="original_TimeStamp" Type="DateTime" /> 
    </DeleteParameters> 
    <InsertParameters> 
        <asp:Parameter Name="CartID" Type="String" /> 
        <asp:Parameter Name="ProductID" Type="String" /> 
        <asp:Parameter Name="Price" Type="Decimal" /> 
        <asp:Parameter Name="Quantity" Type="Int32" /> 
        <asp:Parameter Name="TimeStamp" Type="DateTime" /> 
    </InsertParameters> 
    <SelectParameters> 
        <asp:SessionParameter Name="CartID" SessionField="WilliamsFireShop_CartID"  
            Type="String" /> 
    </SelectParameters> 
    <UpdateParameters> 
        <asp:Parameter Name="Price" Type="Decimal" /> 
        <asp:Parameter Name="Quantity" Type="Int32" /> 
        <asp:Parameter Name="TimeStamp" Type="DateTime" /> 
        <asp:Parameter Name="original_CartID" Type="String" /> 
        <asp:Parameter Name="original_ProductID" Type="String" /> 
        <asp:Parameter Name="original_Price" Type="Decimal" /> 
        <asp:Parameter Name="original_Quantity" Type="Int32" /> 
        <asp:Parameter Name="original_TimeStamp" Type="DateTime" /> 
    </UpdateParameters> 
</asp:SqlDataSource> 
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"  
    SelectMethod="GetAllProducts" TypeName="WilliamsProducts.WilliamsProducts"
</asp:ObjectDataSource> 
 

This also happens with the Numeric Column type. What can I do to resolve this error without removing the data format string?
Tsvetoslav
Telerik team
 answered on 01 Jul 2010
2 answers
276 views
Hi!
I am trying to assess telerik components in my project, moving from your competitor.
I am trying to replace menu with radmenu.
I successfully created new Skin, based on Simple skin and trying to add "dropdown arrow feature" for root menu items which have child items.
I have read documentation and forum. For example this topic: 

But unfortunately couldn't find solution. It seems it is impossible.
I tried to change css styles for rmExpandDown selector, but failed to do anything.

Could anybody help me with this problem. Please show example how to do this using "Simple" skin.
Kamen Bundev
Telerik team
 answered on 01 Jul 2010
3 answers
439 views
Hi,

I have binded some data to radcombobox during pageload. This is rendered as multicolumned radcomboxbox. I need to add some more data dynamically after user inputs the value.

Please let me know how to achieve ths.
The below is what I have implemented but the data is not getting inserted in the dropdow

public

 

class ItemTemplate : ITemplate

 

{

 

public void InstantiateIn(Control container)

 

{

 

Literal lit = new Literal();

 

lit.Text =

"<div class='cmb_rdFnt cmb_ltFlt'>" + "ABC" + "</div> <div class='cmb_rdFnt cmb_ltFlt cmb_sp20'>"+"DEF"+"</div>"+"<div class='cmb_rdFnt cmb_ltFlt cmb_sp20'>"+"GHI"+"</div>";

 

container.Controls.Clear();

container.Controls.Add(lit);

}
// Page_load evenet

 

if

 

(!Page.IsPostBack)

 

{

 

PaymentSelectionData pmtSelData;

 

 

for (int i = 0; i < 5; i++)

 

{

pmtSelData =

new PaymentSelectionData();

 

pmtSelData.paymentTypeDesc =

"desc1" + i.ToString();

 

lstPmtSel.Add(pmtSelData);

}

RadComboBox1.DataValueField =

"refVal";

 

RadComboBox1.DataTextField =

"paymentTypeDesc";

 

RadComboBox1.DataSource = lstPmtSel;

RadComboBox1.DataBind();

 

}

 

 

 

 

 

else

 

 

 

 

 

{

 

 

 

 

 

RadComboBoxItem item = new RadComboBoxItem();

 

item.Attributes.Add(

"info", "Hello");

 

RadComboBox1.Items.Add(item);

 

ItemTemplate i1 = new ItemTemplate();

 

i1.InstantiateIn(item);

RadComboBox1.DataBind();

 

}

Yana
Telerik team
 answered on 01 Jul 2010
2 answers
155 views
Hello.I have used ContentAreaCssFile but i see that it's not applied in the preview area.
Any ideas?
tasos
Top achievements
Rank 1
 answered on 01 Jul 2010
1 answer
104 views
Hey..

I'm using two GridDropDownColumns on my RadGrid.. Every time I add new records, it seems that the selected value returns a null value. Textboxes are okay, they work fine. Error's just with the dropdown values..

I've tried searching forums on topics like this but none of them worked..

Would really really appreciate the help.

Thank you.
Abby
Princy
Top achievements
Rank 2
 answered on 01 Jul 2010
2 answers
123 views
Need to idiot proof my editor so that on submit, it runs the spell checker.  Problem is that I can't find any javascript call to run the Editor's spell checker.  Please help.
Rumen
Telerik team
 answered on 01 Jul 2010
7 answers
127 views
HI I am not able to view the loading image in telerik:RadAjaxLoadingPanel in mozilla browser,its working fine in IE, below is my code

My requirement is need to load treeview datasource dynamically on click of button using Sitemap datasource,here i am keeping treeview inside update panel
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

        <script type="text/javascript">
            var currentLoadingPanel = null;
            var currentUpdatedControl = null;
            function RequestStart(sender, args) {
                var loadingImage = document.getElementById('<%= RadAjaxLoadingPanel1.FindControl("Image1").ClientID %>');
                var panel1 = $get("<%= Panel1.ClientID %>");
                loadingImage.style.position = "relative";
                loadingImage.style.top = (parseInt(td1.style.height) / 3) + "px";
                currentLoadingPanel = $find("<%= RadAjaxLoadingPanel1.ClientID%>");


                if (args.get_eventTarget() == "<%= imbFleetManagement.UniqueID %>") {
                    currentUpdatedControl = "<%= Panel1.ClientID %>";
                    //show the loading panel over the updated control
                    currentLoadingPanel.show(currentUpdatedControl);

                }
</script>

    </telerik:RadCodeBlock> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="imbFleetManagement">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radTvwFleetMgmnt" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
<ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />
    </telerik:RadAjaxManager>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        <div class="loading">
            <asp:Image ID="Image1" runat="server" ImageUrl="~/images/loading1.gif" AlternateText="loading" />
        </div>
    </telerik:RadAjaxLoadingPanel>
 <td align="center" valign="bottom" style="width: 104px">
                                                    <asp:ImageButton ImageUrl="~/images/top_nav_cust_manage.jpg" CssClass="topnavcust"
                                                        ID="imbCustManagement" runat="server" onmouseover="this.src='../images/top_nav_cust_manage_hover.jpg';"
                                                        onmouseout="this.src='../images/top_nav_cust_manage.jpg';" ToolTip="Customer Management"
                                                        OnClick="imbCustManagement_Click" />
                                                </td>
<asp:UpdatePanel runat="server" ID="UpdatePanel" UpdateMode="Conditional">
                                                                        <Triggers>
                                                                            <asp:AsyncPostBackTrigger ControlID="imbFleetManagement" /> </Triggers>
<ContentTemplate>
                                                                            <asp:Panel ID="Panel1" runat="server" CssClass="module1"> <asp:SiteMapDataSource ID="SiteMapDataSource1" ShowStartingNode="false" runat="server" />
                                                                                <telerik:RadTreeView ID="radTvwFleetMgmnt" DataSourceID="SiteMapDataSource1"
                                                                                    runat="server" Style="white-space: normal"
                                                                                    Skin="Vista">
 </asp:Panel>
                                                                        </ContentTemplate>
                                                                    </asp:UpdatePanel>


 <td style="height: 720px; padding-left: 7px; padding-top: 12px" valign="top">
                                                    <asp:UpdatePanel runat="server" ID="UpdatePanel2" UpdateMode="Conditional">
                                                        <Triggers>
                                                            <asp:AsyncPostBackTrigger ControlID="radTvwFleetMgmnt" />
                                                        </Triggers>
                                                        <ContentTemplate>
                                                            <asp:ContentPlaceHolder ID="ContentArea" runat="server">
                                                            </asp:ContentPlaceHolder>
                                                        </ContentTemplate>
                                                    </asp:UpdatePanel>
                                                </td>

Please help me its very urgent

Thanks in Advance!
Srinivas



<asp:UpdatePanel runat="server" ID="UpdatePanel" UpdateMode="Conditional">
                                                                        <Triggers>
                                                                            <asp:AsyncPostBackTrigger ControlID="imbFleetManagement" />



<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        <div class="loading">
            <asp:Image ID="Image1" runat="server" ImageUrl="~/images/loading1.gif" AlternateText="loading" />
        </div>
    </telerik:RadAjaxLoadingPanel>




Pavlina
Telerik team
 answered on 01 Jul 2010
1 answer
219 views
Hi, I recently bought Telerik controls.  I am getting performance issue with radgrid.

1. I implemented paging to the radgrid with 6000 records. And i created viewall option on rg402_ItemCreated to the radcombo.  When i select viewall its taking 20 sec to bind the data to the grid and after that the brower gets stuck( both Firefox 3.6.4 and IE7)  and displaying the error(Please find attached Image). Is there anyway to change the viewall option code to get the data fast. or is there anyway to improve the performance and decrease the time of records binding.

Here is my code.

.aspx code
<style type="text/css"
        .rgPageFirst, .rgPagePrev, .rgPageNext, .rgPageLast 
        { 
            display: none !important; 
        } 
        div.RadGrid_Default .rgHeader, div.RadGrid_Default th.rgResizeCol 
        { 
            background-image: none; 
        } 
    </style> 
 
    <script type="text/javascript"
        function onRequestStart(sender, args) { 
            if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 || 
                    args.get_eventTarget().indexOf("ExportToWordButton") >= 0 || 
                    args.get_eventTarget().indexOf("ExportToPdfButton") >= 0 || 
                    args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) { 
 
                args.set_enableAjax(false); 
            } 
        } 
    </script> 
 
    <div> 
        <tr> 
            <td colspan="2"
                <asp:Label runat="server" Font-Bold="true" Font-Size="14pt" ID="lblTskName"></asp:Label> 
            </td> 
        </tr> 
        <br /> 
    </div> 
    <div> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        </telerik:RadScriptManager> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
            <ClientEvents OnRequestStart="onRequestStart" /> 
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="rg402"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="rg402" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"
        </telerik:RadAjaxLoadingPanel> 
        <telerik:RadGrid ID="rg402" runat="server" AutoGenerateColumns="false" Height="550px" 
            OnNeedDataSource="rg402_NeedDataSource" Width="120%" AllowPaging="True" AllowSorting="True" 
            AllowMultiRowSelection="True" EnableHeaderContextMenu="true" GridLines="None" 
            EnableHeaderContextFilterMenu="true" AllowMultiRowEdit="true" AllowFilteringByColumn="True" 
            OnPreRender="rg402_PreRender" OnItemCreated="rg402_ItemCreated" EnableViewState="false"
            <HeaderStyle HorizontalAlign="Center" BorderWidth="1px" Font-Bold="true" Font-Size="8pt" /> 
            <ExportSettings IgnorePaging="true" ExportOnlyData="true"
                <Pdf AllowModify="false" AllowPrinting="true" PageBottomMargin="" PageFooterMargin="" 
                    PageHeaderMargin="" PageHeight="11in" PageLeftMargin="" PageRightMargin="" PageTopMargin="" 
                    PageWidth="14in" /> 
            </ExportSettings> 
            <MasterTableView DataKeyNames="orderId" CommandItemDisplay="Top" EditMode="InPlace" 
                PageSize="30"
                <CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true" 
                    ShowExportToCsvButton="true" ShowExportToPdfButton="true" ShowAddNewRecordButton="false" /> 
                <Columns> 
                    <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-Width="3%" 
                        ItemStyle-Width="3%"
                    </telerik:GridClientSelectColumn> 
                    <telerik:GridBoundColumn UniqueName="sId" HeaderText="sId" DataField="sId" Visible="false"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="orderId" HeaderText="orderId" DataField="orderId" 
                        Visible="false"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="Customer Name" HeaderText="Customer Name" DataField="Customer Name" 
                        ReadOnly="true"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="Market Name" HeaderText="Market Name" DataField="Market Name" 
                        ReadOnly="true"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="LOB" HeaderText="LOB" DataField="LOB" ReadOnly="true"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="Headend Name" HeaderText="Headend Name" DataField="Headend Name" 
                        ReadOnly="true"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="Project Name" HeaderText="Project Name" DataField="Project Name" 
                        ReadOnly="true"
                    </telerik:GridBoundColumn> 
                    <telerik:GridHyperLinkColumn UniqueName="Site Name" HeaderText="Site Name" DataTextField="Site Name"
                    </telerik:GridHyperLinkColumn> 
                    <telerik:GridBoundColumn UniqueName="Task Status" HeaderText="Task Status" DataField="Task Status" 
                        ReadOnly="true"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="Plant Test Date" HeaderText="Plant Test Date" 
                        DataField="Plant Test Date" ReadOnly="true"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="CORE CM Number" HeaderText="CORE CM Number" 
                        DataField="CORE CM Number" ReadOnly="true"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="Req SM Imp Date" HeaderText="Req SM Imp Date" 
                        DataField="Req SM Imp Date" ReadOnly="true"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="SM Ticket Number" HeaderText="SM Ticket Number" 
                        DataField="SM Ticket Number"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn UniqueName="Sch SM Imp Date" HeaderText="Sch SM Imp Date" 
                        DataField="Sch SM Imp Date"
                    </telerik:GridBoundColumn> 
                    <telerik:GridEditCommandColumn UniqueName="ECC402"
                    </telerik:GridEditCommandColumn> 
                </Columns> 
            </MasterTableView> 
            <ClientSettings EnableRowHoverStyle="true" ReorderColumnsOnClient="false" AllowDragToGroup="false" 
                AllowColumnsReorder="True"
                <Scrolling AllowScroll="true" UseStaticHeaders="true" /> 
                <Selecting AllowRowSelect="True"></Selecting> 
                <Resizing AllowRowResize="true" AllowColumnResize="True" EnableRealTimeResize="True" 
                    ResizeGridOnColumnResize="False"></Resizing> 
            </ClientSettings> 
            <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> 
        </telerik:RadGrid> 

.cs fine

protected void Page_Load(object sender, EventArgs e) 
    { 
        try 
        { 
            if (!IsPostBack) 
            { 
                Session["SearchRes"] = null; 
                if (Session["TaskName"] != null) 
                    lblTskName.Text = Session["TaskName"].ToString(); 
                Session["FilColms"] = null; 
                Session["SortExp"] = null; 
                Session["FilExp"] = null; 
                Session["ViewAll"] = null; 
                BindGrid(); 
            } 
        } 
        catch (Exception ex) 
        { 
            throw ex; 
        } 
    } 
 
    private void BindGrid() 
    { 
        try 
        { 
            DataSet dsResult = new DataSet(); 
 
            clsSearch_BL clsObj = new clsSearch_BL(); 
            clsObj.TaskID = (string)Session["TaskID"]; 
            clsObj.CustName = (string)Session["CustName"]; 
            clsObj.MarketName = (string)Session["MarketName"]; 
            clsObj.HeadendName = (string)Session["HeadendName"]; 
            clsObj.SiteName = (string)Session["SiteName"]; 
            clsObj.TaskStatus = (string)Session["TaskStatus"]; 
            clsObj.OrdType = (string)Session["OrdType"]; 
            clsObj.OrdStatus = (string)Session["OrdStatus"]; 
            clsObj.ProName = (string)Session["ProName"]; 
            clsObj.LOC = (string)Session["LOC"]; 
            clsObj.QuoteID = (string)Session["QuoteID"]; 
            clsObj.CMNumber = (string)Session["CMNumber"]; 
 
            if (Session["SearchRes"] == null) 
            { 
                dsResult = clsObj.getSearchResults_BL(clsObj); 
                Session["SearchRes"] = dsResult; 
            } 
            else 
                dsResult = (DataSet)Session["SearchRes"]; 
 
            DataView dataView = dsResult.Tables[0].DefaultView; 
            rg402.DataSource = dsResult
            //rg402.DataBind(); 
        } 
        catch (Exception ex) 
        { 
            throw ex; 
        } 
    } 
 
    protected void rg402_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
    { 
        BindGrid(); 
    } 
 
    protected void rg402_PreRender(object sender, EventArgs e) 
    { 
        rg402.MasterTableView.GetColumnSafe("RowIndicator").Display = false
 
    } 
 
    protected void rg402_ItemCreated(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridPagerItem) 
        { 
            RadComboBox combo = (e.Item as GridPagerItem).FindControl("PageSizeComboBox") as RadComboBox; 
 
            // The number of items shown when all is selected  
            int allRowsCount = int.MaxValue; 
 
            // Remove duplicates  
            RadComboBoxItem duplicate = combo.Items.FindItemByValue(allRowsCount.ToString()); 
            if (duplicate != null) 
            { 
                duplicate.Remove(); 
            } 
 
            // Create a new item for showing all  
            RadComboBoxItem item = new RadComboBoxItem("All", allRowsCount.ToString()); 
            item.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID); 
            combo.Items.Add(item); 
 
            // Set the current pagesize as the selected value  
            combo.Items.FindItemByValue(rg402.PageSize.ToString()).Selected = true
        } 
    } 


Pavlina
Telerik team
 answered on 01 Jul 2010
1 answer
142 views
I am using Subgrid (NestedTemplate) inside a Radgrid. As per the current design, ">" image is displaying for expand/collapse when we want see the subgrid content.

Is it possible to replace that ">" image with "View" text instead as a Linkbutton.

thanks

regards
Muru
Princy
Top achievements
Rank 2
 answered on 01 Jul 2010
1 answer
79 views
I have an application where the user should be able to drag nodes from a treeview to a form. It doesn't really matter what element the node gets dragged to, as long as it is dropped in the form area.
To detect where a node was dropped, I use the OnClientNodeDropping event. However, it seems that this event only fires sometimes when the receiving element is a RadTextBox! In about half of the cases, it seems like the release of the mouse button is not detected, and the user is forced to click to fire the OnClientNodeDropping event.

I have here a simple example that shows the problem. To reproduce, place the cursor in the textbox, and drag a node from the tree view to the textbox (possibly repeat). This is tested on FireFox 3.6.4.

<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title></title
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" /> 
</head> 
<body> 
    <form id="form1" runat="server"
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        <Scripts> 
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> 
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> 
        </Scripts> 
    </telerik:RadScriptManager> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
    </telerik:RadAjaxManager> 
  
    <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Office2007"
    </telerik:RadSkinManager> 
    <div style="border: 1px solid black" runat="server"
        <telerik:RadTreeView runat="server" ID="treeview" EnableDragAndDrop="true" EnableDragAndDropBetweenNodes="false" OnClientNodeDropping="NodeDropping"
            <Nodes> 
                <telerik:RadTreeNode Text="TestNode"
                </telerik:RadTreeNode> 
                <telerik:RadTreeNode Text="Skinke"
                </telerik:RadTreeNode> 
                <telerik:RadTreeNode Text="Kaj er en kage"
                </telerik:RadTreeNode> 
            </Nodes> 
        </telerik:RadTreeView> 
        <div id="Div1" style="border: 1px solid red" runat="server"
            <table style="border: 1px solid blue" runat="server" id="sometable"
                <tr> 
                    <td>Cell1</td><td>Cell2</td> 
                </tr> 
                <tr> 
                    <td>Cell3</td> 
                    <td><telerik:RadTextBox runat="server"></telerik:RadTextBox></td
                </tr> 
            </table> 
        </div> 
    </div> 
    </form> 
    <telerik:RadScriptBlock runat="server"
        <script type="text/javascript" language="javascript"
            function NodeDropping(sender, args) 
            { 
                var table = $get('<%=sometable.ClientID %>'); 
             
                var elem = args.get_htmlElement(); 
                if (!elem) return; 
                 
                while (elem != null) 
                { 
                    if (elem == table) 
                    { 
                        alert('dropped on table!'); 
                        return; 
                    } 
                    elemelem = elem.parentNode; 
                } 
                 
                alert('not dropped on table'); 
            } 
        </script> 
    </telerik:RadScriptBlock> 
</body> 
</html> 

I hope someone can help me. It seems like the problem never appears if I just use a normal <asp:textbox> control, but I really would like to keep the RadTextBox controls on the page.

Thanks,

Ulrik Rasmussen
Veli
Telerik team
 answered on 01 Jul 2010
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?