Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
938 views

I'm currently using Window as a pop-up login form. A user will click a button on a RadToolbar called "login". The login button is tied to a codebehind event to pop a window that will let a user authenticate to the app. This and the authentication works fine, the user submits their creds, clocks submit and if the creds match then the window is closed.

What I'm trying to figure out how to do is refresh the parent page. The refresh checks if the user is authenticated or now and update the toolbar by removing login and replacing it with logout.

I've been doing some research and cant find the right way to make this work.


Zachery
Top achievements
Rank 1
 answered on 06 Feb 2018
0 answers
108 views

How to can I do the RowHeaderZone does not exceed the limit or do with that her be responsive?

I need that her stay with a width predefined and expand only when i expand the rows.

Is it possible to do ?

Follow attached image.

Andre
Top achievements
Rank 1
 asked on 06 Feb 2018
8 answers
252 views

Hi, i'm trying to use RadGrid for a master/detail grid with declarative binding, but when i try to expand a level i obtain only empty detailsviews.

I set ServerOnDemand mode. This is the code.

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ElencoGruppi.aspx.cs" Inherits="Stats.Secure.ElencoGruppi" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
   
    <div class="row" id="er_head">
        <div class="col-md-12">
            <h2>Gestione gruppi</h2>
        </div>
    </div>
 
    <telerik:RadGrid ID="rgGruppi" runat="server" DataSourceID="sdsGruppi" AllowSorting="True" AlternatingItemStyle-BackColor="#fff7e9" AutoGenerateColumns="False" RenderMode="Lightweight" Skin="Silk" Culture="it-IT">
        <GroupingSettings CollapseAllTooltip="Collapse all groups"></GroupingSettings>
 
        <ExportSettings>
            <Pdf PageWidth="">
            </Pdf>
        </ExportSettings>
 
        <AlternatingItemStyle BackColor="#FFF7E9"></AlternatingItemStyle>
 
        <MasterTableView EnableHierarchyExpandAll="true" DataSourceID="sdsGruppi" DataKeyNames="IDGruppo" HierarchyLoadMode="Client" NoDetailRecordsText="Nessun dato di dettaglio trovato" NoMasterRecordsText="Nessun dato trovato">
            <DetailTables>
                <telerik:GridTableView EnableHierarchyExpandAll="true" DataKeyNames="IDReport" DataSourceID="sdsReport" Width="100%" runat="server">
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="IDGruppo" MasterKeyField="IDGruppo"></telerik:GridRelationFields>
                    </ParentTableRelation>
                    <Columns>
                        <telerik:GridBoundColumn DataField="IDReport" HeaderText="ID" UniqueName="IDReport" DataType="System.Int32">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Titolo" HeaderText="Titolo" UniqueName="Titolo">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="IDTipoReport" HeaderText="Tipo" UniqueName="IDTipoReport">
                        </telerik:GridBoundColumn>
                    </Columns>
                </telerik:GridTableView>
            </DetailTables>
            <Columns>
                <telerik:GridBoundColumn DataField="IDGruppo" HeaderText="ID" UniqueName="IDGruppo" DataType="System.Int32">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Gruppo" HeaderText="Gruppo" UniqueName="Gruppo">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Descrizione" HeaderText="Descrizione" UniqueName="Descrizione">
                </telerik:GridBoundColumn>
                <telerik:GridCheckBoxColumn DataField="Pubblicato" HeaderText="Pubblicato" UniqueName="Pubblicato" DataType="System.Boolean">
                </telerik:GridCheckBoxColumn>
                <telerik:GridBoundColumn DataField="Ordine" HeaderText="Ordine" UniqueName="Ordine" DataType="System.Int32">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="NumeroClick" HeaderText="Click" UniqueName="NumeroClick" DataType="System.Int32">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Url" HeaderText="Url" UniqueName="Url">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
 
        <FilterMenu RenderMode="Lightweight"></FilterMenu>
 
        <HeaderContextMenu RenderMode="Lightweight"></HeaderContextMenu>
    </telerik:RadGrid>
 
    <asp:SqlDataSource ID="sdsGruppi" runat="server" ConnectionString=""
        SelectCommand="SELECT g.IDGruppo, g.Gruppo, g.Descrizione, g.Pubblicato, g.Ordine, g.NumeroClick, g.Url FROM Gruppi AS g ORDER BY g.Ordine">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="sdsReport" runat="server" ConnectionString=""
        SelectCommand="SELECT gr.IDGruppo, r.IDReport, r.Titolo, r.IDTipoReport, r.Pubblicato, r.NumeroVisite, gr.Ordine FROM Report AS r INNER JOIN GruppiReport AS gr ON gr.IDReport = r.IDReport WHERE gr.IDGruppo = @IDGruppo">
        <SelectParameters>
            <asp:Parameter Type="Int32" Name="IDGruppo" /><asp:Parameter />
        </SelectParameters>
    </asp:SqlDataSource>
 
