Telerik Forums
UI for ASP.NET AJAX Forum
12 answers
145 views

I am newbie to telerik controls.  I am currently using RadScheduler control, how do i increase the width of Group by cell name (See the attachment) and see my code below.

<telerik:RadScheduler ID="RadScheduler1" runat="server" 
      DataSourceID="SQLDSAppointmentList"   
DataKeyField="ID"   
DataStartField="StartDate" DataEndField="EndDate" 
DataSubjectField="Description"   
 Skin="Outlook" 
GroupBy ="Inspectors" 
 GroupingDirection ="Vertical"   
SelectedView="MonthView">  
 
          
        <ResourceTypes> 
            <telerik:ResourceType DataSourceID="SQLDSInspectorList"   
                    ForeignKeyField="InspectorID" KeyField="InspectorListID" Name="Inspectors"   
                    TextField="InspectorName" /> 
                <telerik:ResourceType DataSourceID="SQLDSInspectionTaskList"   
                    ForeignKeyField="InspectionTaskTypeID" KeyField="ReferenceTypeDetailsID" Name="InspectionTaskTypes"   
                    TextField="Name" /> 
                   
        </ResourceTypes> 
         
    </telerik:RadScheduler> 
    </div><br /> 
    <div> 
        <asp:Button ID="ButtonAddNonInspectionTaskTypeList" runat ="server" Text ="Add Non-InspectionTask" /> 
    </div> 
    <asp:SqlDataSource   
        ID="SQLDSInspectorList"   
        runat="server"   
        ConnectionString="<%$ ConnectionStrings:SQLConnectionString %>" 
         SelectCommand ="SELECT IL.InspectorListID ,IL.UserInfo_tp_Title AS InspectorName  
                FROM RSS.InspectorList IL WHERE IL.InspectorListID = 14"  
        > 
    </asp:SqlDataSource> 
    <asp:SqlDataSource ID="SQLDSInspectionTaskList" runat ="server" 
         ConnectionString ="<%$ ConnectionStrings:SQLConnectionString %>" 
          SelectCommand ="SELECT   
 RTD.ReferenceTypeDetailsID   
 ,RTD.Name   
FROM RSS.ReferenceTypeDetails RTD   
INNER JOIN RSS.ReferenceTypes RT  
ON RT.ReferenceTypeID = RTD.ReferenceTypeID   
WHERE RT.Name = 'InspectionTaskTypes'"></asp:SqlDataSource> 
    <asp:SqlDataSource ID="SQLDSAppointmentList" runat ="server"   
      ConnectionString ="<%$ ConnectionStrings:SQLConnectionString %>"   
       SelectCommand ="SELECT [ID]  
      ,[StartDate]  
      ,[EndDate]  
      ,[InspectorID]  
      ,[InspectionTaskTypeID]  
      ,[Description]  
  FROM vw_InspectionTaskAppointmentsAll"> 
</asp:SqlDataSource> 
 
Ivan Danchev
Telerik team
 answered on 03 May 2016
3 answers
319 views

Hi,

Here is the .ASPX Code for the RadGrid. Problem is, I am not able to Use Validation Controls(i.e.RequiredFieldValidator  etc…) for the “txtRfqDetSize , txtRfqDetCubic  AND  cboItemID “ controls in the following scenario.

Any one will help me how to use Validation Controls in the following Scenario?

<telerik:RadGrid ID="rgRFQDetails" runat="server" AllowPaging="True" GridLines="Horizontal"

OnNeedDataSource="rgRFQDetails_NeedDataSource" Skin="Default" PageSize="10" Width="100%"

OnUpdateCommand="rgRFQDetails_UpdateCommand" OnDeleteCommand="rgRFQDetails_DeleteCommand">

<PagerStyle Mode="Slider" />

<%--<AlternatingItemStyle BackColor="#F1EFE9" />--%>

<MasterTableView AutoGenerateColumns="false" DataKeyNames="RFQDetails_RegSerLineNo"

EditMode="InPlace" CommandItemStyle-CssClass="RGCmdHeader" CommandItemSettings-RefreshText="&nbsp;&nbsp;Refresh">

<Columns>

