Hello everyone,
I am using a radgrid with a GridDateTimeColumn, I want to set the FirstDayOfWeek for the calendar from code behind.
Here is my column :
<telerik:GridDateTimeColumn DataField="DateDebut" HeaderText="Du" SortExpression="Du" MaxLength="50" UniqueName="DateDebut" ItemStyle-Width="80px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:yyyy-MM-dd}" />
Here is my code behind :
protected void rgDateSaisie_ItemDataBound(object sender, GridItemEventArgs e) {
if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
GridEditManager editMan = editedItem.EditManager;
GridDateTimeColumnEditor editor = (GridDateTimeColumnEditor)(editMan.GetColumnEditor("DateDebut")); RadDatePicker picker = editor.PickerControl;
picker.DatePopupButton.ToolTip = "Ouvrir le calendrier";
picker.Calendar.FirstDayOfWeek = FirstDayOfWeek.Friday;
}
The toolTip message works but firstDayOfTheWeek is still sunday in the popup calendar.
What I am missing.
Thanks a lot
Hi,
We're using Telerik RadGrid to display data in our pages.
Existing system: Since this page/grid is in use on multiple places, and due to other reasons during development, this grid is created during runtime (in c#). Also a few checkbox columns on this grid is editable.
Recent requirement: On checking the checkbox in an editable checkbox column of the grid, make another text column of same row in the the grid to be editable. Basically show a textbox for user to enter some notes on why he thinks that checkbox should be checked. Similarly, when unchecked, that row's textbox to be disabled.
Issue: We're unable to get the checkbox check changed event of checkbox column, in the aspx page, to fire. This is the event in which we intend to put code to enable the textbox of that row. Tried to achieve this server side as well as client side, but nothing seems to work.
We have created a checkbox event handler in Item_Created event of grid control. But on checking the checkbox, the Item_Created event does not fire, page does post back. Also, note that we have created the CustomCheckbox class by inheriting "ITemplate" interface. The CustomCheckbox's check changed event does fire but here we do not have any info related to selected row so that we can fetch and enable/disable the cell with textbox.
The examples over the internet have the telerik grid created in design time and it works well for them. So we're guessing that this might be an issue for us since we're creating the grid at runtime. Redeveloping the entire page to create grid design time is out of question since the page is in use on multiple places. Apart from the time required to redevelop/regression test the entire page, many functionalities are in place with runtime grid. We need to fix this issue for grid created at runtime.
We have created a POC application in which we've replicated our exact issue. Unable to attach the zipped source code in this thread since only image files are allowed to be attached. Here is the link to file in dropbox: https://www.dropbox.com/sh/gv5csygr3uxpe2f/AAAaCezrFO2hUXdH6H7CPBaJa?dl=0
Please look into this and let us know a possible solution.
Let me know if any additional details are required.
Thanks,
Blessy.

HI,
I am using the RadComboBox with checkbox everything is working fine, but I have a issue in displaying Rad combo box option text .
RadComboBox with checkbox how to use CSS to adjust left side margin so that for large text option and with nowrap=false.
Please see attached image.
I want to know how to align the warped text after checkbox and how to reduce the space between checkbox and the text.
Thanks .
Shirish.
You guys ought to create .hide(), .show(), etc, or similar methods on your client-side GridColumn object. In that way, users will be able to get a reference to a particular column by UniqueName using the tableView method getColumnByUniqueName and perform actions, like hiding. As it stands, in order to hide a column, one must use the hideColumn method of the TableView object and this expects an index argument. Referencing grid column indexes leads to really fragile code since grid columns can be inserted/removed all the time and one might not think to look at some obscure javascript that depends on the order of columns.
You could also add a get_index() method to the GridColumn which would facilitate obtaining the index without hard-coding it.
I've got a drop down list and when a particular item is selected I'd like to check a checkbox inside a radgrid. below is what I've figured out thus far but can't quite figure out how to check the checkbox.
<script type="text/javascript">
function OnClientItemSelected(sender, eventArgs) {
var item = eventArgs.get_item(); //target 3
var grid = $find("<%= rgClientSites.ClientID %>");
var masterTable = grid.get_masterTableView();
var cell = masterTable.getCellByColumnUniqueName(masterTable.get_dataItems()[0], "2"); //2 is the item that contains the checkbox
if (item.get_value() === "3") {
//check it
alert(cell.innerHTML);
}
else {
//uncheck it
}
}
</script>
Any help would be most appreciated.
<telerik:GridTemplateColumn HeaderText="To" HeaderStyle-Width="40px" HeaderStyle-HorizontalAlign="Center"> <ItemTemplate> <asp:Label ID="lblTo" runat="server" Text="To" Width="100%" /> </ItemTemplate> <EditItemTemplate> <asp:Label ID="lblTo" runat="server" Text="To" Width="100%" /> </EditItemTemplate></telerik:GridTemplateColumn>Hello,
I have a page with a masterpage that has a set of Radmenu items, when i add a couple radgrids to the page and enable the AllowFilteringByColumn option, it causes the Radmenu to display incorrectly. Is there some way i can allow filtering without messing up the menu?
I'm using telerick UI for asp.net ajax version 2016.3.1027.45
I'm attaching a screenshot showing the difference.
Here is the code.
Thanks!
Master Page:
01.<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="OpenCall.master.vb"02. Inherits="ListManagement.OpenCall" %>03. 04.<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>05. 06.<!DOCTYPE html>07.<html xmlns="http://www.w3.org/1999/xhtml">08.<head runat="server">09. <title></title>10. <asp:ContentPlaceHolder ID="head" runat="server">11. </asp:ContentPlaceHolder>12. <link href="../Styles/style.css" rel="stylesheet" />13.</head>14.<body>15. <form id="form1" runat="server" class="noselect">16. <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>17. <div id="header_container">18. <div class="logo">19. <asp:ImageMap ID="ImageMap1" runat="server" ImageUrl="~/Images/Canonlogo.gif"></asp:ImageMap>20. </div>21. <div id="header">22. 23. 24. <h2>List Manager</h2>25. </div>26. <div id="main-nav">27. <telerik:RadMenu ID="menu" runat="server" DataFieldID="Title" Style="z-index:2900"28. DataNavigateUrlField="Url" DataSourceID="RadSiteMapDataSource1" ToolTip="Menu"29. DataTextField="Title"30. EnableTheming="True" Skin="Windows7" Font-Bold="True" RenderMode="Classic" Visible="False">31. </telerik:RadMenu>32. <telerik:RadSiteMapDataSource ID="RadSiteMapDataSource1" runat="server" SiteMapFile="Web.sitemap"33. ShowStartingNode="False" SiteMapProvider="NADSiteMap"></telerik:RadSiteMapDataSource>34. <telerik:RadMenu ID="AgentMenu" runat="server" DataFieldID="Title" Style="z-index:2900"35. DataNavigateUrlField="Url" DataSourceID="RadSiteMapDataSource2" ToolTip="Menu"36. DataTextField="Title"37. EnableTheming="True" Skin="Windows7" Font-Bold="True" RenderMode="Classic" Visible="False">38. </telerik:RadMenu>39. <telerik:RadSiteMapDataSource ID="RadSiteMapDataSource2" runat="server" SiteMapFile="Web.sitemap"40. ShowStartingNode="False" SiteMapProvider="AgentSiteMap"></telerik:RadSiteMapDataSource>41. </div>42. </div>43. <asp:Label ID="Msg" runat="server" Text=""></asp:Label>44. <div id="site_content" runat="server">45. 46. <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">47. </asp:ContentPlaceHolder>48. 49. </div>50. <div id="footer_container" class="noselect">51. <p>52. © <%: DateTime.Now.Year %> - Outbound Dialing List Manager53. </p>54. </div>55. 56. </form>57.</body>58.</html>
Grids.aspx
01.<%@ Page Title="" Language="vb" AutoEventWireup="true" MasterPageFile="~/MasterPages/OpenCall.Master"02. CodeBehind="Grids.aspx.vb" Inherits="ListManagement.Grids" %>03. 04. 05.<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">06.</asp:Content>07.<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">08. <div style="width: 100%">09. <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="LMData" AllowFilteringByColumn="true" AllowMultiRowSelection="true"10. Height="600px" GroupingSettings-CaseSensitive="false" Skin="Windows7" AutoGenerateColumns="false" AllowPaging="true" AllowCustomPaging="false" PageSize="30">11. <ClientSettings>12. <Scrolling AllowScroll="true" SaveScrollPosition="true" />13. <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" UseClientSelectColumnOnly="false" />14. <%--<ClientEvents OnRowSelected="rowSelected" OnRowDeselected="rowDeselected" OnRowCreated="rowCreated" OnGridCreated="gridCreated" />--%>15. </ClientSettings>16. <MasterTableView CommandItemDisplay="Top" TableLayout="Auto" ClientDataKeyNames="ID">17. 18. <Columns>19. <telerik:GridBoundColumn UniqueName="ID" DataField="ID" HeaderText="ID" Display="false" ShowFilterIcon="false"></telerik:GridBoundColumn>20. <telerik:GridClientSelectColumn UniqueName="ClientSelectCol" HeaderStyle-Width="30px" ItemStyle-Width="30px" ShowFilterIcon="false"></telerik:GridClientSelectColumn>21. <telerik:GridBoundColumn DataField="First_Name" HeaderText="First_Name" UniqueName="First_Name" Display="false" ShowFilterIcon="false"></telerik:GridBoundColumn>22. <telerik:GridBoundColumn DataField="Last_Name" HeaderText="Last_Name" UniqueName="Last_Name" Display="false" ShowFilterIcon="false"></telerik:GridBoundColumn>23. <telerik:GridCalculatedColumn HeaderStyle-Width="120px" ItemStyle-Width="90px" HeaderText="Name" UniqueName="Name" DataFields="First_Name,Last_Name" Expression='{0} + " " + {1}'></telerik:GridCalculatedColumn>24. <telerik:GridBoundColumn DataField="Company_Name" HeaderText="Company Name" UniqueName="Company_Name"></telerik:GridBoundColumn>25. <telerik:GridBoundColumn DataField="FileName" HeaderText="File Name" UniqueName="FileName"></telerik:GridBoundColumn>26. </Columns>27. </MasterTableView>28. 29. </telerik:RadGrid>30. <asp:SqlDataSource runat="server" ID="LMData" ConnectionString="<%$ Connectionstrings:CITSSQLDEVLM %>" SelectCommand="OpenCases" SelectCommandType="StoredProcedure"></asp:SqlDataSource>31. <telerik:RadComboBox ID="cbEmp" runat="server" DataSourceID="SqlDataSourceAgents"32. AutoPostBack="true" DataTextField="EmpName" DataValueField="EMPID" MarkFirstMatch="True"33. EmptyMessage="Select Agent..." AppendDataBoundItems="True" AllowCustomText="True"34. Skin="Windows7">35. <Items>36. <telerik:RadComboBoxItem Text="ALL" Selected="true" Value="NULL" />37. </Items>38. </telerik:RadComboBox>39. <asp:SqlDataSource ID="SqlDataSourceAgents" runat="server" ConnectionString="<%$ ConnectionStrings:EMPInfoConnectionString %>"40. SelectCommand="uspOutboundSalesEmployees" SelectCommandType="StoredProcedure"></asp:SqlDataSource>41. <telerik:RadGrid ID="RadGrid2" runat="server" DataSourceID="SqlDataSource3" AllowFilteringByColumn="true" Height="600px" RenderMode="Lightweight"42. GroupingSettings-CaseSensitive="false" AllowPaging="true" AllowCustomPaging="false" PageSize="30" Skin="Windows7" AllowMultiRowSelection="true">43. </telerik:RadGrid>44. 45. <asp:SqlDataSource runat="server" ID="SqlDataSource3" ConnectionString='<%$ ConnectionStrings:CITSSQLDEVLM %>'46. SelectCommand="EmpCases" SelectCommandType="StoredProcedure">47. <SelectParameters>48. <asp:ControlParameter ControlID="cbEmp" Name="EmpID" PropertyName="SelectedValue"49. Type="String" />50. </SelectParameters>51. </asp:SqlDataSource>52. </div>53. 54.</asp:Content>I have 3 levels of grouping in my radgrid and I need to display the sum of one of the detail levels at each group header level. I have tried creating groups client side and server side with the same results. The group header levels end up displaying and calculating sporadically on inner groups 2 and 3. The top most group always displays correctly with the total hours. Below is my code for the grid. Any help or direction would be appreciated.
<t:RadGrid ID="rgPTOA" runat="server" GroupingEnabled="true"
OnNeedDataSource="rgPTOA_OnNeedDataSource" ShowGroupPanel="false"
OnItemCommand="rgPTOA_OnItemCommand" GroupingSettings-GroupByFieldsSeparator=" "
Visible="false"
GridLines="None"
ShowFooter="false"
HeaderStyle-Wrap="false"
ShowHeader="false" AutoGenerateColumns="false" OnPreRender="rgPTOA_PreRender"
>
<ClientSettings AllowGroupExpandCollapse="true">
</ClientSettings>
<GroupingSettings RetainGroupFootersVisibility="true" />
<MasterTableView ShowGroupFooter="true" EnableNoRecordsTemplate="true" ShowHeadersWhenNoRecords="false" DataKeyNames="EmpNameLine"
AutoGenerateColumns="false" Width="100%" TableLayout="Fixed" GroupLoadMode="Client"
>
<NoRecordsTemplate>NO RECORDS </NoRecordsTemplate>
<Columns>
<telerik:GridTemplateColumn>
<ItemTemplate>
<!-- Content Area -->
<!-- result 1-1-1-1 -->
<section>
<section class="large-border-bottom-grey">
<div class="magic-mobile-panels no-table">
<div class="row">
<!-- date requested -->
<div class="column small-12 large-expand">
<div class="mmpanel">
<header>
DATE REQUESTED
</header>
<div>
<asp:Label ID="Label7" runat="server" Text='<%# Eval("PTO_DATE", "{0:MM/dd/yyyy}") %>'> </asp:Label>
</div>
</div>
</div>
<!-- benefit type -->
<div class="column small-12 large-expand">
<div class="mmpanel">
<header>
BENEFIT TYPE
</header>
<div>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("PAY_TYPE_CODE") %> '> </asp:Label>
</div>
</div>
</div>
<!-- labor status -->
<div class="column small-12 large-expand">
<div class="mmpanel">
<header>
LABOR STATUS
</header>
<div>
<asp:Label ID="Label2" runat="server" Text='<%# Eval("LaborStatus") %> '> </asp:Label>
</div>
</div>
</div>
<!-- dist. code -->
<div class="column small-12 large-expand show-for-large">
<div class="mmpanel">
<header>
DIST. CODE
</header>
<div>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("PR_DIST_ID") %> '> </asp:Label>
</div>
</div>
</div>
<!-- start time -->
<div class="column small-12 large-expand">
<div class="mmpanel">
<header>
START TIME
</header>
<div>
<asp:Label ID="Label4" runat="server" Text='<%# Eval("PTO_Date","{0:hh:mm tt}")%> '> </asp:Label>
</div>
</div>
</div>
<!-- hours -->
<div class="column small-12 large-expand">
<div class="mmpanel">
<header>
HOURS
</header>
<div>
<asp:Label ID="Label5" runat="server" Text='<%# Eval("PTO_HOURS") %> '> </asp:Label>
</div>
</div>
</div>
<!-- review due date -->
<div class="column small-12 large-expand">
<div class="mmpanel">
<header>
REVIEW DUE DATE
</header>
<div>
<asp:Label ID="Label6" runat="server" Text='<%# Eval("PTO_APPROVE_DUE","{0:hh:mm tt}")%> '> </asp:Label>
</div>
</div>
</div>
<!-- approval status -->
<div class="column small-12 large-expand show-for-large">
<div class="mmpanel">
<header>
STATUS
</header>
<div>
<asp:Label ID="Label8" runat="server" Text='<%# Eval("PTOVerificationStatus") %> '> </asp:Label>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- desktop -->
<section class="show-for-large">
<div class="row column-center-divider">
<!-- comment -->
<div class="column">
<div class="panel-2">
<header>COMMENT</header>
<div class="font-size-smaller">
<asp:Label ID="Label9" runat="server" Text='<%# Eval("PTO_COMMENT") %> '> </asp:Label>
</div>
</div>
</div>
<!-- approval comment -->
<div class="column">
<div class="panel-2">
<header>APPROVAL COMMENT</header>
<div class="font-size-smaller">
<asp:Label ID="Label10" runat="server" Text='<%# Eval("PTO_REVIEW_COMM") %> '> </asp:Label>
</div>
</div>
</div>
</div>
</section>
<!-- /desktop -->
</section>
<!-- /result 1-1-1-1 -->
<!-- /RESULTS -->
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
<GroupByExpressions>
<%--First Grouping Header--%>
<t:GridGroupByExpression>
<GroupByFields>
<t:GridGroupByField FieldName="DeptID" />
</GroupByFields>
<SelectFields>
<t:GridGroupByField FieldName="DeptID" HeaderText=" " HeaderValueSeparator="" />
<t:GridGroupByField FieldName="PTO_HOURS" FieldAlias="A2" Aggregate="Sum" FormatString="{0:F2}" HeaderText=" Total Hours" />
</SelectFields>
</t:GridGroupByExpression>
<%--Second Grouping Header--%>
<t:GridGroupByExpression>
<GroupByFields>
<t:GridGroupByField
FieldName="EmpNameLine" />
</GroupByFields>
<SelectFields>
<t:GridGroupByField FieldName="EmpNameLine" HeaderText="Employee" />
<t:GridGroupByField FieldName="PTO_HOURS" FieldAlias="A3" Aggregate="Sum" FormatString="{0:F2}" HeaderText=" Total Hours" />
</SelectFields>
</t:GridGroupByExpression>
<%--Third Grouping Header--%>
<t:GridGroupByExpression>
<GroupByFields>
<t:GridGroupByField
FieldName="PAY_TYPE_CODE" />
</GroupByFields>
<SelectFields>
<t:GridGroupByField FieldName="PAY_TYPE_CODE" HeaderText="Pay Type" />
<t:GridGroupByField FieldName="PTO_HOURS" FieldAlias="A4" Aggregate="Sum" FormatString="{0:F2}" HeaderText=" Total Hours" />
</SelectFields>
</t:GridGroupByExpression>
</GroupByExpressions>
</MasterTableView>
</t:RadGrid>