</asp:Content>

 

ConnectionString(s) are setted on the Init step:

 

namespace Stats.Secure
{
    public partial class ElencoGruppi : System.Web.UI.Page
    {
        string connDb;
 
        protected void Page_Init(object sender, EventArgs e)
        {
            // permesso solo per operatore
            if (Session["AuthIDRuolo"] != null && (int)Session["AuthIDRuolo"] >= 3)
            { }
            else
                Response.Redirect("Login.aspx?LOGOUT=1");
 
            // carica la stringa di connessione
            if (ConfigurationManager.AppSettings["appModoTest"] == "true")
                connDb = ConfigurationManager.ConnectionStrings["Stats.Test"].ConnectionString;
            else
                connDb = ConfigurationManager.ConnectionStrings["Stats"].ConnectionString;
 
            sdsGruppi.ConnectionString = connDb;
            sdsReport.ConnectionString = connDb;
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
 
    }
}

 

Thank you for advices.

Marin Bratanov
Telerik team
 answered on 06 Feb 2018
3 answers
618 views

I have a first step where a user selects an option on the basis of which the remaining steps need to be shown.
I am not dynamically adding any steps that are needed based on the user input.

All steps are made available in .aspx file.
Is there a way to hide steps based on user input.

I tried using Add as explained in this post

http://docs.telerik.com/devtools/aspnet-ajax/controls/wizard/troubleshooting/known-limitations

but still the ViewState is getting corrupted.

Is there a way to achieve this requirement?

 

Rumen
Telerik team
 answered on 06 Feb 2018
0 answers
78 views

Hi~

If I use OnClientItemClicking, I will not use autopostback, but I can not use the event I want.

What should I do?

 

.aspx

<script type="text/javascript">

function onClicking(sender, eventArgs)
{
  var item = eventArgs.get_item();

  if (item.get_level() == 0)
  {
      eventArgs.set_cancel(true);
  }
}
</script>

<telerik:RadMenu ID="RadMenu1" runat="server" Skin="Windows7"
  OnItemClick="RadMenu1_ItemClick" OnClientItemClicking="onClickingMenu" />

 

.cs

protected void RadMenu1_ItemClick(object sender, RadMenuEventArgs e)

{ 

           //my event

}

SeungHak
Top achievements
Rank 1
 asked on 06 Feb 2018
5 answers
172 views

Hi,

I have a page with a RadGrid configured to bind with OData services as the source. I am able to hit the OData endpoint, get the desired data in the browser. However the data just doesn't show-up in the grid. The OData service returns a static list of objects. I can see the JSON in the browser's Response or Fiddler. I am clueless. I got till this point by referring to some of the sample available on Telerik, but this situation seems weird. Pasting my code aspx and OData service below.

ASPX:

<form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
     
    <telerik:RadGrid runat="server"
        AutoGenerateColumns="false"
        ID="grdEmployee">
        <MasterTableView>
            <Columns>
                <telerik:GridBoundColumn UniqueName="Name"
                    DataType="System.String"
                    DataField="Name"
                    HeaderText="Name">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
        <ClientSettings>
            <DataBinding Location="http://localhost:55638/od/"
                ResponseType="JSON">
                <DataService TableName="Employee" Type="OData" />
            </DataBinding>
        </ClientSettings>
    </telerik:RadGrid>
</form>

 

OData Service:

public class EmployeeController : ODataController
    {
        // GET api/<controller>
        public IEnumerable<models.Employee> Get()
        {
            List<models.Employee> emp = new List<models.Employee>();
            emp.Add(new models.Employee { ID = "1", Name = "Ariel Musaltov", Sex = "Male", Age = 38, Country = "Russia", Region = "Central", City = "Moscow", Salary = new models.Salary { Basic = 18000, InHand = 16670 } });
            emp.Add(new models.Employee { ID = "2", Name = "Allan Friedman", Sex = "Male", Age = 24, Country = "U.S.A", Region = "West", City = "San Jose", Salary = new models.Salary { Basic = 22000, InHand = 18672 } });
            emp.Add(new models.Employee { ID = "3", Name = "John Smith", Sex = "Male", Age = 35, Country = "U.S.A", Region = "West", City = "Seattle", Salary = new models.Salary { Basic = 39020, InHand = 32431 } });
 
            return emp;
        }
}

 

Model

namespace models
{
    public class Employee
    {
        public string ID { set; get; }
        public string Name { set; get; }
        public string Sex { set; get; }
        public string Country { set; get; }
        public int Age { set; get; }
        public string Region { set; get; }
        public string City { set; get; }
 
