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

Im trying to insert a row at the bottom of Grid view with out postback
My Grid has one coloum with rad Combo

placed my Grid view and button in Update panel  and in code behined on button click add a new row to datatable and Binding It to grid view

in Upadate panel gave trigger attributes

 

<Triggers>

 

 

<asp:AsyncPostBackTrigger controlid="btnAddrw" eventname="Click" />

 

 

</Triggers>

im getting the below error as attached

if i remove the above trigger  code  row is getting added but page is getting Postback

How to fix this?

thanks, Harin

 



Richard
Top achievements
Rank 1
 answered on 16 Jan 2012
7 answers
327 views
Hi There,

I've been trying achieve the following, but could not get it done. Looking for any of your help.
  • Have two dropdown column in grid (State & County)
  • State column is bound with Object DataSource
  • County column is also bound with another Object DataSource.

But, County column is related to State. When the grid is bound with DataSource, I need to display State Name and County Name in place of their IDs (Database record would have StateID & CountyID). That's the reason I chose Dropdown columns. so that I can have simple text rendered in view mode. 

Here is what I'm doing..
  1. Assign DataSource to the grid at runtime.
  2. In the grid ItemCreated event, passing the current row's StateID to the County ODS SelectParameter.
       (by expecting that ODS would get me the list of Counties for the give StateID)

Observation:
  1. For the first row, I'm getting the County Name displayed
  2. But for the second row, its empty.

I found that, ODS Selecting event first only once (when the grid was bound), but not for all the rows.
Note: I need grid only in view mode. Not editing rows in grid.
I tried having template columns, but could not find - how to display the county name for the corresponding id. (I do not want Combo box to be displayed, only county name has to be displayed)

Pls give your helping hand to pass out from this hurdle.
If you have any other solution, pls pass it to. 

Counting upon the positive response..

<telerik:GridDropDownColumn DataField="StateID" DataSourceID="odsState"
    FilterControlAltText="Filter StateID column" HeaderText="State"
    ListTextField="DisplayText" ListValueField="ValueText" UniqueName="StateID">
</telerik:GridDropDownColumn>
 
<telerik:GridDropDownColumn DataField="CountyID" DataSourceID="odsCounty"
    FilterControlAltText="Filter CountyID column" HeaderText="County"
    ListTextField="DisplayText" ListValueField="ValueText" UniqueName="CountyID">
</telerik:GridDropDownColumn>
 
 
<asp:ObjectDataSource ID="odsState" runat="server" SelectMethod="GetStates" TypeName="MyBLL">       
</asp:ObjectDataSource>
 
<asp:ObjectDataSource ID="odsCounty" runat="server" SelectMethod="GetCounties" TypeName="MyBLL">
    <SelectParameters>
        <asp:Parameter Name="stateID" Type="String" />
    </SelectParameters>
</asp:ObjectDataSource>

protected void grid_ItemCreated(object sender, GridItemEventArgs e)
{
 
    if (e.Item is GridDataItem)
        odsCounty.SelectParameters["stateSaid"].DefaultValue = "I'm assigning the currect row's state ID here";

 //Assuming that for every row, ods selecting event would fire. But its not happening
}

Pavlina
Telerik team
 answered on 16 Jan 2012
3 answers
235 views
Hi

I have a linkbutton in the template column. I am already triggering an event on the link button press and able to get the row. I was able to highlight it but when the next row linkbutton is clicked, i need to put the previous selected to original position. I was trying to do using row id but there is no ID for row. How can I do it differently? I was also thought may be I can put arrow in the gridgroupsplittercolumn for row selected but I don't know how to get splittercolumn id for the selected row.

Any suggestion would be appreciated.

Vijai
Jayesh Goyani
Top achievements
Rank 2
 answered on 16 Jan 2012
1 answer
67 views
I have an application that manages currencies on hand for various countries.  Each group is essentially a country that consists of records for each banknote denomination.

What I want to do is have a button in the group footer for each country that:

A - Is labeled "Delete United Kingdom Pound
B - When clicked, it will run an SQL query to delete all records for that country.

I have been unable to label the button.
I have been unable to get the country code needed to run the delete query.

I am developing on a Windows 7 computer using MS Visual Studio 2010.

Please let me know if I can provide more information.

<telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
    <style type="text/css">
     .body
     {
         background:#eeeeee;
     }
     .MyBoldedRow
     {
       font-weight: bold;
       color: Red;
     }
     .MyNormalRow
     {
       font-weight: Normal;
       color: Black;
     }
     .RadTextboxClass
     {
        text-align:right;
     }
      
    </style>
