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

I'm trying to select an item value from DropDownTree which impeded in a RadGrid , in the add new record in the radGrid then select the item from dropdownTree , but i can't find a way to access the radgrid cell to update its value by the  DropDownTree value , 

the scenario is get the itemCode value from DropDownTree  then search in Database to get the Item Price then put the price in the RadGrid

 Protected Sub RadDropDownTree1_EntryAdded(sender As Object, e As DropDownTreeEntryEventArgs)
        GetItemPrice(e.Entry.Value)
    End Sub
    Private Sub GetItemPrice(Item_code As Int32)
        Dim ConnString As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
        Dim conn As SqlConnection = New SqlConnection(ConnString)
        Dim command As SqlCommand = New SqlCommand()
        Dim myreader As SqlDataReader
        command.CommandText = "[dbo].[FindItemPrice]"
        command.CommandType = CommandType.StoredProcedure
        conn.Open()
        command.Connection = conn
        command.Parameters.AddWithValue("ItemCode", Item_code)

        Try
            myreader = command.ExecuteReader()

            If myreader.Read() Then
                Dim ItemGrid As RadGrid = CType(Page.Master.FindControl("MainContent").FindControl("RadGrid2"), RadGrid)



                For Each item As GridDataItem In ItemGrid.MasterTableView.Items
                    Dim tx As TextBox = TryCast(item.FindControl("Price"), TextBox)
                    tx.Text = myreader("Unit_Price")
                Next

            Else

            End If

            conn.Close()
        Catch ex As Exception
            Throw ex
        End Try
    End Sub
Attila Antal
Telerik team
 answered on 22 Oct 2021
1 answer
310 views

Ok, so I am working on a project where inside a RadWizard control I am adding dynamically creating RadDropDownList controls.

RadDropDownList ddl = new RadDropDownList() { ID = string.Format("FrmDDL{0}", i) };


I then call a method to select the selected RadDropDownListItem (Now using every method I can think of to select the value) (The RadDropDownList is passed to the method as 'r')

foreach (DropDownListItem l in r.Items)
{
    if (string.Compare(value, l.Value) == 0) 
    { 
        l.Selected = true; 
        r.SelectedIndex = i; 
        r.SelectedValue = l.Value; 
        r.SelectedText = l.Text; 
    }
    i++;
}

 

Now where it gets interesting is when you look at the generated code


<div id="FrmDDL0" class="RadDropDownList" style="width:300px;" tabindex="0">
    <span class="rddlInner">
        <span class="rddlFakeInput">X4</span>
        <span class="rddlIcon"><!-- &nbsp; --></span>
    </span>
    <div class="rddlSlide" id="FrmDDL0_DropDown" style="display:none;">
        <div class="rddlPopup rddlPopup_SI">
            <ul class="rddlList">
                <li class="rddlItem">&nbsp;</li>
                <li class="rddlItem">X1</li>
                <li class="rddlItem">X2</li>
                <li class="rddlItem">X3</li>
                <li class="rddlItem  rddlItemSelected">X4</li>
            </ul>
        </div>
    </div>
<input id="FrmDDL0_ClientState" name="FrmDDL0_ClientState" type="hidden" autocomplete="off">
</div>

You can clearly see that the _ClientState control is not populated with the selected value even though the <li> item has the 'rddlItemSelected' class. For comparison this is what it looks like if I selected a value from the RadDropDownList from the UI.


<input id="FrmDDL0_ClientState" name="FrmDDL0_ClientState" type="hidden" autocomplete="off" value="{&quot;enabled&quot;:true,&quot;logEntries&quot;:[],&quot;selectedIndex&quot;:4,&quot;selectedText&quot;:&quot;X4&quot;,&quot;selectedValue&quot;:&quot;X4&quot;}">

So the question really becomes, when using the RadWizard and its back and forward buttons, how do I persist client selection on a dynamically created RadDropDownList

 

Peter Milchev
Telerik team
 answered on 22 Oct 2021
1 answer
1.0K+ views

So basically when I run my ASP.NET project I get this error, the thing is I used to get this error with Newtonsoft.Json, so what I did I went to my web.config and checked the <bindingRedirect>

<dependentAssembly>
<assemblyIdentityname="Telerik.Web.UI" publicKeyToken="" culture="neutral" />
<bindingRedirectoldVersion="0.0.0.0-2020.2.617.45" newVersion="2020.2.617.45" />
</dependentAssembly>

