Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
154 views
I have a grid that is a hieracry and uses a panel to load the child

<telerik:RadGrid ID="RadGrid1" AllowFilteringByColumn="true" runat="server" EnableViewState="false" GridLines="None" 
    PagerStyle-AlwaysVisible="true" AllowCustomPaging="true" AllowPaging="true" AllowSorting="true" PageSize="20" Skin="Office2007">
    <clientsettings>
        <ClientEvents OnCommand="RadGrid1_Command" OnHierarchyExpanding="RadGrid1_HierarchyExpanding" />
    </clientsettings>
    <mastertableview hierarchyloadmode="Client" clientdatakeynames="AccessPersonID">
        <AlternatingItemStyle BackColor="#EEEEEE"></AlternatingItemStyle>
        <RowIndicatorColumn><HeaderStyle Width="0px"></HeaderStyle></RowIndicatorColumn>
        <ExpandCollapseColumn Visible="True" ><HeaderStyle Width="0px"></HeaderStyle></ExpandCollapseColumn>
            <Columns>                       
                    ...
                </Columns>
                <NestedViewTemplate>
                </NestedViewTemplate>
    </mastertableview>
</telerik:RadGrid>
  
<asp:Panel ID="Panel1" Style="display: none;" runat="server">
    <telerik:RadGrid ID="RadGrid2" Skin="Office2007" runat="server" EnableViewState="false"
         AllowFilteringByColumn="true" GridLines="None" AllowPaging="true" AllowSorting="true"
         PageSize="10" ShowStatusBar="true">
    <alternatingitemstyle backcolor="#EEEEEE"></alternatingitemstyle>
    <clientsettings>
        <ClientEvents OnCommand="RadGrid2_Command" />
    </clientsettings>
        <mastertableview clientdatakeynames="DocumentLogID" allowfilteringbycolumn="True">
            <Columns>                              
            <telerik:GridBoundColumn SortExpression="ReportName" DataField="ReportName" HeaderText="Report Name" >
                   <FilterTemplate>
                        <telerik:RadComboBox ID="RadComboBoxClientName" DataSourceID="LinqDataSource1" DataTextField="ReportName"
                            DataValueField="ReportName" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("ReportName").CurrentFilterValue %>'
                            runat="server" OnClientSelectedIndexChanged="ReportNameIndexChanged" Skin="Office2007">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" Value="" />
                            </Items>
                        </telerik:RadComboBox>
                        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                             <script type="text/javascript">
                                   function ReportNameIndexChanged(sender, args) {
                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                    if (args.get_item().get_value() == "")
                                       tableView.filter("ReportName", args.get_item().get_value(), "NoFilter");
                                    else
                                       tableView.filter("ReportName", args.get_item().get_value(), "EqualTo");
                                     }
                            </script>
                       </telerik:RadScriptBlock>                                                                            
                </FilterTemplate>                  
              <HeaderStyle Width="200px" />
           </telerik:GridBoundColumn
           <telerik:GridTemplateColumn UniqueName="StatusDescription" SortExpression="StatusDescription" DataField="StatusDescription" HeaderText="Status" >     
              <FilterTemplate>
                   <telerik:RadComboBox ID="RadComboBoxStatus" DataSourceID="LinqDataSource2" DataTextField="StatusDescription"
                       DataValueField="StatusDescription" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("StatusDescription").CurrentFilterValue %>'
                       runat="server"  OnClientSelectedIndexChanged="StatusDescriptionIndexChanged" Skin="Office2007">
                    <Items>
                       <telerik:RadComboBoxItem Text="All" Value="" />
                    </Items>
                  </telerik:RadComboBox>
              <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
                 <script type="text/javascript">
                    function StatusDescriptionIndexChanged(sender, args) {
                      var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                      if (args.get_item().get_value() == "")
                         tableView.filter("StatusDescription", args.get_item().get_value(), "NoFilter");
                     else
                         tableView.filter("StatusDescription", args.get_item().get_value(), "EqualTo");
                    }
                </script>
              </telerik:RadScriptBlock>                                    
             </FilterTemplate>                                
             <ItemTemplate>
                <telerik:RadComboBox Runat="server" ID="StatusDropDown" EnableViewState="false" DataTextField="StatusDescription" DataValueField="DocumentStatusID"  
                       DataSourceID="SqlDataSource2" Skin="Office2007"    OnClientSelectedIndexChanged="UpdateDocument" >
               </telerik:RadComboBox>
             </ItemTemplate>    
          </telerik:GridTemplateColumn
           ...                                 
        </Columns>                           
     </mastertableview>
     <pagerstyle alwaysvisible="true" />
   </telerik:RadGrid>
 </asp:Panel>

as you can see I hae a combo box in the child panel that when changed in the grid I want to run an update fo rthe data.

function UpdateDocument(sender, args) {
               var item = args.get_item();
                     Compliance.DocumentLogWS.UpdateDocument(sender.get_errorMessage(), sender.get_value(), DocumentUpdater);                
           }