<telerik:GridBoundColumn Visible="false" DataField="RFQDetails_RegSerLineNo" HeaderText="Service L.No"

HeaderStyle-Width="15%" HeaderStyle-CssClass="GridHeadernew" UniqueName="RFQDetails_RegSerLineNo"

ReadOnly="True">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn Visible="false" DataField="RFQDetails_RegSerCode" HeaderText="Service Code"

HeaderStyle-Width="15%" HeaderStyle-CssClass="GridHeadernew" UniqueName="RFQDetails_RegSerCode"

ReadOnly="True">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="RFQDetails_RegSerName" HeaderText="Service Name"

HeaderStyle-Width="15%" HeaderStyle-CssClass="GridHeadernew" UniqueName="RFQDetails_RegSerName"

ReadOnly="True">

</telerik:GridBoundColumn>

                                                                    <telerik:GridBoundColumn DataField="RFQDetails_Coordinator" HeaderText="Coordinator"

                                                                        HeaderStyle-Width="13%" HeaderStyle-CssClass="GridHeadernew" UniqueName="RFQDetails_Coordinator"

                                                                        ReadOnly="True">

                                                                    </telerik:GridBoundColumn>

                                                                    <telerik:GridBoundColumn DataField="Commodity" HeaderText="Commodity" HeaderStyle-Width="13%"

                                                                        HeaderStyle-CssClass="GridHeadernew" UniqueName="Commodity" ReadOnly="True">

                                                                    </telerik:GridBoundColumn>

                                                                    <telerik:GridBoundColumn DataField="RFQDetails_WeightInLbs" ItemStyle-HorizontalAlign="Right"

                                                                        HeaderText="Weights" HeaderStyle-Width="5%" HeaderStyle-CssClass="GridHeadernew"

                                                                        UniqueName="RFQDetails_WeightInLbs" ReadOnly="True">

                                                                    </telerik:GridBoundColumn>

                                                                    <telerik:GridTemplateColumn HeaderText="Size" UniqueName="RFQDetails_Size" ItemStyle-HorizontalAlign="Left"

                                                                        HeaderStyle-CssClass="GridHeadernew" HeaderStyle-Width="6%">

                                                                        <ItemTemplate>

                                                                            <telerik:RadTextBox Width="75%" Text='<%# Eval("RFQDetails_Size") %>' ID="txtRfqDetSize"

                                                                                runat="server" onkeypress="fn_validateDecimal(this,'n')">

                                                                            </telerik:RadTextBox>

                                                                        </ItemTemplate>

                                                                    </telerik:GridTemplateColumn>

                                                                    <telerik:GridTemplateColumn HeaderText="Cubic" UniqueName="RFQDetails_Cubic" ItemStyle-HorizontalAlign="Left"

                                                                        HeaderStyle-CssClass="GridHeadernew" HeaderStyle-Width="6%">

                                                                        <ItemTemplate>

                                                                            <telerik:RadTextBox Width="75%" Text='<%# Eval("RFQDetails_Cubic") %>' ID="txtRfqDetCubic"

                                                                                runat="server" onkeypress="fn_validateDecimal(this,'n')">

                                                                            </telerik:RadTextBox>

                                                                        </ItemTemplate>

                                                                    </telerik:GridTemplateColumn>

                                                                    <telerik:GridTemplateColumn HeaderText="UM" UniqueName="RFQDetails_UOM" HeaderStyle-CssClass="GridHeadernew">

                                                                        <ItemTemplate>

                                                                            <telerik:RadComboBox ID="cboItemID" DataTextField="Lookup_Value" DataValueField="Lookup_Key"

                                                                                Text='<%# Bind("RFQDetails_UOM") %>' OnInit="RadComboBox1_Init" EnableLoadOnDemand="True"

                                                                                runat="server" Width="100px">

                                                                            </telerik:RadComboBox>

                                                                        </ItemTemplate>

                                                                    </telerik:GridTemplateColumn>

                                                                    <telerik:GridTemplateColumn HeaderStyle-Width="7%" HeaderText="From" Visible="false"

                                                                        HeaderStyle-CssClass="GridHeadernew">

                                                                        <ItemTemplate>

                                                                            <asp:Label ID="lblServiceLine" runat="server" Text='<%#Bind("RFQDetails_RegSerLineNo") %>'></asp:Label>

                                                                            <asp:Label ID="lblServiceCode" runat="server" Text='<%#Bind("RFQDetails_RegSerCode") %>'></asp:Label>

                                                                        </ItemTemplate>

                                                                    </telerik:GridTemplateColumn>

                                                                   <telerik:GridButtonColumn ConfirmText="Are you Sure to Update the Record" ConfirmTitle="Update1"

                                                                        HeaderStyle-Width="3%" ButtonType="ImageButton" CommandName="Update" HeaderStyle-CssClass="GridHeadernew">

                                                                    </telerik:GridButtonColumn>

                                                                    <telerik:GridTemplateColumn HeaderText="Status" HeaderStyle-Width="8%" HeaderStyle-CssClass="GridHeadernew">

                                                                        <ItemStyle HorizontalAlign="Left" />

                                                                        <ItemTemplate>

                                                                            <asp:CheckBox runat="server" Width="70" ID="chkRFQDetStatus" AutoPostBack="true" Checked='<%# CheckRecordStatus((bool)Eval("IsActive"))%>'

                                                                                Text='<%# CheckText((bool)Eval("IsActive"))%>' OnCheckedChanged="chkRFQDetStatus_CheckedChanged" />

                                                                        </ItemTemplate>

                                                                    </telerik:GridTemplateColumn>