So after I went to references and checked if the version matched with the web config and it did

 

 

                     
Vessy
Telerik team
 answered on 22 Oct 2021
1 answer
158 views

I have a Radgrid with AllowKeyboardNavigatin="true"

When using the Keyboard arrows to move around the grid, if the arrow comes into a RadDatePicker, or even a System.DateTime datatype, the value changes by 1 month depending on if the up or down arrow was used to enter that cell.

So

1.  The cell becomes dirty just by using the up / down arrow to go past them.

2. The cell actually changes value just by using the arrow to navigate past it.

 

Is there any work around or property I can set to keep this from happening but also allow use of the keyboard arrows?

** If you hold down the ctrl key along with the arrow key this DOES NOT happen.  This could be a hard training topic for my users.

Hopefully there is another way to do this.

Thanks.

 

Roger
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 21 Oct 2021
1 answer
119 views

I have the following RadClientDataSource:

      <telerik:RadClientDataSource runat="server" ID="rdsCounty">
         <DataSource>
            <WebServiceDataSourceSettings ServiceType="GeoJSON">
               <Select Url="Arizona.json" DataType="JSON" ContentType="application/json" />
            </WebServiceDataSourceSettings>
         </DataSource>
      </telerik:RadClientDataSource>

...which is being consumed by a RadMap (along with other RadClientDataSource controls) like so:

         <telerik:RadMap runat="server" ID="rdmTest" Width="800" Height="600">
            <ClientEvents OnShapeCreated="configureShape" OnShapeClick="clickShape" OnLoad="zoomToContiguousUSA" />
            <LayersCollection>
               <telerik:MapLayer Type="Bing" Key="my key here" />
               <telerik:MapLayer Type="Shape" ClientDataSourceID="rdsState" />
               <telerik:MapLayer Type="Shape" ClientDataSourceID="rdsCounty" />
            </LayersCollection>
         </telerik:RadMap>


Is it possible to change the URL from "Arizona.json" to "Illinois.json"? I want to do this on the client, using javascript, in response to user action. I've looked at the client side API for the RadClientDataSource and I don't see how this could be done. I could also load Illinois.json manually, but I've tried something like this:

                     map.layers[2].setDataSource(JSON.parse(IllinoisFileContents));

...but that doesn't seem to work.

Is there a proper technique for this?

Vessy
Telerik team
 answered on 21 Oct 2021
1 answer
134 views

Hello,

I have an if else condition which is covered by RadCodeBlock. When I try to bind any control as an updated control in RadCodeBlock by using RadAjaxManagerProxy, it throws below error.

For example; rcbCustomer is binded to rlCustomer. But it causes error. Because rlCustomer is in RadCodeBlock.

Here is RadCodeBlock;

                <telerik:RadCodeBlock ID="rcodeCustomer" runat="server">
                    <table class="fieldset-table">
                        <% if (User.IsInRole("ADMIN"))
                            { %>
                        <tr>
                            <td>
                                <telerik:RadLabel runat="server" Text="Customer" Font-Size="Large" ForeColor="Black" />
                            </td>
                            <td>
                                <telerik:RadLabel runat="server" Text=":" ForeColor="Black" Font-Bold="false" />
                            </td>
                            <td>
                                <telerik:RadComboBox MarkFirstMatch="true" ID="rcbCustomer" EmptyMessage="Please Select Customer" runat="server" Width="100%" DataValueField="ID" DataTextField="Name" AutoPostBack="true" OnSelectedIndexChanged="rcbCustomer_SelectedIndexChanged" />
                                <asp:RequiredFieldValidator
                                    runat="server"
                                    Display="Dynamic"
                                    ControlToValidate="rcbCustomer"
                                    ErrorMessage="Customer is required!"
                                    CssClass="validator" />
                            </td>
                            <td class="center" style="width: 100px">
                                <telerik:RadButton runat="server" ID="rbCustomerReload" ToolTip="Reload Customers" Icon-PrimaryIconCssClass="rbRefresh" BackColor="White" OnClick="rbCustomerReload_Click" />
                                <telerik:RadLinkButton runat="server" ToolTip="Add New Customer" Icon-CssClass="rbAdd" BackColor="White" Target="_blank" NavigateUrl="AdminUser.aspx" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="3">
                                <telerik:RadLabel ID="rlCustomer" runat="server" ForeColor="#333333" Font-Bold="false" Font-Size="Medium" Visible="false" />
                            </td>
                        </tr>
                        <%} %>
                    </table>
                </telerik:RadCodeBlock>