this works when the grid is jut on layer, but when I am running from the child panel the sender.get_errorMessage() gives me a callback error.  How can I get the the Clientdatakeynames="DocumentLogID" for the row the the combox has been changed.

Eric Klein
Top achievements
Rank 1
 answered on 07 Apr 2011
1 answer
116 views
I am populating the scheduler using the ExchangeSchedulerProvider.  Is there a way to make the scheduler readonly but still allow the user to view the details?  If it's readonly, the user cannot click on a date to see the exact time of the appointment or to read the text if it's too long or there are too many appointments in a day.
Veronica
Telerik team
 answered on 07 Apr 2011
3 answers
59 views
I have the control to fill every appointment I make a color and show me the room information and the user, now I have a part to only see the appointments but not seethe information, as I do? To show me the information I do it this way, but not asdisabling for the other role.

  <AppointmentTemplate>
                                        <span style="font-weight: bold; font-size: small">
                                            <div>
                                                <%# Eval("Subject") %>
                                                <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/App_Themes/DeloitteSkin/ImgBotones/smallOutlook.gif"
                                                    ToolTip="Exportar a Outlook" CommandName="Export" OnClientClick="Export(this, event); return false;"
                                                    Style="cursor: pointer; cursor: hand;" />
                                            </div>
                                        </span>
                                        <%# Eval("Resources[0].text") %>
                                        <div>
                                            <%# Eval("Resources[1].text")%>
                                        </div>
            </AppointmentTemplate>
Veronica
Telerik team
 answered on 07 Apr 2011
2 answers
166 views
Hi,

I'm trying to get my radcombobox (populated with checkboxes) to show what items are selected. Its similar to this demo:
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/templates/defaultcs.aspx

However, my js code (copied from the above is simply returning empty strings with the .get_text() method.

Can anyone shed some light on why its returning nothing?

<telerik:RadComboBox ID="RadComboBox_User_Type" runat="server" EmptyMessage="Select Users" HighlightTemplatedItems="true"
            AllowCustomText="true" Width="225px">
            <Items>   
                <telerik:RadComboBoxItem 
                    ImagePath="../Images/OnTime_Fkeys/Access Control.png" 
                    Text_="Employee">
                </telerik:RadComboBoxItem>   
                <telerik:RadComboBoxItem 
                    ImagePath="../Images/OnTime_Fkeys/Access Control.png" 
                    Text_="Visitor">
                </telerik:RadComboBoxItem>
            </Items>
            <ItemTemplate>
                <div onclick="StopPropagation(event)" style="vertical-align: middle">
                    <asp:CheckBox runat="server" ID="chk1" Checked="false"/>
                    <asp:Label runat="server" ID="Label1" AssociatedControlID="chk1">
                        <img src='<%# DataBinder.Eval(Container, "Attributes['ImagePath']") %>' alt="" style="vertical-align:text-top"/>
                        <%# DataBinder.Eval(Container, "Attributes['Text_']") %> 
                    </asp:Label>
                </div>
            </ItemTemplate>
        </telerik:RadComboBox>




protected void Page_Load(object sender, EventArgs e)
        {
  
            String script1 = "" +
                    "function StopPropagation(e) " +
                    "{" +
                        "e.cancelBubble = true;" +
                        "if (e.stopPropagation) " +
                        "{" +
                            "e.stopPropagation();" +
                        "}" +
                    "}";
  
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "LMP_Stop_Prop", script1, true);
  
            ClientScript.RegisterClientScriptBlock(Page.GetType(),"324nvik",
                "<script src=\"../Javascript/Live_Monitor/Live_Monitor.js\" type=\"text/javascript\"></script>");
  
            for (int i = 0; i < RadComboBox_User_Type.Items.Count; i++)
            {
                RadComboBox_User_Type.Items[i].DataBind();
  
            }
  
            foreach (RadComboBoxItem item in RadComboBox_User_Type.Items)
            {
                CheckBox chk = (CheckBox)item.FindControl("chk1");
                chk.Attributes.Add("onclick", "onCheckBoxClick(this)");
            }
  
        }
    }


Live_Monitor.js
function onCheckBoxClick(chk) {
  
    var combo = $find('RadComboBox_User_Type');
    var text = "";
    var values = "";
    var items = combo.get_items();
  
    for (var i = 0; i < items.get_count(); i++) {
        var item = items.getItem(i);
        var chk1 = $get("RadComboBox_User_Type" + "_i" + i + "_chk1");
  
        if (chk1.checked) {
            text += item.get_text() + ",";
            values += item.get_value() + ",";
        }
    }
      
    text = removeLastComma(text);
    values = removeLastComma(values);
      
  
    if (text.length > 0) {
        combo.set_text(text);
    }
    else {
        combo.set_text("Select Users");
    }
}
  
function removeLastComma(str) {
    return str.replace(/,$/, "");
}


Anyone any ideas????

Thanks,