</head>
    <body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <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" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
    <div>
            <asp:SqlDataSource  ID="CountryCodes" runat="server"
            ConnectionString="Data Source=W-SQL04.dlbassociates.com;Initial Catalog=DonPlanner;Integrated Security=SSPI"
            SelectCommand="SELECT 'XXXX' as CurrencyTarget_CountryCode, '<Select a Country>' as DisplayValue UNION SELECT dbo.Currency_LatestConversions_TBL.Currency_CountryCode as CountryCode, dbo.Currency_LatestConversions_TBL.Currency_CountryDesc + ' (' + dbo.Currency_LatestConversions_TBL.Currency_CountryCode + ')' as DisplayValue
                FROM dbo.Currency_LatestConversions_TBL
                LEFT OUTER JOIN dbo.Currency_TargetAmounts_TBL ON dbo.Currency_LatestConversions_TBL.Currency_CountryCode = dbo.Currency_TargetAmounts_TBL.CurrencyTarget_CountryCode
                ORDER BY DisplayValue ASC">
        </asp:SqlDataSource>
 
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:DonPlannerCS %>"
            DeleteCommand="DELETE FROM Currency_TargetAmounts_TBL WHERE CurrencyTarget_CountryCode = @CurrencyTarget_CountryCode"
            InsertCommand="INSERT INTO [Currency_TargetAmounts_TBL] ([CurrencyTarget_CountryCode], [CurrencyTarget_USDDenomination], [CurrencyTarget_USDNeeded], [CurrencyTarget_Native], [CurrencyTarget_NativeCurrent])
                Select @CurrencyTarget_CountryCode, @USDDenomination1, @USRequired1, @NativeDenom1, @CurrentCount1 UNION ALL
                Select @CurrencyTarget_CountryCode, @USDDenomination2, @USRequired2, @NativeDenom2, @CurrentCount2 UNION ALL
                Select @CurrencyTarget_CountryCode, @USDDenomination3, @USRequired3, @NativeDenom3, @CurrentCount3 UNION ALL
                Select @CurrencyTarget_CountryCode, @USDDenomination4, @USRequired4, @NativeDenom4, @CurrentCount4 UNION ALL
                Select @CurrencyTarget_CountryCode, @USDDenomination5, @USRequired5, @NativeDenom5, @CurrentCount5"
            SelectCommand="SELECT TOP (100) PERCENT
                dbo.Currency_TargetAmounts_TBL.Currency_ID,
                dbo.Currency_TargetAmounts_TBL.CurrencyTarget_CountryCode,
                dbo.Currency_LatestConversions_TBL.Currency_CountryDesc,
                dbo.Currency_TargetAmounts_TBL.CurrencyTarget_USDDenomination,
                dbo.Currency_TargetAmounts_TBL.CurrencyTarget_USDNeeded,
                dbo.Currency_TargetAmounts_TBL.CurrencyTarget_Native,
                dbo.Currency_TargetAmounts_TBL.CurrencyTarget_NativeCurrent,
                CEILING(dbo.Currency_TargetAmounts_TBL.CurrencyTarget_USDNeeded / (dbo.Currency_TargetAmounts_TBL.CurrencyTarget_Native * (1 / dbo.Currency_LatestConversions_TBL.Currency_Conversion))) AS CountNeeded
                FROM dbo.Currency_LatestConversions_TBL LEFT OUTER JOIN
                dbo.Currency_TargetAmounts_TBL ON
                dbo.Currency_LatestConversions_TBL.Currency_CountryCode = dbo.Currency_TargetAmounts_TBL.CurrencyTarget_CountryCode
                WHERE (NOT (dbo.Currency_TargetAmounts_TBL.CurrencyTarget_CountryCode IS NULL))
                ORDER BY dbo.Currency_LatestConversions_TBL.Currency_CountryDesc, dbo.Currency_TargetAmounts_TBL.CurrencyTarget_USDDenomination"
            UpdateCommand="UPDATE [Currency_TargetAmounts_TBL] SET 
                [CurrencyTarget_USDNeeded] = @CurrencyTarget_USDNeeded,
                [CurrencyTarget_Native] = @CurrencyTarget_Native,
                [CurrencyTarget_NativeCurrent] = @CurrencyTarget_NativeCurrent
                WHERE [Currency_ID]=@Currency_ID">
            <DeleteParameters>
                <asp:Parameter Name="CurrencyTarget_ID" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Type="String" Name="CurrencyTarget_CountryCode" />
 
                <asp:Parameter Type="Int32" Name="USDDenomination1" />
                <asp:Parameter Type="Int32" Name="USRequired1" />
                <asp:Parameter Type="Int32" Name="NativeDenom1" />
                <asp:Parameter Type="Int32" Name="CurrentCount1" />
 
                <asp:Parameter Type="Int32" Name="USDDenomination2" />
                <asp:Parameter Type="Int32" Name="USRequired2" />
                <asp:Parameter Type="Int32" Name="NativeDenom2" />
                <asp:Parameter Type="Int32" Name="CurrentCount2" />
 
                <asp:Parameter Type="Int32" Name="USDDenomination3" />
                <asp:Parameter Type="Int32" Name="USRequired3" />
                <asp:Parameter Type="Int32" Name="NativeDenom3" />
                <asp:Parameter Type="Int32" Name="CurrentCount3" />
 
                <asp:Parameter Type="Int32" Name="USDDenomination4" />
                <asp:Parameter Type="Int32" Name="USRequired4" />
                <asp:Parameter Type="Int32" Name="NativeDenom4" />
                <asp:Parameter Type="Int32" Name="CurrentCount4" />
 
                <asp:Parameter Type="Int32" Name="USDDenomination5" />
                <asp:Parameter Type="Int32" Name="USRequired5" />
                <asp:Parameter Type="Int32" Name="NativeDenom5" />
                <asp:Parameter Type="Int32" Name="CurrentCount5" />
 
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="CurrencyTarget_USDNeeded" />
                <asp:Parameter Name="CurrencyTarget_Native" />
                <asp:Parameter Name="CurrencyTarget_NativeCurrent" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <asp:Label ID="Label1" runat="server" Text="Don Beaty's Foreign Currency Tracker"
                Font-Bold="False" Font-Names="Calibri" Font-Size="XX-Large"></asp:Label>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticUpdates="True"
                CellSpacing="0" DataSourceID="SqlDataSource1" GridLines="None"
                BorderColor="Gray" BorderStyle="Inset">
            <MasterTableView autogeneratecolumns="False" commanditemdisplay="Top"
                datasourceid="SqlDataSource1" allowpaging="True"
                datakeynames="Currency_ID"
                PageSize="30" EditMode="InPlace" Name="Currency" showgroupfooter="True">
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
 
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
 
                <Columns>
                    <telerik:GridTemplateColumn
                        FilterControlAltText="Filter EditCommandColumn column"
                        Groupable="False"
                        UniqueName="EditCommandColumn">
 
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" CommandName="Edit" Text="Edit"></asp:LinkButton>
                        </ItemTemplate>
 
                        <EditItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Update" Text="Update"></asp:LinkButton
                             <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false" CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                        </EditItemTemplate>
 
                        <InsertItemTemplate>
                            <asp:LinkButton ID="LinkButton3" runat="server" CommandName="Insert" Text="Insert"></asp:LinkButton>
                            <asp:LinkButton ID="LinkButton4" runat="server" CausesValidation="false" CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                        </InsertItemTemplate>
 
                    </telerik:GridTemplateColumn>
 
                    <telerik:GridTemplateColumn
                        DataField="Currency_ID"
                        FilterControlAltText="Filter Currency_ID column"
                        HeaderText=""
                        SortExpression="Currency_ID"
                        UniqueName="Currency_ID">
 
                        <ItemTemplate>
                             
                        </ItemTemplate>
 
                        <EditItemTemplate>
                            <asp:Label ID="Currency_IDLabel1" runat="server" Text='<%# Bind("Currency_ID") %>'></asp:Label>
                        </EditItemTemplate>
 
                        <InsertItemTemplate></InsertItemTemplate>
 
                    </telerik:GridTemplateColumn>
 
                    <telerik:GridTemplateColumn
                        DataField="CurrencyTarget_CountryCode"
                        FilterControlAltText="Filter column column"
                        HeaderText="Country Code"
                        UniqueName="ddCountryCode">
                          
                        <ItemTemplate>
                            <asp:Label ID="CurrencyTarget_CountryCodeLabel" runat="server" Text='<%# Bind("CurrencyTarget_CountryCode") %>'></asp:Label>
                        </ItemTemplate>
 
                        <EditItemTemplate>
                            <asp:Label ID="CurrencyTarget_CountryCodeLabel1" runat="server" Text='<%# Bind("CurrencyTarget_CountryCode") %>'></asp:Label>
                        </EditItemTemplate>
 
                        <InsertItemTemplate>
                            <telerik:RadComboBox ID="CurrencyTarget_CountryCode" runat="server"
                                DataSourceID="CountryCodes" DataTextField="DisplayValue"
                                DataValueField="CurrencyTarget_CountryCode"
                                SelectedValue='<%# Bind("CurrencyTarget_CountryCode") %>'>
                            </telerik:RadComboBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Select A Country Code" ControlToValidate="CurrencyTarget_CountryCode" ValidationExpression="[^<]*"/>
                        </InsertItemTemplate>
                    </telerik:GridTemplateColumn>
 
                    <telerik:GridTemplateColumn
                        DataField="Currency_CountryDesc"
                        FilterControlAltText="Filter Currency_CountryDesc column"
                        HeaderText="Country Description"
                        SortExpression="Currency_CountryDesc"
                        UniqueName="Currency_CountryDesc">
 
                        <ItemTemplate>
                            <asp:Label ID="Currency_CountryDescLabel" runat="server" Text='<%# Bind("Currency_CountryDesc") %>'></asp:Label>
                        </ItemTemplate>
 
                        <EditItemTemplate>
                            <asp:Label ID="Currency_CountryDescLabel1" runat="server" Text='<%# Bind("Currency_CountryDesc") %>'></asp:Label>
                        </EditItemTemplate>
 
                        <InsertItemTemplate></InsertItemTemplate>
 
                    </telerik:GridTemplateColumn>
 
                    <telerik:GridTemplateColumn
                        DataField="CurrencyTarget_USDDenomination"
                        DataType="System.Int32"
                        FilterControlAltText="Filter CurrencyTarget_USDDenomination column"
                        HeaderText="USD Denomination"
                        SortExpression="CurrencyTarget_USDDenomination"
                        UniqueName="CurrencyTarget_USDDenomination">
                         
                        <ItemTemplate>
                            <asp:Label ID="CurrencyTarget_USDDenominationLabel" runat="server" Text='<%# Eval("CurrencyTarget_USDDenomination","${0:#}") %>'></asp:Label>
                        </ItemTemplate>
 
                        <EditItemTemplate>
                            <asp:Label ID="CurrencyTarget_USDDenominationLabel1" runat="server" Text='<%#  Eval("CurrencyTarget_USDDenomination", "${0:#}") %>'></asp:Label>
                        </EditItemTemplate>
 
                        <InsertItemTemplate>
                             
                            <telerik:RadNumericTextBox ID="USDDenomination1" runat="server" NumberFormat-DecimalDigits="0" Value="5" MinValue="1" CssClass="RadTextboxClass" /><br />
                            <br /><telerik:RadNumericTextBox ID="USDDenomination2" runat="server" NumberFormat-DecimalDigits="0" Value="10" MinValue="1" CssClass="RadTextboxClass"/><br />
                            <br /><telerik:RadNumericTextBox ID="USDDenomination3" runat="server" NumberFormat-DecimalDigits="0" Value="20" MinValue="1" CssClass="RadTextboxClass"/><br />
                            <br /><telerik:RadNumericTextBox ID="USDDenomination4" runat="server" NumberFormat-DecimalDigits="0" Value="50" MinValue="1" CssClass="RadTextboxClass"/><br />
                            <br /><telerik:RadNumericTextBox ID="USDDenomination5" runat="server" NumberFormat-DecimalDigits="0" Value="100" MinValue="1" CssClass="RadTextboxClass"/><br />
 
                        <br /></InsertItemTemplate>
 
                        <HeaderStyle HorizontalAlign="Right" />
 
                        <ItemStyle HorizontalAlign="Right" />
 
                    </telerik:GridTemplateColumn>
 
                    <telerik:GridTemplateColumn
                        DataField="CurrencyTarget_USDNeeded"
                        DataType="System.Int32"
                        FilterControlAltText="Filter CurrencyTarget_USDNeeded column"
                        HeaderText="USD Needed"
                        SortExpression="CurrencyTarget_USDNeeded"
                        UniqueName="CurrencyTarget_USDNeeded">
 
                        <ItemTemplate>
                            <asp:Label ID="CurrencyTarget_USDNeededLabel" runat="server" Text='<%# Bind("CurrencyTarget_USDNeeded", "${0:#}")  %>'></asp:Label>
                        </ItemTemplate>
 
                        <EditItemTemplate>
                            <telerik:RadNumericTextBox ID="CurrencyTarget_USDNeededTextBox" runat="server" NumberFormat-DecimalDigits="0" text='<%# Bind("CurrencyTarget_USDNeeded") %>' MinValue="0" CssClass="RadTextboxClass"/>
                        </EditItemTemplate>
 
                        <InsertItemTemplate>
                            <telerik:RadNumericTextBox ID="USRequired1" runat="server" NumberFormat-DecimalDigits="0" Value="10" MinValue="0" CssClass="RadTextboxClass"/><br />
                            <br /><telerik:RadNumericTextBox ID="USRequired2" runat="server" NumberFormat-DecimalDigits="0" Value="0" MinValue="0" CssClass="RadTextboxClass"/><br />
                            <br /><telerik:RadNumericTextBox ID="USRequired3" runat="server" NumberFormat-DecimalDigits="0" Value="40" MinValue="0" CssClass="RadTextboxClass"/><br />
                            <br /><telerik:RadNumericTextBox ID="USRequired4" runat="server" NumberFormat-DecimalDigits="0" Value="150" MinValue="0" CssClass="RadTextboxClass"/><br />
                            <br /><telerik:RadNumericTextBox ID="USRequired5" runat="server" NumberFormat-DecimalDigits="0" Value="300" MinValue="0" CssClass="RadTextboxClass"/><br />
                        <br /></InsertItemTemplate>
 
                        <HeaderStyle HorizontalAlign="Right" />
 
                        <ItemStyle HorizontalAlign="Right" />
 
                    </telerik:GridTemplateColumn>
 
                    <telerik:GridTemplateColumn
                        DataField="CurrencyTarget_Native"
                        DataType="System.Int32"
                        FilterControlAltText="Filter CurrencyTarget_Native column"
                        HeaderText="Foreign Denomination"
                        SortExpression="CurrencyTarget_Native"
                        UniqueName="CurrencyTarget_Native">
 
                        <ItemTemplate>
                            <asp:Label ID="CurrencyTarget_NativeLabel" runat="server" Text='<%# Bind("CurrencyTarget_Native") %>'></asp:Label>
                        </ItemTemplate>
 
                        <EditItemTemplate>
                            <telerik:RadNumericTextBox ID="CurrencyTarget_NativeTextBox" runat="server" NumberFormat-DecimalDigits="0" text='<%# Bind("CurrencyTarget_Native") %>' MinValue="1" CssClass="RadTextboxClass"/>
                        </EditItemTemplate>
 
                        <InsertItemTemplate>
                            <telerik:RadNumericTextBox ID="NativeDenom1" runat="server" NumberFormat-DecimalDigits="0" MinValue="1" CssClass="RadTextboxClass"/><br />
                            <br /><telerik:RadNumericTextBox ID="NativeDenom2" runat="server" NumberFormat-DecimalDigits="0" MinValue="1" CssClass="RadTextboxClass"/><br />
                            <br /><telerik:RadNumericTextBox ID="NativeDenom3" runat="server" NumberFormat-DecimalDigits="0" MinValue="1" CssClass="RadTextboxClass"/><br />
                            <br /><telerik:RadNumericTextBox ID="NativeDenom4" runat="server" NumberFormat-DecimalDigits="0" MinValue="1" CssClass="RadTextboxClass"/><br />
                            <br /><telerik:RadNumericTextBox ID="NativeDenom5" runat="server" NumberFormat-DecimalDigits="0" MinValue="1" CssClass="RadTextboxClass"/><br />
                        <br /></InsertItemTemplate>
 
                        <HeaderStyle HorizontalAlign="Right" />
 
                        <ItemStyle HorizontalAlign="Right" />
 
                    </telerik:GridTemplateColumn>
                     
                    <telerik:GridTemplateColumn
                        DataField="CurrencyTarget_NativeCurrent"
                        DataType="System.Decimal"
                        FilterControlAltText="Filter CurrencyTarget_NativeCurrent column"
                        HeaderText="Foreign Count On Hand"
                        SortExpression="CurrencyTarget_NativeCurrent"
                        UniqueName="CurrencyTarget_NativeCurrent">
 
                        <ItemTemplate>
                            <asp:Label ID="CurrencyTarget_NativeCurrentLabel" runat="server" Text='<%# Bind("CurrencyTarget_NativeCurrent") %>'></asp:Label>
                        </ItemTemplate>
 
                        <EditItemTemplate>
                            <telerik:RadNumericTextBox ID="CurrencyTarget_NativeCurrentLabel" runat="server" NumberFormat-DecimalDigits="0" text='<%# Bind("CurrencyTarget_NativeCurrent") %>' MinValue="0" CssClass="RadTextboxClass"/>
                        </EditItemTemplate>
 
                        <InsertItemTemplate>
                            <telerik:RadNumericTextBox ID="CurrentCount1" runat="server" Value="0" NumberFormat-DecimalDigits="0" MinValue="0" CssClass="RadTextboxClass"/><br />
                            <br /><telerik:RadNumericTextBox ID="CurrentCount2" runat="server" Value="0" NumberFormat-DecimalDigits="0" MinValue="0" CssClass="RadTextboxClass"/><br />
                            <br /><telerik:RadNumericTextBox ID="CurrentCount3" runat="server" Value="0" NumberFormat-DecimalDigits="0" MinValue="0" CssClass="RadTextboxClass"/><br />
                            <br /><telerik:RadNumericTextBox ID="CurrentCount4" runat="server" Value="0" NumberFormat-DecimalDigits="0" MinValue="0" CssClass="RadTextboxClass"/><br />
                            <br /><telerik:RadNumericTextBox ID="CurrentCount5" runat="server" Value="0" NumberFormat-DecimalDigits="0" MinValue="0" CssClass="RadTextboxClass"/><br />
                        <br /></InsertItemTemplate>
 
                        <HeaderStyle HorizontalAlign="Right" />
 
                        <ItemStyle HorizontalAlign="Right" />
 
                    </telerik:GridTemplateColumn>
 
                    <telerik:GridTemplateColumn
                        DataField="CountNeeded"
                        DataType="System.Decimal"
                        FilterControlAltText="Filter CountNeeded column"
                        HeaderText="Count Needed"
                        SortExpression="CountNeeded"
                        UniqueName="CountNeeded">
 
                        <ItemTemplate>
                            <asp:Label ID="CountNeeded" runat="server" Text='<%# Bind("CountNeeded") %>'></asp:Label>
                        </ItemTemplate>
 
                        <EditItemTemplate>
                            <asp:label ID="CountNeededTextBox" runat="server" Text='<%# Bind("CountNeeded") %>'></asp:label>
                        </EditItemTemplate>
 
                        <InsertItemTemplate></InsertItemTemplate>
 
                        <HeaderStyle HorizontalAlign="Right" />
 
                        <ItemStyle HorizontalAlign="Right" />
 
                    </telerik:GridTemplateColumn>
         
                </Columns>
 
                <GroupByExpressions>
                    <telerik:GridGroupByExpression>
                        <SelectFields>
                            <telerik:GridGroupByField FieldAlias="CountryCode" FieldName="CurrencyTarget_CountryCode" HeaderText="Country Code" />
                        </SelectFields>
                        <GroupByFields>
                            <telerik:GridGroupByField FieldAlias="CurrencyTarget_CountryCode" FieldName="CurrencyTarget_CountryCode" />
                        </GroupByFields>
                    </telerik:GridGroupByExpression>
                </GroupByExpressions>
 
                <GroupFooterTemplate>
                    <telerik:RadButton ID="RadButton1" runat="server" OnClick="RadButton1_click" Text='<%# Bind("CurrencyTarget_CountryCode") %>'>
                    </telerik:RadButton>
                </GroupFooterTemplate>
 
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                </EditFormSettings>
                <GroupHeaderItemStyle BackColor="PaleGreen" BorderColor="Black" BorderStyle="Solid" Font-Bold="True" Font-Names="Calibri" Font-Size="Medium" ForeColor="Black" />
                <AlternatingItemStyle BackColor="#D7FFD7" />
                <PagerStyle AlwaysVisible="True" BackColor="#FFC080" />
                <HeaderStyle Font-Bold="True" />
            </MasterTableView>
 
            <FilterMenu EnableImageSprites="False"></FilterMenu>
 
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
 
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>


