Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
118 views
I checked following link:

http://www.telerik.com/community/forums/aspnet-ajax/grid/accessing-readonly-hidden-fields-in-edit-mode-radgrid.aspx#2292669 

but when i used given code then i got following error-

 protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e) 
    { 
        GridEditFormItem Data = (GridEditFormItem)e.Item;  
        string strHiddenField=Data.ParentItem["ProductName"].Text; 
        Hashtable ht = new Hashtable(); 
        Data.ExtractValues(ht); 
        ht.Add("ProductName", strHiddenField); 
    } 


Unable to cast object of type 'Telerik.Web.UI.GridDataItem' to type 'Telerik.Web.UI.GridEditFormItem'

Any solve it? 
Casey
Top achievements
Rank 1
 answered on 17 Sep 2012
15 answers
231 views
Did this issue come back to life in Q2? After upgrading to Q2 the issue described here was noticed in my login page which contains two radTextboxes and a radButton placed within an asp panel (default button set to radButton). If you enter a user name then use tab to enter the password, hitting enter on your keyboard (while radTextbox has focus) does nothing. Only after hitting the enter button twice or using the mouse to click back to the first textbox makes the enter key work. I tried setting the EnableSingleInputRendering to false but this did nothing. If I replace the radTextbox with an asp textbox everything works as expected.
Martin
Telerik team
 answered on 17 Sep 2012
2 answers
95 views
I have a spreadsheet-type grid using GridBoundColumn and InPlace edit and I want to do a client-side numeric validation after the user exits each cell. I am not able to use a GridNumericColumn because of issues described here. Is there some kind of OnCellExit event that I can use? Thanks.
Anthony
Top achievements
Rank 1
 answered on 17 Sep 2012
1 answer
96 views

Hi there,

              Is there any solution to this problem ?

         I have an issue in telerik control like RadLIstbox or Combobox .there is one method set_text which is not supported in the IE9 browser and other browser are working fine.

SCRIPT438: Object(RadListbox) doesn't support property or method 'set_text'
Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ScriptManager_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bAjaxControlToolkit%2c+Version%3d4.1.50731.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-US%3af8fb2a65-e23a-483b-b20e-6db6ef539a22%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2011.3.1115.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3acf16ab29-be3a-4761-9f9e-2c05ea68ff51%3a16e4e7cd%3aed16cbdc%3af7645509%3a24ee1bba%3ae330518b%3a5f39f986%3a1e771326%3ac8618e41%3aa1a4383a%3a58366029%3af46195d3%3aaa288e2d%3ae4f8f289%3a2bef5fcc%3a7165f74%3a874f8ea2%3ac172ae1e%3a9cdfc6e7%3a19620875%3a39040b5c%3af85f9819, line 3 character 83670



Ivana
Telerik team
 answered on 17 Sep 2012
5 answers
255 views
So I've been Googling this and have found various articles pertaining to it, but none of the solutions seem to work. The screen I'm working on has a grid view for vehicle listings. When a listing is edited, the user can edit the Vehicle Type, Manufacturer & Model.

When a user selects Vehicle Type, the Manufacturer DropDownList will rebind, when a user selects a Manufacturer, the Model DropDownList will rebind. Unfortunately, I keep getting this error: 'DropDownList2' has a SelectedValue which is invalid because it does not exist in the list of items.

Maybe I have the binding order mixed up. Here is my code:

<telerik:RadGrid ID="radVehicleListingGrid" runat="server" AllowAutomaticDeletes="True" AllowAutomaticUpdates="True" CssClass="AdminGridView" DataSourceID="sdsVehicleListings" GridLines="None" Skin="">
    <AlternatingItemStyle CssClass="AltRow" />
    <MasterTableView AutoGenerateColumns="False" DataSourceID="sdsVehicleListings" EditMode="PopUp" DataKeyNames="ListingID">
        <EditFormSettings CaptionDataField="ListingID" CaptionFormatString="Edit Note" EditColumn-CancelImageUrl="/Images/System-Icons/SysIco-Close.png" EditColumn-UpdateText="Save Changes" EditFormType="Template" FormCaptionStyle-CssClass="AdminEditFormCaption" FormMainTableStyle-CssClass="AdminEditFormMainTable" FormStyle-CssClass="AdminEditForm" PopUpSettings-Modal="true" PopUpSettings-Width="650px">
            <EditColumn UpdateText="Save Changes" CancelImageUrl="/Images/System-Icons/SysIco-Close.png">
            </EditColumn>
            <FormStyle CssClass="AdminEditForm"></FormStyle>
            <FormMainTableStyle CssClass="AdminEditFormMainTable"></FormMainTableStyle>
            <FormCaptionStyle CssClass="AdminEditFormCaption"></FormCaptionStyle>
            <FormTemplate>
                <asp:Panel ID="pnlAdminEditForm" runat="server" DefaultButton="btnSaveListingChanges">
                    <table border="0" cellpadding="0" cellspacing="0" class="AdminEditFormMainTable" rules="rows" style="table-layout: auto; empty-cells: show;">
                        <tbody>
                            <tr class="Row">
                                <td width="125px">
                                    Vehicle Type:
                                </td>
                                <td>
                                    <asp:DropDownList ID="DropDownList3" runat="server" AppendDataBoundItems="True" SelectedValue='<%# Bind("VehicleTypeID") %>' DataSourceID="sdsEditVehicleTypes" DataTextField="VehicleType" DataValueField="VehicleTypeiD" OnSelectedIndexChanged="EditVehicleType_SelectedIndexChange" AutoPostBack="True">
                                        <asp:ListItem Value="0">Select a vehicle type...</asp:ListItem>
                                    </asp:DropDownList>
                                     <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="DropDownList3" ErrorMessage="Please select a vehicle type."></asp:RequiredFieldValidator>
                                    <asp:ValidatorCalloutExtender ID="RequiredFieldValidator4_ValidatorCalloutExtender" runat="server" Enabled="True" TargetControlID="RequiredFieldValidator4">
                                    </asp:ValidatorCalloutExtender>
                                </td>
                            </tr>
                            <tr class="AltRow">
                                <td>
                                    Year:
                                </td>
                                <td>
                                    <asp:TextBox ID="txtEditVehicleYear" runat="server" Text='<%# Bind("VehicleYear") %>' ValidationGroup="EditListing"></asp:TextBox>
                                </td>
                            </tr>
                            <tr class="Row">
                                <td width="125px">
                                    Manufacturer:
                                </td>
                                <td>
                                    <asp:DropDownList ID="DropDownList2" runat="server" AppendDataBoundItems="True" SelectedValue='<%# Bind("ManufacturerID") %>' DataSourceID="sdsEditManufacturers" DataTextField="Manufacturer" DataValueField="ManufacturerID" OnDataBinding="EditManufacturer_Databinding" OnDataBound="EditManufacturer_DataBound" OnSelectedIndexChanged="EditManufacturer_SelectedIndexChange" AutoPostBack="True" Visible="False">
                                        <asp:ListItem Value="0">Select a manufacturer...</asp:ListItem>
                                    </asp:DropDownList>
                                     <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="DropDownList2" ErrorMessage="Please select a manufacturer."></asp:RequiredFieldValidator>
                                    <asp:ValidatorCalloutExtender ID="RequiredFieldValidator3_ValidatorCalloutExtender" runat="server" Enabled="True" TargetControlID="RequiredFieldValidator3">
                                    </asp:ValidatorCalloutExtender>
                                </td>
                            </tr>
                            <tr class="AltRow">
                                <td>
                                    Model:
                                </td>
                                <td>
                                    <asp:DropDownList ID="DropDownList1" runat="server" AppendDataBoundItems="True" SelectedValue='<%# Bind("ModelID") %>' DataSourceID="sdsEditModels" DataTextField="Model" DataValueField="ModelID" OnDataBinding="EditModel_DataBinding" OnDataBound="EditModel_DataBound">
                                        <asp:ListItem Value="0">Select a model...</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr class="Row">
                                <td>
                                    Public Price:
                                </td>
                                <td>
                                    <asp:TextBox ID="txtEditPublicPrice" runat="server" Text='<%# Bind("PublicPrice", "{0:f2}") %>' ValidationGroup="EditListing"></asp:TextBox>
                                     <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtEditPublicPrice" Display="None" ErrorMessage="Please enter a valid decimal amount with no extra symbols." ValidationGroup="EditListing" ValidationExpression="[0-9]+(\.[0-9][0-9]?)?"></asp:RegularExpressionValidator>
                                    <asp:ValidatorCalloutExtender ID="RegularExpressionValidator1_ValidatorCalloutExtender" runat="server" Enabled="True" TargetControlID="RegularExpressionValidator1">
                                    </asp:ValidatorCalloutExtender>
                                </td>
                            </tr>
                            <tr class="AltRow">
                                <td width="125px">
                                    Dealer Price:
                                </td>
                                <td>
                                    <asp:TextBox ID="txtEditDealerPrice" runat="server" Text='<%# Bind("DealerPrice", "{0:f2}") %>' ValidationGroup="EditListing"></asp:TextBox>
                                     <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtEditDealerPrice" Display="None" ErrorMessage="Please enter a valid decimal amount with no extra symbols." ValidationGroup="EditListing" ValidationExpression="[0-9]+(\.[0-9][0-9]?)?"></asp:RegularExpressionValidator>
                                    <asp:ValidatorCalloutExtender ID="RegularExpressionValidator2_ValidatorCalloutExtender" runat="server" Enabled="True" TargetControlID="RegularExpressionValidator2">
                                    </asp:ValidatorCalloutExtender>
                                </td>
                            </tr>
                            <tr class="Row">
                                <td>
                                    Show Listing:
                                </td>
                                <td>
                                    <asp:CheckBox ID="chkEditPublicListing" runat="server" Checked='<%# Bind("PublicListing") %>' ValidationGroup="EditListing" />
                                </td>
                            </tr>
                            <tr class="AltRow">
                                <td width="125px">
                                    Description:
                                </td>
                                <td>
                                    <asp:TextBox ID="txtEditDescription" runat="server" Text='<%# Bind("Description") %>' Rows="5" TextMode="MultiLine" Width="400px" ValidationGroup="EditListing"></asp:TextBox>
                                </td>
                            </tr>
                            <tr class="Row">
                                <td colspan="2">
                                    <asp:LinkButton ID="btnSaveListingChanges" runat="server" CommandArgument='<%# Bind("ListingID") %>' CommandName="Update" CssClass="SaveLinkButton" ValidationGroup="EditNoteDate">Save Changes</asp:LinkButton> <asp:LinkButton ID="btnCancelEditClinicDate" runat="server" CausesValidation="false" CommandName="Cancel" CssClass="CancelLinkButton">Cancel</asp:LinkButton>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </asp:Panel>
            </FormTemplate>
            <PopUpSettings Modal="True" Width="650px"></PopUpSettings>
        </EditFormSettings>
        <Columns>
            <telerik:GridBoundColumn DataField="VehicleType" HeaderText="Vehicle Type" SortExpression="VehicleType" UniqueName="VehicleType">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="VehicleYear" HeaderText="Year" SortExpression="Year" UniqueName="VehicleYear">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Manufacturer" HeaderText="Manufacturer" SortExpression="Manufacturer" UniqueName="Manufacturer">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Model" HeaderText="Model" SortExpression="Model" UniqueName="Model">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PublicPrice" DataType="System.Decimal" HeaderText="Public Price" SortExpression="PublicPrice" UniqueName="PublicPrice" DataFormatString="{0:c}">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="DealerPrice" DataType="System.Decimal" HeaderText="Dealer Price" SortExpression="DealerPrice" UniqueName="DealerPrice" DataFormatString="{0:c}">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PublicListing" HeaderText="Listed?" UniqueName="PublicListing" DataFormatString="<img src='/images/system-icons/tf/{0}.png' />" ItemStyle-HorizontalAlign="Center">
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn UniqueName="TemplateColumn">
                <ItemTemplate>
                    <asp:LinkButton ID="btnEditListing" runat="server" CausesValidation="false" CommandName="Edit" CssClass="EditLinkButton" Text="Edit"></asp:LinkButton>
                    <asp:HyperLink ID="lnkEditPhotos" CssClass="ImageLinkButton" NavigateUrl='<%# Eval("ListingID", "photos?lid={0}") %>' runat="server">Photos</asp:HyperLink>
                    <asp:HyperLink ID="lnkEditSpecs" CssClass="SpecLinkButton" NavigateUrl='<%# Eval("ListingID", "specs?lid={0}") %>' runat="server">Specs</asp:HyperLink>
                    <asp:LinkButton ID="btnRemoveListing" runat="server" CausesValidation="false" CommandArgument='<%# Eval("ListingID") %>' CommandName="Delete" CssClass="DeleteLinkButton" OnClientClick="javascript:return confirm('Are you sure you want to remove this this listing?');" Text="Remove"></asp:LinkButton>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Right" />
            </telerik:GridTemplateColumn>
        </Columns>
        <NoRecordsTemplate>
            You currently have no listings in the system.</NoRecordsTemplate>
    </MasterTableView><HeaderStyle CssClass="Header" />
    <ItemStyle CssClass="Row" />