</Columns></MasterTableView></telerik:RadGrid>

Regards,

Ranganath.S

JazzBox
Top achievements
Rank 1
 answered on 03 May 2016
4 answers
554 views
I'm trying to show an alert before a page redirect (after a form submission).
I tryed every possible scenario but it seems that the callback function (wich actually performs the redirect) is always executed before the window.

As a last option I tryed
<asp:Panel ID="AjaxPanel" runat="server" defaultbutton="LoginConfirm">
    <telerik:RadScriptBlock ID="RadScriptBlock" runat="server">
        <script type="text/javascript">
            activeAjaxRequest = false;
            noPermanentLogin('sdf');
        </script>
    </telerik:RadScriptBlock>
where noPermanentLogin just:
function noPermanentLogin(args) {
    radalert('Radalert is called from the client!', 330, 180, 'Client RadAlert', alertCallBackFn(args), '');
}
function alertCallBackFn(args) {
    alert(args);
    //window.location.href = args
}

Now when I first load the page the RadWindow should open each time and upon clicking "OK" button the alert should fire.
Instead the alert fires and the window is not created because of:
Uncaught TypeError: Cannot call method 'radalert' of undefined
It seems that the radwindow object has not yet been instantiated but nonetheless the callbackfunction executes the same.. this is quite mindblowing to me...

In the real scenario I tryed several versions, whose behaviour (in all situations) is that the callbackfunction gets executed BEFORE the window is showed. In those cases btw the window is showed.
So I tryed in code behind:
Me.AjaxManager.ResponseScripts.Add("noPermanentLogin('returnUrl')")
Then I tryed
RadWindowManager.RadAlert("Testina", Nothing, Nothing, "Totolo", "window.location.href = '" & returnUrl & "'")
And finally I tryed:
RadWindowManager.RadAlert("Testina", Nothing, Nothing, "Totolo", "redirectFunction('testurl')")
(in this last case redirectFunction calls the window redirect and is in an external JS in the page).

Why the callback function is executed even before showing the radalert?
Thanks in advance for your help




Enrico Ariel
Top achievements
Rank 2
 answered on 03 May 2016