Rick
Top achievements
Rank 1
 answered on 16 Jan 2012
7 answers
141 views
Hello Team,

I'm facing the following issue with the Telerik Rad Tree View.

I've a tree view with multiple parent and child node relations. For instance consider a node A which has 5 child nodes a,b,c,d and e. Now i've set the CheckChildNodes property of the control to true.

Now i select the node A. So it will in turn select a,b,c,d,e. I'm unchecking a,b. Then i'm doing a postback which goes to another page and shows some content pertaining to the nodes selected. Now i click the "back" button in the browser and come to the original page. So the treeview shows the node A as selected and c,d,e as selected (and a,b as unselected). Fine till now.

Now if i unselect the node A, it is selecting all its child nodes a,b,c,d,e. If i check the node A, it is unselecting all its child nodes a,b,c,d,e. Exactly opposite!

Could some one provide some insights in this issue?

Thank you.

Regards
NLV
Bozhidar
Telerik team
 answered on 16 Jan 2012
2 answers
53 views

Hi,
I have an ascx that basiocally is just a tree.
this ascx is included on aspx file.
by clicking a button I want to change the tree datasource.
i see difference using ajaxmanager and triggers. First does not work the second does.
Unfortunally i need the first case

Here is a sample
(ajax)

<%@ Register TagPrefix="qsf" TagName="RTV" Src="~/Admin/CategoriesManagement/TreeCategories.ascx" %>
 