</telerik:RadGrid>
 
<asp:SqlDataSource ID="sdsEditVehicleTypes" runat="server" ConnectionString="<%$ ConnectionStrings:SqlConnection %>" SelectCommand="SELECT * FROM [Vehicle Types] ORDER BY [VehicleType]"></asp:SqlDataSource>
 
<asp:SqlDataSource ID="sdsEditManufacturers" runat="server" ConnectionString="<%$ ConnectionStrings:SqlConnection %>" SelectCommand="SELECT * FROM [Manufacturers] WHERE ([VehicleTypeID] = @VehicleTypeID) ORDER BY [Manufacturer]">
    <SelectParameters>
        <asp:Parameter Name="VehicleTypeID" Type="Int32" />
    </SelectParameters>
</asp:SqlDataSource>
 
<asp:SqlDataSource ID="sdsEditModels" runat="server" ConnectionString="<%$ ConnectionStrings:SqlConnection %>" SelectCommand="SELECT * FROM [Models] WHERE ([Model] = @Model) ORDER BY [Model]">
    <SelectParameters>
        <asp:Parameter Name="Model" Type="String" />
    </SelectParameters>
</asp:SqlDataSource>
 
<asp:SqlDataSource ID="sdsVehicleListings" runat="server" ConnectionString="<%$ ConnectionStrings:SqlConnection %>" SelectCommand="SELECT * FROM [Detailed Vehicle Listings] WHERE ([DealerID] = @DealerID) AND ([Active] = 1) ORDER BY [DateTimeAdded]" DeleteCommand="UPDATE Listings SET Active = 0 WHERE (ListingID = @ListingID)" UpdateCommand="UPDATE Listings SET PublicListing = @PublicListing, VehicleTypeID = @VehicleTypeID, VehicleYear = @VehicleYear, ManufacturerID = @ManufacturerID, ModelID = @ModelID, Description = @Description, PublicPrice = @PublicPrice, DealerPrice = @DealerPrice WHERE ListingID = @ListingID">
    <DeleteParameters>
        <asp:Parameter Name="ListingID" Type="Int32" />
    </DeleteParameters>
    <SelectParameters>
        <asp:SessionParameter Name="DealerID" SessionField="DealerID" Type="Int32" />
    </SelectParameters>
    <UpdateParameters>
        <asp:Parameter Name="ListingID" Type="Int32" />
        <asp:Parameter Name="VehicleTypeID" Type="Int32" />
        <asp:Parameter Name="VehicleYear" Type="String" />
        <asp:Parameter Name="ManufacturerID" Type="Int32" />
        <asp:Parameter Name="ModelID" Type="Int32" />
        <asp:Parameter Name="Description" Type="String" />
        <asp:Parameter Name="PublicPrice" Type="Decimal" />
        <asp:Parameter Name="DealerPrice" Type="Decimal" />
        <asp:Parameter Name="PublicListing" Type="Boolean" />
    </UpdateParameters>
