Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
429 views
Hi. I am using Telerik version 2011. I want to assign / change the Headertext. I have used 2 to 3 types. but its not getting work. Please let me know in which event we can assign or set the headertext of column.



RadGrid1.Columns[0].HeaderText = "Rank";

I have applied above code in Page_Load event , RadGrid's ItemDataBound Event still column heading not set. 
Please help me out in this. 

Thanks in advance.
Vishnu
Top achievements
Rank 1
 answered on 17 Dec 2013
3 answers
91 views
I'm trying to show appointments in TimeLineView grouped by resources. For each appointment in RadScheduler, I want to display dynamic tooltip. For that I had used RadToolTipManager and OnAjaxUpdate.

Code Snippet - 

protected void RadToolTipManager1_AjaxUpdate(object sender, ToolTipUpdateEventArgs e)
    {
        // THIS WORKS SUCCESSFULLY
        Appointment appointment = null;
        foreach (var apt in EventScheduler.Appointments.Where(apt => apt.ID.ToString().Equals(e.Value)))
        {
            appointment = apt;
            break;
        }
 
        // CODE COMMENTED BELOW NOT WORKS. WHY?
        //int aptId;
        //var appointment = int.TryParse(e.Value, out aptId) ? EventScheduler.Appointments.FindByID(aptId) : EventScheduler.Appointments.FindByID(e.Value);
 
        if (appointment == null) return;
 
        var toolTip = (AppointmentToolTip)LoadControl("UserControl/AppointmentToolTip.ascx");
        toolTip.TargetAppointment = appointment;
        e.UpdatePanel.ContentTemplateContainer.Controls.Add(toolTip);
    }

I am seeking answer to why part in code comment.  If it work one way, then it must work another way. Did anyone else noticed this bug?

I believe that the commented part is more optimized and fast in comparison to method I had implemented. So can Telerik team confirm that code I'm using would be equivalent fast?
Kate
Telerik team
 answered on 17 Dec 2013
1 answer
87 views
Hi,
I'm trying to refresh my grid and groups

<telerik:RadGrid ID="HomeRadGrid" runat="server" OnNeedDataSource="HomeRadGrid_NeedDataSource"
          EnableEmbeddedSkins="False" AllowPaging="True" AllowAutomaticUpdates="false"
          AllowAutomaticInserts="false" AllowAutomaticDeletes="false" AllowSorting="True"
          AllowFilteringByColumn="True" CellSpacing="0" Culture="it-IT" GridLines="None"
          OnItemCommand = "HomeRadGrid_ItemCommand" OnGroupsChanging="HomeRadGrid_GroupsChanging"
          OnItemDataBound = "HomeRadGrid_ItemDataBound"
          Skin="MySkin" ShowGroupPanel="True">
          <PagerStyle Mode="NextPrevAndNumeric" />
          <MasterTableView AutoGenerateColumns="False"  CommandItemDisplay="Top" DataKeyNames="Id">
           <ColumnGroups>
                      <telerik:GridColumnGroup Name="GeneralInformation" HeaderText="General Information"
                          HeaderStyle-HorizontalAlign="Center" />
                      <telerik:GridColumnGroup Name="WarningsIcon" HeaderText="Warnings"
                          HeaderStyle-HorizontalAlign="Center" />
                  </ColumnGroups>
          <CommandItemSettings RefreshText="" ShowAddNewRecordButton="false" />          
              <GroupByExpressions>
                  <telerik:GridGroupByExpression>
                      <SelectFields>
                          <telerik:GridGroupByField FieldAlias="Company" FieldName="Cdc.CompanyCode"></telerik:GridGroupByField>
                      </SelectFields>
                      <GroupByFields>
                          <telerik:GridGroupByField FieldName="Cdc.CompanyCode" SortOrder="Descending"></telerik:GridGroupByField>
                      </GroupByFields>
                  </telerik:GridGroupByExpression>
                  <telerik:GridGroupByExpression>
                      <SelectFields>
                          <telerik:GridGroupByField FieldAlias="Project" FieldName="Cdc.Code" ></telerik:GridGroupByField>
                      </SelectFields>
                      <GroupByFields>
                          <telerik:GridGroupByField FieldName="Cdc.Code"></telerik:GridGroupByField>
                      </GroupByFields>
                  </telerik:GridGroupByExpression>
              </GroupByExpressions>
              <Columns>
                  <telerik:GridBoundColumn DataField="Cdc.CompanyCode" HeaderText="Company Code" SortExpression="Cdc.CompanyCode"
                      UniqueName="Cdc.CompanyCode" Visible="false" ColumnGroupName="GeneralInformation" >
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="Cdc.Code" HeaderText="Project" SortExpression="Cdc.Code"
                      UniqueName="Cdc.Code" Visible="false" ColumnGroupName="GeneralInformation" >
                  </telerik:GridBoundColumn>
                   
                  ...
              </Columns>
                <NestedViewTemplate>
                      ...
                  </NestedViewTemplate>
          </MasterTableView>
          <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
          <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents>
              <Selecting AllowRowSelect="False"></Selecting>
              <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True"
                  ResizeGridOnColumnResize="False"></Resizing>
          </ClientSettings>
          <GroupingSettings ShowUnGroupButton="true"></GroupingSettings>
      </telerik:RadGrid>