1 answer
184 views
In the RadGrid i have setup there are columns for a Vehicle Make, Model, and Style, the desired effect would be to link the selected values between the three and have any models shown reflect the make chosen, and for styles they would conditionally show based off the model chosen (data filtering achieved through sql procedures) but my problem is (i'm using batch cell by cell editing by the way) is that i am unable to retrieve the selected values from "neighbor" dropdowns i'll call them, everywhere i have looked i see that to get the GridEditableItem it can be achievedby doing control "GridEditableItem edit = (GridEditableItem)controlX" but when i do that i get "Unable to cast object of type 'PanelNamingContainer' to type 'Telerik.Web.UI.GridEditableItem'", is there any way to innately bind a selected value to a dropdown from within the edititem template client side e.g. SelectedValue='<%# Bind("Make") %>', because that too blows up with the same listed error, at face value i have three dropdowns that need to communicate their values (in a reliable manor) to eachother for purposes of filtering their respective items.

Please Advise
Viktor Tachev
Telerik team
 answered on 03 May 2016
3 answers
82 views

Hi Telerik

I have radgrid that client binding to WCF (Ajax-enabled) service . that's fine work on locally but on host has problme and can't show data . 

please help me . i tired to do it ..

thanks.

 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <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>
    <div>
           <telerik:RadGrid ID="gvProvince" runat="server" AllowMultiRowSelection="True" AllowFilteringByColumn="True">
                   <MasterTableView AutoGenerateColumns="False" AllowSorting="True" AllowPaging="True" DataKeyNames="ProvinceId" ClientDataKeyNames="ProvinceId" AllowAutomaticDeletes="True">
                        <PagerStyle Mode="NextPrevAndNumeric" />
                        <Columns>
                            <telerik:GridBoundColumn DataField="RowNumber" HeaderText="row" SortExpression="RowNumber" UniqueName="RowNumber" AllowFiltering="False"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ProvinceId" HeaderText="Province Id" SortExpression="ProvinceId" UniqueName="ProvinceId" AllowFiltering="False"></telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn DataField="ProvinceName" HeaderText="Province Name" SortExpression="ProvinceName" UniqueName="ProvinceName"  AllowFiltering="False">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ClientItemTemplate>
                                    #=ProvinceName#
                                </ClientItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True" EnableRowHoverStyle="True">
                        <DataBinding FilterParameterType="Linq" Location="~/App/Services/ProvinceService.svc" ResponseType="JSONP" SelectMethod="GetProvinces" SortParameterType="Linq">
                        </DataBinding>
                        <Selecting AllowRowSelect="True"></Selecting>
                    </ClientSettings>
                </telerik:RadGrid>
    </div>
    </form>
</body>
</html>

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using System.Text;
using RadTest.Models;
using Telerik.Web.UI;
 
namespace RadTest.App.Services
{
    public class ProvinceInformation
    {
        public int ProvinceId { get; set; }
        public string ProvinceName { get; set; }
    }
 
    [DataContract]
    public class ProvinceInfoService
    {
        [DataMember]
        public int RowNumber { get; set; }
        [DataMember]
        public int ProvinceId { get; set; }
        [DataMember]
        public string ProvinceName { get; set; }
    }
    public class ResultDataProvince
    {
        public int Count { get; set; }
        public List<ProvinceInfoService> Data { get; set; }
    }
 
    [ServiceContract(Namespace = "")]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class ProvinceService
    {
        [OperationContract]
        public ResultDataProvince GetProvinces(int startRowIndex, int maximumRows, string sortExpression, string filterExpression)
        {
            var row = startRowIndex;
 
            using (var db = new persianEntities())
            {
                var lst = (from province in db.Provinces
                           select new ProvinceInformation()
                           {
                               ProvinceId = province.ProvinceId,
                               ProvinceName = province.ProvinceName
                           }
                    ).OrderBy(p => p.ProvinceId);
                var data = RadGrid.GetBindingData(lst, startRowIndex, maximumRows, sortExpression, filterExpression);
                var result = new ResultDataProvince();
                result.Data = data.Data.Select(p => new ProvinceInfoService()
                {
                    ProvinceId = p.ProvinceId,
                    ProvinceName = p.ProvinceName
 
                }).ToList().Select(p => new ProvinceInfoService()
                {
                    RowNumber = ++row,
                    ProvinceId = p.ProvinceId,
                    ProvinceName = p.ProvinceName
                }).ToList();
 
                result.Count = data.Count;
                return result;
            }
        }
 
    }
}

 

<?xml version="1.0"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
  </configSections>
  <appSettings>
    <add key="Telerik.Skin" value="Default"/>
    <add key="Telerik.ScriptManager.TelerikCdn" value="Disabled"/>
    <add key="Telerik.StyleSheetManager.TelerikCdn" value="Disabled"/>
    <add key="Telerik.Web.UI.RenderMode" value="lightweight"/>
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.5"/>
    <httpRuntime targetFramework="4.5"/>
    <pages>
      <controls>
        <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/>
      </controls>
    </pages>
    <httpHandlers>
      <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false"/>
      <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false"/>
      <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false"/>
      <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false"/>
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>
    </httpHandlers>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <handlers>
      <remove name="ChartImage_axd"/>
      <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode"/>
      <remove name="Telerik_Web_UI_SpellCheckHandler_axd"/>
      <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode"/>
      <remove name="Telerik_Web_UI_DialogHandler_aspx"/>
      <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode"/>
      <remove name="Telerik_RadUploadProgressHandler_ashx"/>
      <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode"/>
      <remove name="Telerik_Web_UI_WebResource_axd"/>
      <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode"/>
    </handlers>
  </system.webServer>
  <system.serviceModel>
    <behaviors>
      <endpointBehaviors>
        <behavior name="RadTest.App.Services.ProvinceServiceAspNetAjaxBehavior">
          <enableWebScript/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
    <services>
      <service name="RadTest.App.Services.ProvinceService">
        <endpoint address="" behaviorConfiguration="RadTest.App.Services.ProvinceServiceAspNetAjaxBehavior" binding="webHttpBinding" contract="RadTest.App.Services.ProvinceService"/>
      </service>
    </services>
  </system.serviceModel>
  <connectionStrings>
    <add name="persianEntities" connectionString="metadata=res://*/Models.Persian.csdl|res://*/Models.Persian.ssdl|res://*/Models.Persian.msl;provider=System.Data.SqlClient;provider connection string="data source=x.x.x.x;initial catalog=xx;user id=xx;password=xx;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient"/>
  </connectionStrings>
  <entityFramework>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
    </providers>
  </entityFramework>
</configuration>

 

 

 

 

 

Viktor Tachev
Telerik team
 answered on 03 May 2016
3 answers
664 views
Here is my grid:

                <telerik:RadGrid ID="gvWebUsers" runat="server" 
                    OnNeedDataSource="gvWebUsers_NeedDataSource" 
                    OnItemCreated="gvWebUsers_ItemCreated"
                    Skin="Gray" 
                    AutoGenerateColumns="false"
                    OnItemDataBound="gvWebUsers_ItemDataBound" 
                    AllowAutomaticUpdates="true"
                    AllowPaging="true" 
                    CssClass="SettingsGrid" 
                    Width="99.7%">
                    
                    <ClientSettings Resizing-AllowColumnResize="true" Resizing-ClipCellContentOnResize="true" />
                    
                    <MasterTableView DataKeyNames="UserID" PageSize="15" EditMode="InPlace" >
                        <PagerStyle Mode="NextPrevAndNumeric" />
                        <Columns>
                             <telerik:GridBoundColumn DataField="EmailAddress" HeaderText="<%$ Resources:English,Settings_MobilityUsers_Email %>"
                                UniqueName="EmailAddress" ReadOnly="True" />
                                
                             <telerik:GridBoundColumn DataField="FirstName" HeaderText="<%$ Resources:English,Settings_MobilityUsers_FirstName %>"
                                UniqueName="FirstName" ReadOnly="True" />
                                
                             <telerik:GridBoundColumn DataField="LastName" HeaderText="<%$ Resources:English,Settings_MobilityUsers_LastName %>"
                                UniqueName="LastName" ReadOnly="True" />
                        
                             <telerik:GridBoundColumn DataField="IsDomainUser" HeaderText="<%$ Resources:English,Settings_MobilityUsers_IsDomainUser %>"
                                UniqueName="IsDomainUser" ReadOnly="True" />
                                
                             <telerik:GridBoundColumn DataField="IsVerified" HeaderText="<%$ Resources:English,Settings_MobilityUsers_IsVerified %>"
                                UniqueName="IsVerified"  ReadOnly="True"/>
                                
                             <telerik:GridButtonColumn HeaderStyle-Width="80px" ItemStyle-Width="80px" ButtonType="LinkButton" UniqueName="BlockButton" />
                             
                             <telerik:GridButtonColumn HeaderStyle-Width="80px" ItemStyle-Width="80px" ButtonType="LinkButton" UniqueName="ChangePassButton" />

                            <telerik:GridButtonColumn HeaderStyle-Width="80px" ItemStyle-Width="80px" ButtonType="LinkButton" UniqueName="AllowUploadButton" />
                             
                             <telerik:GridButtonColumn HeaderStyle-Width="80px" ItemStyle-Width="80px" ButtonType="LinkButton" UniqueName="UnlockButton" />




                    <telerik:GridTemplateColumn HeaderText="Category" ItemStyle-Width="240px">
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "IsUploadAllowed")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadComboBox runat="server" ID="RadComboBox2" skin="Gray">
                            </telerik:RadComboBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>

                    <telerik:GridEditCommandColumn FooterText="EditCommand footer" UniqueName="EditCommandColumn"
                        HeaderText="Edit" HeaderStyle-Width="100px" UpdateText="Update">
                    </telerik:GridEditCommandColumn>

                            
                            
                        </Columns>
                        
                    </MasterTableView>
                </telerik:RadGrid>



