Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
239 views
     How can I use one of the Telerik toolbar images for a custom toolbar button?
Jim
Top achievements
Rank 1
 answered on 10 May 2018
6 answers
274 views
Hi,

I am using RadclientDatasource to bind data unto grid. it is working fine. but i want to pass parameter based on selection. Please check my code and let me know how to pass parameter while selecting and Inserting

<telerik:RadClientDataSource ID="RadClientDataSource1" runat="server" AllowBatchOperations="True">
            <ClientEvents OnCustomParameter="ParameterMap" OnDataParse="Parse" OnRequestFailed="rg_OnRequestFailed" />
            <DataSource>
                <WebServiceDataSourceSettings BaseUrl="/BackStage/BackStageWCFService.svc/">
                    <Select Url="getLocation" DataType="JSON" />                   
                    <Insert Url="InsertLocation" DataType="JSON" />                
                </WebServiceDataSourceSettings>
            </DataSource>
            <Schema>
                <Model ID="att_typ_id">
                    <telerik:ClientDataSourceModelField FieldName="prt_loc_id" DataType="Number" />
                    <telerik:ClientDataSourceModelField FieldName="effective_date" DataType="Date" />
                    <telerik:ClientDataSourceModelField FieldName="termination_date" DataType="String" />
                    <telerik:ClientDataSourceModelField FieldName="rep_loc_code" DataType="String" />
                    <telerik:ClientDataSourceModelField FieldName="rep_loc_id" DataType="Number" />
                    <telerik:ClientDataSourceModelField FieldName="pln_prt_id" DataType="Number" />
                </Model>
            </Schema>
        </telerik:RadClientDataSource>

Javascript
-------------
function ParameterMap(sender, args) {
               
               if (args.get_type() == "read") {                  
                    args.set_parameterFormat({ customersJSON: kendo.stringify(args.get_data().models) });
                }             
            }

Appcode
-------------
<WebGet()> _
<AspNetCacheProfile("NoCache")> _
    Public Function getLocation() As LocationResult
        Dim entities As New EnrollmentEntities()
        Return New LocationResult() With { _
          .Data = entities.PART_REPORTING_LOCATIONS.Where(Function(d) d.PRT_LOC_ID = Here need to pass parameter).ToList().[Select](Function(c) New ServiceLocations() With { _
           .prt_loc_id = c.PRT_LOC_ID, _
           .termination_date = If(HttpUtility.HtmlEncode(c.TERMINATION_DATE) IsNot Nothing, HttpUtility.HtmlEncode(c.TERMINATION_DATE.Value.ToString("MM-dd-yyyy")), ""), _
           .effective_date = c.EFFECTIVE_DATE, _
           .rep_loc_code = HttpUtility.HtmlEncode(c.LEVEL_REP_LOC.REP_LOC_CODE), _
           .rep_loc_id = c.REP_LOC_ID, _
           .pln_prt_id = c.PLN_PRT_ID _
         }).ToList(), _
          .Count = 100 _
        }
    End Function


Please check my code and help ASAP


Thanks in advance,
Dhamu
Marin Bratanov
Telerik team
 answered on 10 May 2018
0 answers
120 views

Hi,

            I am using RadWizard inside a RadWindow where I need to get the wizard shld get resize as the window is resized and this two controls should be responsive on all devices(Mobile). Please help me with a sample . I have checked this example https://demos.telerik.com/aspnet-ajax/wizard/application-scenarios/radwizard-in-radwindow/defaultcs.aspx.

But in this example the wizard is not changing as window is resized.

Please help me ASAP.

 

 

Thanks,

Shabana

 

 

Shabana
Top achievements
Rank 1
 asked on 10 May 2018
7 answers
136 views

Not working for some reason in version 2012.3.1308.35

Getting different error details but essentially boils down to 0x800a139e - JavaScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException:  is neither a DataColumn nor a DataRelation for table .

MasterTableView has AllowFilteringByColumn = "true"...