</asp:SqlDataSource>

Protected Sub radVehicleListingGrid_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles radVehicleListingGrid.ItemDataBound
        If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
            Dim item As GridEditableItem = e.Item
            'access/modify the edit item template settings here
            Dim ddlEditVehicleTypes As DropDownList = item.FindControl("DropDownList3")
            Dim ddlEditManufacturers As DropDownList = item.FindControl("DropDownList2")
            Dim ddlEditModels As DropDownList = item.FindControl("DropDownList1")
 
            sdsEditManufacturers.SelectParameters("VehicleTypeID").DefaultValue = ddlEditVehicleTypes.SelectedValue
            sdsEditModels.SelectParameters("ManufacturerID").DefaultValue = ddlEditManufacturers.SelectedValue
 
            sdsEditManufacturers.DataBind()
            sdsEditModels.DataBind()
 
          
        ElseIf (TypeOf e.Item Is GridDataItem AndAlso Not e.Item.IsInEditMode AndAlso Page.IsPostBack) Then
           
        End If
    End Sub


Any suggestions at all?
Kostadin
Telerik team
 answered on 17 Sep 2012
4 answers
153 views
any ideas on how to accomplish something like this?

I could create a series of icons 1-100 but that would be kinda crazy.

Thanks, Marty
moegal
Top achievements
Rank 1
 answered on 17 Sep 2012