I try to bind data from server side as suggested in your posts:

    protected void gvWebUsers_ItemDataBound(object sender, GridItemEventArgs e)
    {
         if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            
            GridEditableItem editItem = (GridEditableItem)e.Item;
            RadComboBox combo = (RadComboBox)editItem.FindControl("RadComboBox2");
            combo.DataSource = GetUploadStatus();
            combo.DataTextField = "Key";
            combo.DataValueField = "Value";
            combo.DataBind();
        }
    }


But it never enters into the "if" statement (there is no GridEditableItem)
what am I doing wrong??
Eyup
Telerik team
 answered on 03 May 2016
3 answers
152 views

I am unable to center the text in the group headers of my RadGrid. When I inspect the page I see that the header row is comprised of two <td> tags instead of one. The second <td> holds the desired text and is center-aligned, but because of the extra cell the text appears pushed over towards the right.

Here's the relevant code:

<p><telerik:RadGrid runat="server" ID="RadGridUsers" <br>                    AutoGenerateColumns="False" <br>                    ShowGroupPanel="False"<br>                    GroupingSettings-GroupContinuesFormatString=""<br>                    OnNeedDataSource="RadGridNeedDataSource"<br>                    AllowPaging="True" <br>                    OnColumnCreated="RadGridColumnCreated"<br>                    OnItemCreated="RadGridItemCreated"<br>                    EnableViewState="True"><br>                    <ClientSettings><br>                        <Scrolling UseStaticHeaders="True" ScrollHeight="100px"/><br>                    </ClientSettings><br>                    <MasterTableView AllowAutomaticUpdates="False" AllowPaging="True" PageSize="20" PagerStyle-AlwaysVisible="True" AllowSorting="True" AllowFilteringByColumn="True" Width="100%"><br>                        <GroupByExpressions><br>                            <telerik:GridGroupByExpression><br>                                <GroupByFields><br>                                    <telerik:GridGroupByField  FieldName="Department" SortOrder="Ascending"/><br>                                </GroupByFields><br>                                <SelectFields><br>                                    <telerik:GridGroupByField FieldName="Department"/><br>                                </SelectFields><br>                            </telerik:GridGroupByExpression><br>                        </GroupByExpressions><br>                        <GroupHeaderItemStyle BackColor="#99bbff" ForeColor="DarkBlue" HorizontalAlign="Center" Font-Bold="True"/><br>                        <GroupHeaderTemplate><br>                            <asp:Label runat="server" ID="Label5" Text='<%# Eval("Department")%>'/><br>                        </GroupHeaderTemplate><br>                        <SortExpressions><br>                            <telerik:GridSortExpression FieldName="LastName" SortOrder="Ascending"/><br>                        </SortExpressions></p>

 