DataTextField is set to column name from datatable so binding works fine...

Using inside usercontrol with RadAjaxManager (Not the Proxy control)

Becoming a frustrating thing...lol

Any Ideas???

Thanks,

Tim

 

Attila Antal
Telerik team
 answered on 09 May 2018
0 answers
98 views
Hello,
I'm attempting to call SetFocus()  explicitly for a Telerik rad editor control over the Tab key press and button click event as well. 
It's working for another browser but in chrome SetFocus() work only first time after that SetFocus() is not working.
Rohan
Top achievements
Rank 1
 asked on 09 May 2018
9 answers
721 views
Hi,

I have a RadGrid and we are doing some client side operations on it. But After Paging I am losing all the operations what we did previously using javascript. Help me so that all functionality remains unchanged after paging. Help me solving this. Here I will explain:


I have a Radgrid with one checkbox and one text box (By Default it will be "0"). using javascript If I check a checkbox the text in textbox must be changed to "100". If I did these operations and click paging and get return from paging all the functionality is missing and get reset.

Help me how can we achieve this without losing functionality after paging.

Thanks.

 
Scott
Top achievements
Rank 2
 answered on 09 May 2018
3 answers
159 views
Hi,

Find checkbox in the header of the RadGrid. I am looking for c# code. I am having the button outside radgrid. I am looping through the dataitem to find other columns.

I need to find am method to find the contorl in the header.

Thanks in advance.


Angie
Top achievements
Rank 1
 answered on 08 May 2018
1 answer
73 views

We have updated Telerik from 2010.3.1109.35 to 2018.1.177.45 and also our Website from .NET 3.5 to .NET 4.7

We now find that our AJAX driven paging on our User Controls is no longer working and it ends up just posting back rather than updating the User Control.

For example, when clicking the Page Right button or jumping to a page the Loading Panel is displayed but then a full page refresh occurs and nothing has updated.

 

Lee
Top achievements
Rank 1
 answered on 08 May 2018
6 answers
974 views
hey everyone,

I want to validate a button such that if combobox selected items count is equal to zero then button click will show an alert on client side. I am doing this:
function filterSearch()
{
  var combo = $find('<%=RadComboBox1.ClientID %>');
  var textbox = document.getElementById("txtSearch");
  var selectedItemsCount = combo.get_selectedItems().length;
  if (selectedItemsCount == 0)
  {
    alert("You must select a category before processing search!");
    return false;
  }
}
This ain't working though. This is my button:
<asp:Button ID="btnSearch" runat="server" Style="float: left; color: black; font-weight: bold" Text="Search" OnClick="btnSearch_Click" OnClientClick="javascript: return filterSearch();" />
How can I do this?

Thanks,
Amit

Marin Bratanov
Telerik team
 answered on 08 May 2018
0 answers
97 views

I have a simple RadGrid with this design:

<div id="Grid">
                    <telerik:RadGrid RenderMode="Lightweight"
                         runat="server"
                         AllowPaging="true"
                         ID="RadGrid1"
                         AutoGenerateColumns="false"
                         OnItemCommand="RadGrid1_ItemCommand"
                         OnItemCreated="RadGrid1_ItemCreated"
                         OnPreRender="RadGrid1_PreRender1"
                         OnItemDataBound="RadGrid1_ItemDataBound"
                         OnNeedDataSource="RadGrid1_NeedDataSource"
                         AllowAutomaticDeletes="false"
                         AllowAutomaticInserts="true"
                         AllowAutomaticUpdates="true"
                         >
                        <MasterTableView DataKeyNames="UserID"
                             CommandItemDisplay="Top"
                             InsertItemPageIndexAction="ShowItemOnCurrentPage">
                            <Columns>
 
                                <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
                                </telerik:GridEditCommandColumn>
                                <telerik:GridBoundColumn DataField="UserID" HeaderText="User ID" ReadOnly="true"
                                    ForceExtractValue="Always" ConvertEmptyStringToNull="true" Visible="false"/>
                                <telerik:GridTemplateColumn UniqueName="ActiveColumn" HeaderText="Active">
                                    <ItemTemplate>
                                        <asp:Label ID="lblActive" runat="server" Text='<%# Convert.ToBoolean(Eval("Active")) == true ? "Yes" : "No" %>'></asp:Label>
                                    </ItemTemplate>
                                    <InsertItemTemplate>
                                        <asp:CheckBox runat ="server" ID="chkInsertActive" />
                                    </InsertItemTemplate>
                                    <EditItemTemplate>
                                        <asp:CheckBox runat="server" ID ="chkActive" Checked='<%# DataBinder.Eval(Container.DataItem,"Active") %>'  />
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Role">
                                    <ItemTemplate>
                                            <%#DataBinder.Eval(Container.DataItem,"Role") %>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:DropDownList ID="ddlRole" runat="server" ></asp:DropDownList>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn UniqueName="FirstNameColumn" HeaderText="First Name">
                                    <ItemTemplate>
                                            <%# DataBinder.Eval(Container.DataItem,"FirstName") %>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtFirstName" runat="server" Text='<%# Bind("FirstName") %>'></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="* First Name Is Required" ForeColor="Red"
                                             ControlToValidate="txtFirstName"></asp:RequiredFieldValidator>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Last Name">
                                    <ItemTemplate>
                                        <%# DataBinder.Eval(Container.DataItem, "LastName") %>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtLastName" runat="server" Text='<%# Bind("LastName") %>'></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="* Last Name Is Required" ForeColor="Red"
                                             ControlToValidate="txtLastName"></asp:RequiredFieldValidator>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="User Name">
                                    <ItemTemplate>
                                        <%# DataBinder.Eval(Container.DataItem, "UserName") %>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtUserName" runat="server" Text='<%# Bind("UserName") %>'></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="* User Name Is Required" ForeColor="Red"
                                             ControlToValidate="txtUserName"></asp:RequiredFieldValidator>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Email Address">
                                    <ItemTemplate>
                                        <%# DataBinder.Eval(Container.DataItem, "EmailAddress") %>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtEmail" runat="server" Text='<%# Bind("EmailAddress") %>'></asp:TextBox>
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="* Email Is Required" ForeColor="Red"
                                             ControlToValidate="txtEmail"></asp:RequiredFieldValidator>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn>
                                    <ItemTemplate>
                                        <asp:Button ID="btnDelete" CssClass="btn btn-xs btn-danger" Text="Delete" runat="server" OnClick="BtnDelete_Click" OnClientClick="confirmAspButton(this); return false;">
                                        </asp:Button>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
 
                        </MasterTableView>
                        <PagerStyle Mode="NextPrevAndNumeric" />
                    </telerik:RadGrid>
                </div>

 

 Then I created C# code to filter the Grid by user and or Role with this code.  I am not showing all of the code just enough to give a picture of what I am working with:

if (txtName.Text.Length > 0 && ddlRole.SelectedIndex == 0)
{
    string a = txtName.Text;
    using (ExpungeEntities db = new ExpungeEntities())
    {
        RadGrid1.DataSource = db.USERS_T_DATA.Where(c => c.FirstName.Contains(a)
            || c.LastName.Contains(a)).ToList();
        {
            RadGrid1.Rebind();
            int intGridCount = RadGrid1.Items.Count;
            if (intGridCount == 0)
            {
                DisplayMessage("No records matched your search");
                txtName.Text = string.Empty;
            }
        }
         
         
    }
}

 

The code works as expected and I endup with a filtered grid. but here is the issue I am trying to solve.  When I click the "edit" icon that was created by my use of the AllowAutomaticUpdates I am presented with the first row in the grid for updating instead of the intended row.  I have taken a screen shot that shows the issue to help explain.

How can I get the correct row to display for edit?

 

Perry
Top achievements
Rank 1
 asked on 08 May 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?