7 answers
558 views
Hi,

RadNumericTextBox controls contains DecimalSeparator and GroupSeparator properties in NumberFormateSettings collection. But these properties are not available in RadGrid's GridNumericColumn. Unfortunately GridNumericColumn's DataFormatString property also not working correctly. How can I achieve these properties behaviour in GridNumericColumn? (Even I'm ready to develop CustomRadGrid control also.)
Kavitha
Top achievements
Rank 1
 answered on 17 Sep 2012
1 answer
73 views
HI Friends,
Can some one suggest me scroll graph example in telerik like below 
http://myinflightsales.com/Demo.aspx

Thanks,
Shakti
Shakti SIngh Dulawat
Top achievements
Rank 1
 answered on 17 Sep 2012
2 answers
75 views
Hi

I recently purchased RadControls for Asp.net ajax, and installed it on my machine. I use VS2005 and VS 2008, with .NET Framework 2.0 and 3.5 respectively. I added a RadScheduler control to one of the usercontrols in my project and added a script manager on to the control. After I run the page, I get a Sys.Application is null or not an object error, followed by many other javascript errors. I am unable to use Radcheduler's navigation events. I am not sure if its beacuse to this. please reply.
Kalina
Telerik team
 answered on 17 Sep 2012
4 answers
124 views
Is it correct that the AutoCompletebox loads the entire data, then filters it?  I would have thought that it would use a parameterized query to limit the loading. The scenario I would use this for has several thousand rows ( and always increasing).  Not sure which would be worse, making the page initially wait while everything loads, or repeated hits on the database as the user types.

Does the loaded data end up in Viewstate?  The apps Viewstate is already getting really huge.

Thanks
Ivana
Telerik team
 answered on 17 Sep 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?