In the ColumnCreated event I'm hiding the group splitter:

<p>Protected Sub RadGridColumnCreated(ByVal sender As Object, ByVal e As GridColumnCreatedEventArgs)<br>            If (TypeOf (e.Column) Is GridGroupSplitterColumn) Then e.Column.Visible = False<br>        End Sub</p>

 

In the ItemCreated event I'm removing the grouping controls:

<p>Protected Sub RadGridItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs)<br>            If (TypeOf (e.Item) Is GridFilteringItem) Then<br>                Dim item As GridFilteringItem = e.Item<br>                If (TypeOf (e.Item) Is GridGroupHeaderItem) Then<br>                e.Item.Cells(0).Controls.Clear()<br>                e.Item.Cells(0).Width = 0<br>            End If<br>            End Sub</p>

 

The output looks something like this:

<tr class="rgGroupHeader">

<td style="width:0;"></td>

<td style="text-align:center;">Foobar</td>

</tr>

...followed by the rows of data.

Viktor Tachev
Telerik team
 answered on 03 May 2016
1 answer
60 views

Hi,

    I have two roles in my application. user and manager. User has to fill 5 columns in a grid and submit request. For manager, when he enters, grid has to display all values entered by user and also has to be additional column (6th column) to enter his comments across each row of grid and approve/reject. 

  In short, one column of grid has to be in edit/update mode and other columns has to be in read-mode. 

  Please throw some light on this how to proceed.

  Am using C# for coding.