Here is RadAjaxManagerProxy;

<telerik:AjaxSetting AjaxControlID="rcbCustomer">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rlCustomer" LoadingPanelID="RadAjaxLoadingPanel" />
                    <telerik:AjaxUpdatedControl ControlID="rcbCustomerContact" LoadingPanelID="RadAjaxLoadingPanel" />
                    <telerik:AjaxUpdatedControl ControlID="rlCustomerContact" LoadingPanelID="RadAjaxLoadingPanel" />
                    <telerik:AjaxUpdatedControl ControlID="rcbCustomerAddress" LoadingPanelID="RadAjaxLoadingPanel" />
                    <telerik:AjaxUpdatedControl ControlID="rlCustomerAddress" LoadingPanelID="RadAjaxLoadingPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>

Error;

 

Could you please help?

Thanks,

Attila Antal
Telerik team
 answered on 21 Oct 2021
2 answers
303 views

I have a radgrid that gets it's data from a Stored Proc and a gridview.DataBind() .  It works as expected, but when I edit one cell and SAVE changes utilizing the Save Changes Command Button, all my "Editable" columns now seem to have newValues even if I did not edit them.

gvResults.DataSource = DAL.ExecuteDataset(30, "GetProductionDateTrackingInfo", parms.ToArray());
gvResults.DataBind();

 

Example one column is a RadDatePicker with a MinDate

 <EditItemTemplate>
                        <telerik:RadDatePicker RenderMode="Lightweight" ID="MB_Production_DatePicker" MinDate="1/1/1970" runat="server" DbSelectedDate='<%# Bind("MB_Production_Date") %>'> </telerik:RadDatePicker>
                    </EditItemTemplate>

The newValues hashtable has this column as changed eventhough I didn't click in it.

How do I set the grid to No changes so only when a user clicks on a cell and changes it shows up in the newValues hashtable?

 

Attila Antal
Telerik team
 answered on 21 Oct 2021
0 answers
114 views

Hello

I am using the RadGrid which has default filter on load data, so that when the Web page is first loaded, it presents an already-filtered data

For this MasterTableView has property FilterExpression with WHERE clause for filtering items. On this part everything is Ok but issue I have is that the filter on the column isn't checked, so f.e user doesn't know which filter is applied.

This picture above better depicts what I want to do

As you see, when filter is applied it's checkbox is checked, I'm looking for this kind of functionality only that on page load, data is already-filtered

I tried documentation but couldn't find anything related to this issue, so maybe you can help.

 

Zurab
Top achievements
Rank 1
 updated question on 20 Oct 2021
1 answer
291 views

There's difference in behavior between IE11 and Edge mode IE11 when the radEditor is used inside a window.showModalDialog

  • IE11 : work as expected
  • Edge mode IE 11  :
    • There's a flicking when a key is hit (often) or Enter (always). The window in background seems to get in front and then the showmodalDialog get back in front (by behavior design of showModalDialog). Is it caused by a bad javascript? a bad compatibility mode? Is it corrected in later Telerik version?
    • There's no glitch if we choose HTML instead of Design in the radEditor
    • There's no glitch if the radeditor is not in a window.showModalDialog (ex: opened directly inside current page)

     

 

For the moment, we cannot use a replacement for window.showModalDialog because the website use frames everywhere (as a template for navigation. Ex: frame for left menu, frame for top, frame for center content, etc) in a way that a javascript style showmodalDialog doesn't block UI interaction every where in the page (as with the IE showModalDialog). 

 

 

Context :

  • ASP.Net Classic .Net 4.7.1
  • Telerik version 2020.3.1021.45

 

Thank you for help,

Jean-François Ferland

Rumen
Telerik team
 answered on 20 Oct 2021
0 answers
96 views

I need to insert a value in a cell from another radtree value in server side but the problem is i can not know the current index when the record is new record, the 0 index update the first record not the new record

       Dim ItemGrid As RadGrid = CType(Page.Master.FindControl("MainContent").FindControl("RadGrid2"), RadGrid)
                Dim dataItm As GridDataItem = TryCast(ItemGrid.MasterTableView.Items(0), GridDataItem)
                Dim cell As TableCell = dataItm("price")
                cell.Text = Convert.ToString(myreader("Unit_Price"))
                cell.Focus()
                cell.BorderColor = Color.Red
khaled
Top achievements
Rank 1
Iron
 asked on 18 Oct 2021
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
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
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?