.....
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
     
   <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>                 
           <telerik:AjaxSetting AjaxControlID="Button1">
            <UpdatedControls>               
                <telerik:AjaxUpdatedControl ControlID="CatTree1" />               
            </UpdatedControls>
           </telerik:AjaxSetting>                      
        </AjaxSettings>
    </telerik:RadAjaxManager>   
 
     <table style="width: 100%; text-align: left; background-color:#2e2e2e;" cellspacing="0" cellpadding="0">                                  
        <tr>
            <td>
                <qsf:rtv runat="server" ID="CatTree1" ></qsf:rtv>   
            </td>
        </tr>
    </table>
        
    <asp:Button ID="Button1" runat="server" Text="Button" Width="500px" />
                                        
    </form>
...

code

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
           'change its datasource
            CatTree1.setInitialPath(PathOfThreeCategory)
 End Sub



second case (triggers)

<table style="width: 100%; text-align: left; background-color:#2e2e2e;" cellspacing="0" cellpadding="0">                                   
    <tr>
        <td>
                <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                </telerik:RadScriptManager>
 
            <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                            <qsf:rtv runat="server" ID="CatTree1" ></qsf:rtv>   
                    </ContentTemplate>
                                        
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="Button1" />
                    </Triggers>
                </asp:UpdatePanel>
                                    
        </td>
    </tr>