Thanks,

Hari

 

 

 

  

 

Eyup
Telerik team
 answered on 03 May 2016
1 answer
260 views

Hi,

I am using RadTooltip to show some additional info inside a RadGrid cell. The tooltip is showing fine when the page loads. I have a scenario where on some user action, the grid data will change. So I am doing this using a service. The service will load the grid (ascx) in code behind and send back the html code. The html code contains the tool tip with some differences in it. Not sure why it is behaving like this ? The telerik classes not getting applied.

On Load

<div style="position: absolute; z-index: 8000; visibility: hidden; left: 227px; top: 542px; display: none;" unselectable="on" class="RadToolTip RadToolTip_Default rtVisibleCallout rosterPopup rtShadow rtRoundedCorner" id="RadToolTipWrapper_ctl00_PlaceHolderMain_ctl00_ctl00_TelerikRosterGridView_ctl00_ctl05_RadToolTipLastName"><div class="rtRelativeWrapper"><span style="visibility: visible;" class="rtCallout rtCalloutTopLeft">&nbsp;</span><div class="rtContent"><div><div><p>Tooltip content</p></div></div></div></div></div>

 

Code behind

<div style="display:none;position:absolute;" id="ctl00_TelerikRosterGridView_ctl00_ctl07_RadToolTipLastName" class="rosterPopup"><div><p>Tooltip content</p></div><input id="ctl00_TelerikRosterGridView_ctl00_ctl07_RadToolTipLastName_ClientState" name="ctl00_TelerikRosterGridView_ctl00_ctl07_RadToolTipLastName_ClientState" type="hidden"></div>

 

Thanks

Kumaran

Marin Bratanov
Telerik team
 answered on 03 May 2016
0 answers
63 views

Hi,

i am new at developping in ASP.net using Kendo UI.

I have two grid and i want to load one of them depending on the choice of the dropdown list.

i mean, if the user choose Externe in the dropdown list, the grid with the externalentrepriseviewmodel should be loaded. Else the grid with the internalentrepriseviewmodel should be loaded.

Don't know how to do it. Please help me.

here is my view code:

 