C#

/// <summary>
       /// Eventi sul grid
       /// </summary>
       /// <param name="sender"></param>
       /// <param name="e"></param>
       protected void HomeRadGrid_ItemCommand(object sender, GridCommandEventArgs e)
       {
           switch (e.CommandName)
           {
               case "RebindGrid":
 
                   //tolgo i filtri
                   foreach (GridColumn column in HomeRadGrid.MasterTableView.OwnerGrid.Columns)
                   {
                       column.CurrentFilterFunction = GridKnownFunction.NoFilter;
                       column.CurrentFilterValue = string.Empty;                       
                   }
                   HomeRadGrid.MasterTableView.FilterExpression = string.Empty;
 
                   //tolgo i gruppi
                   HomeRadGrid.MasterTableView.GroupByExpressions.Clear();
                   //Refresh datagrid               
                   HomeRadGrid.Rebind();
                   break;
 
             
       }
Deyan Enchev
Telerik team
 answered on 17 Dec 2013
1 answer
95 views
Hello,

I have a Grid now that is updated once a day with changes on various status' from my users. My question is, does anyone have any ideas on how to save those previous entries to an archive that the user can go into and view previous entries?

The goal would be to have this archive and then after a certain point those archived entries would be deleted to avoid taking up too much database room unnecessarily.

Right now here is how I am saving my grid to my database, I just wasn't sure on how to expand on this to get that additional functionality.

private void SaveDataInDataTable()
{
    foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
    {
        if (item.IsInEditMode)
        {
            int rowID = (int)item.GetDataKeyValue("ID");
            for (int i = 2; i < RadGrid1.MasterTableView.RenderColumns.Length; i++)
            {
                GridColumn column = RadGrid1.MasterTableView.RenderColumns[i];
                DataRow myDataRow = GridSource.Select("ID = " + rowID)[0];
                object value = GetColumnValue(column, item);
             
                if (column.DataType == typeof(int))
                {
                    if (value == string.Empty || value == null)
                    {
                        myDataRow[column.UniqueName] = DBNull.Value;
                    }
                    else
                    {
                        int parsedValue;
                        if (int.TryParse(value.ToString(), out parsedValue))
                        {  
                            myDataRow[column.UniqueName] = parsedValue;
                        }
                        else
                        {
                            myDataRow[column.UniqueName] = myDataRow[column.UniqueName];
                            RadAjaxManager1.Alert(string.Format("Value {0} is not valid for column {1}, row {2}. The old value was used!", value, column.UniqueName, item.ItemIndex+1));
                        }
                    }
                }
                else if (value == null)
                {
                    myDataRow[column.UniqueName] = DBNull.Value;
                }
                else if ((GridSource.Columns[column.UniqueName].MaxLength < value.ToString().Length) && GridSource.Columns[column.UniqueName].MaxLength != -1)
                {
                    myDataRow[column.UniqueName] = value.ToString().Substring(0, 5);
                }
                else
                {
                    myDataRow[column.UniqueName] = GetColumnValue(column, item);
                }
            }
        }
Radoslav
Telerik team
 answered on 17 Dec 2013
1 answer
69 views
Hi,

I am using Telerik RadScheduler version 2012.3.1016.40.

My client wants feature of creating appointments by selecting multiple timeslots in TimeLineView. But so far I am unable to find any such demo or examples in Forum too. Though demo exists for Day view, month view but not for TimeLine view.

Can you please share with me possible solution by any means ?
Plamen
Telerik team
 answered on 17 Dec 2013
6 answers
286 views
Hi,
i am using rad treeview,so how can i Disable parent node(dynamic) click in radtreeview.
Thanks
Nencho
Telerik team
 answered on 17 Dec 2013
0 answers
88 views
  Hello my my services account with bright cable has been encoded and has blocked my access and they have not beeb able to fix it. the encryption looks familiar    and the promram I used said it was manually put in. they used this to get all my voice mails sent to them via text thru Cincinnati Bell Telephone Services I live in New Port Richey Floria any help would be grateful please every thing has been tried blocking him is the most important thing  at this point thing.

�� `I�%&/m�{J�J��t��`$ؐ@�������iG#)�*��eVe]f@���{����{����;�N'���?\fdl��J�ɞ!���?~|?"��Ey�')=��y6�����h�����O��6����Η�<]Vm��m�Vi�L�e�f��:ǟ�?�+/{К�: T���Wv<[����~2�g�2���?�ʋ�y�hYՋ����� ��t� _N���M�l�������{��,���Xn���Q�}��������*g�������7�� ~�`�j'u>K�{_��IW�2����������,KO�eS��יy�/����m^+E eB��c*�j�w��,�Vu���q�2? @]�uC_��X_�����E^���d�Tm[-��;�w�v�V�r�MJY��y���uYP���2�����uC� ԡO��w}V|W�J�d��\0��>��m���ւh�����=z��4���GV,ӏ���D�������x*)=~<�ӫb��?�����S��g���gMQ���w b����Q����r^a�{�q�A  ��l���q]d�(�vNȴ��(�<_�����z�:[6ۯ��u�գ��_M^�i�:���i�L�b%������x�������"7������4APf��X^��<�o��Z�=�� �y�Oh��h�7�8}Y�Y��ߗE~�͈ӷi[`5tQhs��&պ�.x���j��U�VuA\���
�#w[��qp4O��ؠO����mV�� ��u�����uY�2�g�>J������Z�
ԜY��ƹe���2����3�br�7����!���w %w��$�3�s֦�f5S��M�O���$Ѥ����GWUQʔ�����&�&-}S���  ��t%�r^�euE�r�Z�����U
��`��W��?2���dzY��������)z���׹��
Ί�&����L^&�bz9/��P� ��7ق0�]��p9iV��o����g�2������bM�|&}����-��J��/�h P0���w��˜1E y �'J� �/ϋ��(] .͜V� �e���:�Q#2A���п�f^��E��q����`8/V����(Vi��|YӐ %q��8-��@��>�Ƥ{�
O<�zJ�03N V�����Ȭ���5�2�&�f0g�UU�b!s�j�\�<Ԛ��tV��h��O9i��f�ʺ����8�}�5t]��E���u]+Ͳp����.���h �3��j{�����KϪfk��fJ]6U"nLѧ]E���"+W1o`c_[8|53��^_��67ŌL19 ���6h�f=����Z�����_d$U�����_����
m
�oS$��|����R�����_�ࢶuU���E�J��|��N�����]��w�������2V�����pΨ�z���^���(=;!= n��P���� q! rqA.�7=�� ���,?��e�����O��������kl?�]��{���.�R(�8

 

Lavadia
Top achievements
Rank 1
 asked on 17 Dec 2013
1 answer
107 views
Hi,
I have a grid with a nested view. In my nested view I have to load a map.
How can I load a script on row expanded? Client or server side.
Is there a clientevents that I can use?

Script to load
//carico la mappa
         function LoadMap(lat, lon) {
             if (lat == "0")
                 return;
 
             var myLatLng = new google.maps.LatLng(lat, lon);
  
             var mapOptions = {
                 zoom: 2,
                 center: myLatLng,
                 mapTypeId: google.maps.MapTypeId.HYBRID
             }
  
             map = new google.maps.Map(document.getElementById("map"), mapOptions);
             infowindow = new google.maps.InfoWindow();
             createMarker(new google.maps.LatLng(lat, lon), "testo interno", "");
         }


       protected void HomeRadGrid_ItemCommand(object sender, GridCommandEventArgs e)
       {
           switch (e.CommandName)
           {          
               case "ExpandCollapse":                   
                       //LOAD SCRIPT
                       break;
           }
       }

Thanks
Radoslav
Telerik team
 answered on 17 Dec 2013
1 answer
53 views
Hi


I need to sum on column in footer of grid. But it depends on condition

suppose i want A colum sum in fotter, Depnd on B column value if B column row value is null then no need consider that row 

    Column A  Colum B
            12                  30
            22                  
            44                   40
Sum :   56

only consider first and last row.
in sendon row b column is null

please help
Eyup
Telerik team
 answered on 17 Dec 2013
1 answer
83 views
I have an app where the user selects a From Date/Time and a To Date/Time. The default time on the End needs to be 23:59. Consider that if the user selects the same date in both controls that they intend to mean the entire day, not 12am to 12am of the same day. And it's a bit much to ask them to select the next day so that they get 12am of the next day.

So we're looking for a default of:
From 12/12/2013 00:00 to 12/12/2013 23:59

How do I set that? For the RadDateTimePicker, if I use markup to set the DateInput SelectedDate to "23:59", assuming the current date will get substituted, it still defaults to current date 00:00. Anything I set there is not used, like SelectedDate="01/01/2014 06:00AM". I know the default value for DateInput is MinDate, but I don't want to set a MinDate of "from date 23:59" because that will preclude setting to an earlier time of day.

Also, assume the user selects 21:00 but then they really want to change it to "end of day". Do I need to create a custom list in the TimeView which will allow them to select various times, including a final 23:59?

Rather than trying to accommodate such nuances, I'm wondering if there is a better solution. For example, I can code some post-processing logic that says "if the start and end-time are both 00:00 of the same day, then make the To time 23:59" for subsequent queries, or we can simply not use the time component if the date and tie are the same and the time is 00:00.

Thanks for your consideration. And I hope this help someone else who is working out a From/To scenario.
TonyG
Top achievements
Rank 1
 answered on 17 Dec 2013
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?