Sunny
Sunil
Top achievements
Rank 1
 answered on 07 Apr 2011
2 answers
150 views
Hello,

I want to display drilled down data in grid which is tooltipmanager by clicking/hover on one specific bar of barchart.

Can you please suggest me how I can achieve this ?

Thanks,
Prayag
prayag ganoje
Top achievements
Rank 1
 answered on 07 Apr 2011
3 answers
117 views
I have a treeview that the user can drag items from and drop them on a grid.  Currently the dropped items go to the bottom of the grid.  Is there a way I can get the row that the user dropped the items on?

The method that handles the drop is :

protected void tvReportColumn_HandleDrop(object sender, RadTreeNodeDragDropEventArgs e)
{
    RadTreeNode sourceNode = e.SourceDragNode;
    RadTreeNode destNode = e.DestDragNode;           
    if ((e.HtmlElementID == RadGrid1.ClientID))
    {
        foreach (RadTreeNode node in e.DraggedNodes)
        {
            AddRowToGrid(node);                   
        }
    }
 
    RadGrid1.Rebind();
}

Marin
Telerik team
 answered on 07 Apr 2011
1 answer
79 views
Hello,

           I want to do functionality like - Right click edit appointment - if user select Edit series then edit whole series sucessfully. Same way i want to update the series if user drag and drop the appointment. How to update the whole series using drag and drop.

         Don't want to edit only current occurance. Now what happend if i drag drop appointment then appointment is update but recurrence rule is not change and dragged appointment date and time marked as EXDATE and it's invisiable from rad schduler.





Need urgent



Thanks
Regards
Rahul
Veronica
Telerik team
 answered on 07 Apr 2011
0 answers
107 views
Hi,

I don't understant why I have to do a rebind() after apply a filter.

Is there an other way to to this in order to speed the display ?

At init, the user have all datas. So they must be in memory ?
If I put then a filter I have to do a rebind in order to apply it and so, redownload datas....

Is there a way to keep radgrid data in memory (table ?) and then ask to the client to filter them ?

Thanks

Filleau
Top achievements
Rank 1
 asked on 07 Apr 2011
4 answers
245 views
Hi:

This is my first try with Telerik controls, so please forgive me if I seem ignorant.  I am trying to use the RadGrid to create a DataList-type look.  I follow the example "Grid / ListView/DataList View" (http://demos.telerik.com/aspnet-ajax/grid/examples/programming/listview/defaultcs.aspx) from the demos, and I successfully displayed a grid.  It looks rather odd, though, with one cell at the top of the form, then the "page counter control", then eleven cells showing below.  (See the attachment.)  Does anyone know what's happening here?  Thanks!

Steve Smith

P.S. The aspx:
<%@ 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">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
    <link href="~/Styles/gridstyle.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <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>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>

        <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" AllowFilteringByColumn="true"
            runat="server" GridLines="None" AllowPaging="true" AllowSorting="true"
            PageSize="12">
            <MasterTableView TableLayout="Fixed">
            <PagerStyle Mode="NextPrevAndNumeric" />
                <ItemTemplate>
                    <%# (((GridItem)Container).ItemIndex != 0)? "</td></tr></table>" : "" %>
                    <asp:Panel ID="ItemContainer" CssClass='<%# (((GridItem)Container).ItemType == GridItemType.Item)? "item" : "alternatingItem" %>'
                        runat="server" HorizontalAlign="Left">
                        <b><%# Eval("PCName")%></b>
                        <br />
                        <%# Eval("ProductName")%>
                        <br />
                        sku:&nbsp
                        <%# Eval("Sku")%>
                        <br />
                        Price:&nbsp
                        <%# Eval("Price")%>
                        <br />
                        CV:&nbsp
                        <%# Eval("CV")%>
                    </asp:Panel>
                </ItemTemplate>
            </MasterTableView>
            <GroupingSettings CaseSensitive="false" />

        </telerik:RadGrid>
         
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:Database Connection String %>"
        ProviderName="<%$ ConnectionStrings:Database Connection String.ProviderName %>"
        SelectCommand="select ProductCategory.Name PCName, ProductName, Sku, ProductPricePlan.RetailPrice Price, ProductPricePlan.UnitComVol CV
from Product
join ProductCategory on Product.ProductCategoryID = ProductCategory.ProductCategoryID
join ProductPricePlan on Product.ProductID = ProductPricePlan.ProductID and ProductPricePlan.PricePlanID = 1"></asp:SqlDataSource>
    </form>
</body>
</html>

Mark
Top achievements
Rank 1
 answered on 07 Apr 2011
6 answers
240 views
I notice that setting the background color of the RadListBox does not actually change the background color within the list area of the listbox.  The background color is only changed in the button area which is not the desired behavior.  I have controls on a web form and would like them all to have a consistent background color, but I don't seem to be able to achieve that just yet.

Using IE 8 and IE 8 Compatibility Mode for IE 7.
Dan
Top achievements
Rank 1
 answered on 07 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?