001.@model DGBFIP.SDP.ViewModel.Areas.Repository.Entreprise.EntrepriseViewModel
002.@using DGBFIP.SDP.ViewModel.Areas.Repository.Entreprise
003.@{
004.    
005.    Layout = "~/Views/Shared/_Layout.cshtml";
006.}
007. 
008. 
009.@Html.HiddenFor(model => model.Id)
010.@Html.HiddenFor(model => model.CurrentUserId)
011. 
012.@Html.LabelFor(model => model.type)
013.@Html.Kendo().DropDownListFor(model => model.type).DataTextField("Text").DataValueField("Value").DataSource(source =>
014.{
015.    source.Read(read =>
016.    {
017.        read.Action("GetType", "Enterprise", new { area = "Repository" });
018.    });
019. 
020.}).HtmlAttributes(new { style = "width: 75%" }).OptionLabel("Choisissez le type d'entreprise")
021. 
022.@(Html.Kendo().Grid<ExternalEntrepriseViewModel>()
023.        .Name("grid")
024.        .AutoBind(false)
025.        .Columns(columns =>
026.        {
027.            columns.Bound(c => c.Id).Visible(false).Hidden(true);
028.            columns.Bound(c => c.CurrentUserId).Visible(false).Hidden(true);
029.            columns.Bound(c => c.type);
030.            columns.Bound(c => c.Name);
031.            columns.Bound(c => c.telephone);
032.            columns.Bound(c => c.fax);
033.            columns.Bound(c => c.email);
034.            columns.Bound(c => c.continent);
035.            columns.Bound(c => c.pays);
036.            columns.Bound(c => c.address);
037.            columns.Command(command => { command.Edit().Text("Modifier").UpdateText("Enregistrer").CancelText("Annuler"); command.Destroy().Text("Supprimer"); }).Width(250);
038.        })
039. 
040.             .ToolBar(toolbar => toolbar.Create().Text("Ajouter une entreprise externe")) @*Ajout du bouton ajouter un type de financement*@
041. 
042..Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("_entrepriseexterne").Window(x => x.Title("Editer .....")))
043.            .Scrollable()
044.            .Sortable()
045.            .Filterable(x => x.Mode(GridFilterMode.Row))
046.            .Pageable(pageable => pageable
047.                .Refresh(true)
048.                .PageSizes(true)
049.                .ButtonCount(5))
050.            .DataSource(dataSource => dataSource
051.                .Ajax()
052.                .Model(model => model.Id(p => p.Id))
053.                   .Read(read => read.Action("GetAll", "Enterprise", new { area = "Repository" }).Data("AdditionalData"))
054.                   .Create(create => create.Action("Create", "Enterprise", new { area = "Repository" }))
055.                       .Destroy(delete => delete.Action("Destroy", "Enterprise", new { area = "Repository" }))
056.                       .Update(update => update.Action("Update", "Enterprise", new { area = "Repository" }))
057. 
058.                .PageSize(20)
059.            )
060.)
061. 
062.@(Html.Kendo().Grid<InternalEntrepriseViewModel>()
063.        .Name("grid2")
064.        .AutoBind(false)
065.        .Columns(columns =>
066.        {
067.            columns.Bound(c => c.Id).Visible(false).Hidden(true);
068.            columns.Bound(c => c.CurrentUserId).Visible(false).Hidden(true);
069.            columns.Bound(c => c.type);
070.            columns.Bound(c => c.Name);
071.            columns.Bound(c => c.telephone);
072.            columns.Bound(c => c.fax);
073.            columns.Bound(c => c.email);
074.            columns.Bound(c => c.province);
075.            columns.Bound(c => c.address);
076.            columns.Bound(c => c.rccm);
077.            columns.Bound(c => c.statistic);
078.            columns.Command(command => { command.Edit().Text("Modifier").UpdateText("Enregistrer").CancelText("Annuler"); command.Destroy().Text("Supprimer"); }).Width(250);
079. 
080.        })
081. 
082.             .ToolBar(toolbar => toolbar.Create().Text("Ajouter une entreprise locale")) @*Ajout du bouton ajouter un type de financement*@
083. 
084..Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("_entrepriselocale").Window(x => x.Title("Editer .....")))
085.                .Scrollable()
086.                .Sortable()
087.                .Filterable(x => x.Mode(GridFilterMode.Row))
088.                .Pageable(pageable => pageable
089.                    .Refresh(true)
090.                    .PageSizes(true)
091.                    .ButtonCount(5))
092.                .DataSource(dataSource => dataSource
093.                    .Ajax()
094.                    .Model(model => model.Id(p => p.Id))
095.                       .Read(read => read.Action("GetAll", "Enterprise", new { area = "Repository" }))
096.                       .Create(create => create.Action("Create", "Enterprise", new { area = "Repository" }))
097.                           .Destroy(delete => delete.Action("Destroy", "Enterprise", new { area = "Repository" }))
098.                           .Update(update => update.Action("Update", "Enterprise", new { area = "Repository" }))
099. 
100.                    .PageSize(20)
101.                )
102.)
103.<style>
104.   #grid {
105.        display: none;
106.    }
107.   #grid2 {
108.        display: none;
109.    }
110.</style>

lola
Top achievements
Rank 1
 asked on 03 May 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?