</table>
 
 
<asp:Button ID="Button1" runat="server" Text="Button" Width="500px" />

same code behind..

Please May you tell me where i'm going wrong? Thank you

Kate
Telerik team
 answered on 16 Jan 2012
2 answers
107 views
Hi!
I have the foloowing issue:
RadColorPicker can't load its client state (NullReferenceException) if CustomValidator validation fails.
Markup:
<Telerik:RadGrid runat="server" ID="statusesGrid" OnNeedDataSource="NeedStatusesDataSource"
OnDeleteCommand="HandleDelete" OnInsertCommand="HandleInsert" OnUpdateCommand="HandleUpdate"
OnItemCommand="HandleMakeDefault"
AutoGenerateColumns="false" Width="100%">
    <MasterTableView Name="StatusesGrid" EditMode="InPlace" CommandItemDisplay="Top"
        DataKeyNames="UnitTypeStatusId" ClientDataKeyNames="UnitTypeStatusId"
    >
        <CommandItemSettings ShowAddNewRecordButton="true" AddNewRecordText="Add new status" ShowRefreshButton="false" />
        <Columns>
            <Telerik:GridEditCommandColumn UniqueName="Edit" UpdateText="Save" InsertText="Save" CancelText="Cancel" ButtonType="LinkButton" />
            <Telerik:GridBoundColumn DataField="UnitTypeStatusId" UniqueName="UnitTypeStatusId" Display="false" />
            <Telerik:GridTemplateColumn UniqueName="NameWithValidator" DataField="UnitTypeStatusName" HeaderText="Name">
                <InsertItemTemplate>
                    <Telerik:RadTextBox runat="server" ID="newNameBox" Text='<%# Bind("UnitTypeStatusName") %>' />
                    <DL:UnitTypeStatusNameValidator runat="server" ID="nameVaidator" ForeColor="Red" UnitTypeIsCurrentObject="true" ThisStatusID="0"
                        ControlToValidate="newNameBox" ValidateEmptyText="true" Display="Static"  />
                </InsertItemTemplate>
                <EditItemTemplate>
                    <Telerik:RadTextBox runat="server" ID="nameEditBox" Text='<%# Bind("UnitTypeStatusName") %>' />
                    <DL:UnitTypeStatusNameValidator runat="server" ID="nameVaidator" ForeColor="Red" UnitTypeIsCurrentObject="true" ThisStatusID='<%# Bind("UnitTypeStatusID") %>'
                        ControlToValidate="nameEditBox" ValidateEmptyText="true" Display="Static"  />
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Literal runat="server" Mode="Encode" Text='<%# Eval("UnitTypeStatusName") %>' />
                </ItemTemplate>
            </Telerik:GridTemplateColumn>
            <Telerik:GridTemplateColumn DataField="UnitTypeStatusColor" UniqueName="UnitTypeStatusColor" HeaderText="Color">
                <ItemTemplate>
                    <DL:ColorValueDisplay runat="server" Value='<%# Eval("StatusColor") %>' />
                </ItemTemplate>
                <EditItemTemplate>
                    <DL:ColorValueEditor runat="server" ID="colPicker" HtmlColor='<%# Bind("UnitTypeStatusColor") %>' />
                </EditItemTemplate>
                <InsertItemTemplate>
                    <DL:ColorValueEditor runat="server" ID="colPicker" HtmlColor='<%# Bind("UnitTypeStatusColor") %>' />
                </InsertItemTemplate>
            </Telerik:GridTemplateColumn>
            <Telerik:GridCheckBoxColumn UniqueName="AllowUnitReshedule" DataField="AllowUnitReshedule" DataType="System.Boolean"
                HeaderText="Moveable" />
            <Telerik:GridButtonColumn ButtonType="LinkButton" Text="Make default" UniqueName="MakeDefault" CommandName="MakeDefault" HeaderText="" />
            <Telerik:GridCheckBoxColumn DataField="DefaultStatus" UniqueName="DefaultStatus" HeaderText="Default" ReadOnly="true" />
            <Telerik:GridTemplateColumn UniqueName="Delete" HeaderText="">
                <ItemTemplate>
                    <asp:MultiView runat="server" ID="view" ActiveViewIndex="<%# GetViewIndexByDeletability(Container.DataItem) %>">
                        <asp:View runat="server" ID="nonDelete">
                            <span title="This status can't be deleted">Protected</span>
                        </asp:View>
                        <asp:View runat="server" ID="delete">
                            <a href='javascript:OpenDeleteDialogForUnitTypeStatus(<%# Eval("UnitTypeStatusId") %>)'>Delete</a>
                        </asp:View>
                    </asp:MultiView>
                </ItemTemplate>
                <EditItemTemplate>
                    <!-- -->
                </EditItemTemplate>
                <InsertItemTemplate>
                    <!-- -->
                </InsertItemTemplate>
            </Telerik:GridTemplateColumn>
        </Columns>
        <NoRecordsTemplate>
            No statuses defined for this unit type
        </NoRecordsTemplate>
    </MasterTableView>
 