        public Salary Salary { set; get; }
    }
}

 

I have attached 2 screenshots - 1 shows the grid does not reflect the data from the datasource (OData) and 2nd shows that the model data is received by the browser successfully.

Eyup
Telerik team
 answered on 06 Feb 2018
1 answer
546 views

Have a telerik grid , has 500 records & applied page size of 50,

columns  like

LocationID, State, Dist & City

Now the Question  is:

On Result screen :

Populated the grid with above column values.

After Databind

Step 1 ) applied sort function on LocationID column

    - as expected  results got re-arranged in a desc. order.

Step 2) selected  a row  , where the location id is  452 .

Step 3 ) - Navigated to next page & passed the location id thru session & Page-2 did some functions

Step 4) Coming back to result screen

Step 5) Now i need to select /high-light  the previously selected row ( ie LocationID-452)

 - since im rebinding the grid on post back ,

i couldn't get the row ( lost sorting filter values)  & selected based on the LocationID- 452

Can someone pls help on this situation.

 

 

 

Eyup
Telerik team
 answered on 06 Feb 2018
5 answers
323 views
Hello,

Using RadControls for ASP.NET v2011.2.712.35

I have a RadGrid with client-side row click event defined as follows:

<telerik:RadGrid runat="server" ID="RadGrid_Combo" ... >
    <ClientSettings EnableRowHoverStyle="true">
        <ClientEvents
            OnGridCreated="OP_RadGrid_GridCreated"
            OnRowSelected="OP_RadGrid_RowSelected"
            OnRowDeselected="OP_RadGrid_RowDeselected"
            />
    <MasterTableView TableLayout="Fixed">
        <Columns>
            <telerik:GridImageColumn UniqueName="ImageUrl"
                DataAlternateTextField="ObjectType"
                DataAlternateTextFormatString="{0} Object"
                DataImageUrlFields="ImageUrl"
                DataType="System.String"
                HeaderText="Type"
                ImageAlign="Middle"
                ImageHeight="16px"
                ImageWidth="16px"
                >
                <HeaderStyle Width="25px" Wrap="false" />
            </telerik:GridImageColumn>
...
</telerik:RadGrid>

My Javascript is:

<script type="text/javascript">
function OP_RadGrid_RowSelected(sender, args)
{
    // do some stuff
    ...
}
</script>

When I click on a row in the RadGrid, the OP_RadGrid_RowSelected() event fires just fine.

However, when I click on the image in the GridImateColumn, the OP_RadGrid_RowSelected() event DOES NOT fire.

How can I make the OP_RadGrid_RowSelected() fire when I click on the Image?

Thanks,
Randall Price
Senior Developer
Virginia Tech
Attila Antal
Telerik team
 answered on 05 Feb 2018
2 answers
104 views

I have this weird problem.  Maybe is that I don't understand how a fixed position Menu works.  Anyway,  here are some simple code I used:

 

<style>

    .fixmenu {

 

Vessy
Telerik team
 answered on 05 Feb 2018
0 answers
129 views

Hi,

How to Edit Selected Rows of a Grid using Client Side Scripts? I am able show the value from a List in the Grid and then when i select the rows and click on Edit Button i should be able to edit only one column value of the selected rows.

How can i achieve this requirement? Please let me know any way to get this done.

Below is my code:

<telerik:GridTemplateColumn DataField="ResourceCapacity" ColumnEditorID="clmResCap" UniqueName="ResourceCapacityTemplateColumn" HeaderText="ResourceCapacity">
                            <ClientItemTemplate >
                                #=ResourceCapacity#
                            </ClientItemTemplate>
                                
                           <EditItemTemplate >
                               <telerik:RadNumericTextBox runat="server" DataField="ResourceCapacity" ID="txtResourceCapacity" HeaderText="ResourceCapacity"></telerik:RadNumericTextBox>
                           </EditItemTemplate>
                                                       
                        </telerik:GridTemplateColumn>

Regards

Agasthya

agasthya
Top achievements
Rank 1
 asked on 05 Feb 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?