</Telerik:RadGrid>
All this markup is in RadAjaxPanel.
The bug happens if CustomVaidator's check fails duirng item Insertion. During Item Editing it all works well.
A null reference exception happens when this bug taking place. Stack trace is below:
at Telerik.Web.UI.RadColorPicker.LoadClientState(Dictionary`2 clientState)
Thanks for your attention.



Konstantin Isaev
Top achievements
Rank 1
 answered on 16 Jan 2012
1 answer
154 views
I just deployed my first site with the RADEditor and the client does not like it.  Here is his comment:
"Also, the editor is not very user friendly at all (tinymce was way better at this point)... where are the options for it? For example, ctrl-z doesn't work in Chrome and I have to select paragraph format first before I add content or the content won't have <p> </p>... it also adds <br> when it shouldn't, and it sometimes makes urls urls (if I copy them from a browser address bar) and sometimes it doesn't and makes them just text"

ouch.

If I can't provide answers, he will make me rip this out and go back to tinymce.

Here is the editor, note that I set the newLineMode property.  Hitting Enter in IE and FF works for me.
<telerik:RadPageView ID="RadPageView2" runat="server">
    <telerik:RadEditor ID="RadEditor2" runat="server" Content='<%# Bind("habitat") %>'
        NewLineMode="P" ToolsFile="EditorTools.xml" Width="750" Height="472px">
        <ImageManager ViewPaths="~/upload" UploadPaths="~/upload" DeletePaths="~/upload" />
    </telerik:RadEditor>
</telerik:RadPageView>

Here is the toolbar.
<?xml version="1.0" encoding="utf-8" ?>
<root>
  <cssFiles>
    <item name="~/_n/css/EditorContentAreaStyles.css" />
  </cssFiles>
  <tools>
    <tool name="PastePlainText" />
    <tool name="PasteFromWord" />
    <tool name="ConvertToLower" />
  </tools>
  <tools>
    <tool name="ApplyClass" />
    <tool name="FormatBlock" />
    <tool separator="true" />
    <tool name="Bold" />
    <tool name="Italic" />
    <tool name="Underline" />
    <tool name="Superscript" />
    <tool name="Subscript" />
    <tool name="BackColor" />
    <tool name="ForeColor" />
    <tool name="InsertSymbol" />
  </tools>
  <tools>
    <tool name="JustifyLeft" />
    <tool name="JustifyCenter" />
    <tool name="JustifyRight" />
    <tool name="JustifyFull" />
    <tool separator="true" />
    <tool name="Indent" />
    <tool name="Outdent" />
    <tool separator="true" />
    <tool name="InsertUnorderedList" />
    <tool name="InsertOrderedList" />
  </tools>
  <tools>
    <tool name="ImageManager" />
    <tool name="LinkManager" />
    <tool name="Unlink" />
  </tools>
  <tools name="Tables" tab="Insert">
    <tool name="InsertTableLight" size="large" />
    <tool name="InsertTable" />
  </tools>
  <tools name="Proofing" tab="Review">
    <tool name="XhtmlValidator" size="large" />
    <tool name="FindAndReplace" />
  </tools>
</root>

and the styles.  Is there anything about this CSS that would cause the problems?
body{font-family:arial,helvetica,"helvetica neue",sans-serif !important;
font-size:82% !important;
color:#4d3345 !important;
line-height:1.6em !important;}
 
h1{color:#0085cf !important;
font-weight:normal !important;
font-size:1.8em !important;
margin:25px 0 15px 30px !important;
line-height:1.4em !important;
text-shadow:2px 2px 2px #ccc !important;}
 
h2{color:#000 !important;
font-weight:normal !important;
font-size:1.5em !important;
margin:25px 0 15px 30px !important;
line-height:1.4em !important;
text-shadow:2px 2px 2px #ccc !important;}
 
h3{color:#0085cf !important;
font-weight:normal !important;
font-style:italic !important;
font-size:1.3em !important;
margin:25px 0 15px 30px !important;
line-height:1.4em !important;
text-shadow:2px 2px 2px #ccc !important;}
 
h4{color:#0085cf !important;
font-weight:bold !important;
font-size:1.3em !important;
margin:25px 0 15px 30px !important;
line-height:1.4em;text-shadow:2px 2px 2px #ccc !important;}
 
h5{color:#000 !important;
font-weight:normal !important;
font-size:1.4em !important;
margin:25px 0 15px 0 !important;
line-height:1.4em !important;
text-align:center !important;
text-shadow:2px 2px 2px #ccc !important;}
 
h6{color:#0085cf !important;
font-style:italic !important;
font-size:1.15em !important;
margin:25px 0 15px 30px !important;
line-height:1.4em !important;
text-shadow:2px 2px 2px #ccc !important;}
 
a{color:#0085cf !important;
text-decoration:none !important;
outline:none !important;}
 
a:hover{color:#00F !important;
text-decoration:underline !important;}
 
a:visited{color:#006daa !important;}
 
a[href^="mailto:"]{display:inline-block !important;
padding-right:15px !important;
background:transparent url(/_n/i/icons/mailto.png) right no-repeat !important;}
 
.nav1 {font-size:11px !important;
line-height:14px !important;}
 
.i-r{float:right !important;
margin:20px 10px 20px 20px !important;}
 
.i-l{float:left !important;
margin:20px 20px 20px 10px !important;}
 
.i-c{display:block !important;
margin-left:auto !important;
margin-right:auto !important;
padding:10px 10px 10px 10px !important;}
 
.news{color:#0085cf !important;
font-size:1.7em !important;
line-height:1.1em !important;}
 
.bk{background:#0085cf !important;}
 
.input{color:#fff !important;
font-size:10px !important;
background-color:#006daa !important;
padding:1px !important;}
 
.input2{color:#006daa !important;
background-color:#fff !important;
padding:1px !important;}

Any help much appreciated.
Richard
Top achievements
Rank 1
 answered on 16 Jan 2012
1 answer
97 views

My Asp Panel has a usercontrol inside it...User control is dynamicaly loaded.
Asp panel is placed inside RadAjaxManager..
User control contains drop down list and text boxes..

on page load user control is loaded...
But when I change selected index of drop down list inside user control...and do a postback....I receive an error...
which says...

"Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Failed to load viewstate.  The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.  For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request."

Maria Ilieva
Telerik team
 answered on 16 Jan 2012
3 answers
73 views
Hi,

We are facing issue with RadCombo arrow image.
The width of image were getting increase for some page.

Attached the image for your reference.

I also follow the link to resolve the above issue, but still not working properly.

 http://www.telerik.com/community/forums/aspnet-ajax/combobox/radcombobox-rcbarrowcell-image-getting-cut-off-after-upgrading-to-q2-2010.aspx

i.e. adding the style

div.RadComboBox .rcbArrowCell td,
div.RadComboBox .rcbArrowCell a
{
    width: 23px !important;
}


If possible please send a small demo application with solution.


Regards,
Shirish
Shirish Lokhande
Top achievements
Rank 1
 answered on 16 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?