Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
200 views
Telerik,

I am trying to access a cell in a radgrid while using that value as querystring parameter to open a radwindow.  The radgrid is contained in a radpanelbar.  Please let me know what I am doing wrong.

Thanks,

Al

<%@ Page Language="C#" MasterPageFile="~/loggedin.master" AutoEventWireup="true"
    CodeFile="AdvancedSearch.aspx.cs" Inherits="AdvancedSearch" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    function ViewClick(obj)
    {
        var grid = document.getElementById("<%=rpAdvancedSearch.FindItemByValue("GripsPanelItem").FindControl("pGrips").FindControl("rgGrips").ClientID %>");
        var master = grid.ClientID.get_masterTableView();
        var rowElement = obj.parentElement.parentElement;
        
        var cell = master._getCellByColumnUniqueNameFromTableRowElement(rowElement, "GripId");
        var id = cell.innerHTML;           
        var wnd = window.radopen("RequestiView.aspx?Id=" + id, null);         
    }
    </script>

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgGrips" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rgGrips">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgGrips" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadPanelBar runat="server" ID="rpAdvancedSearch" ExpandMode="MultipleExpandedItems"
        Width="100%">
        <Items>
            <telerik:RadPanelItem Text="Grips" Value="Grips" Expanded="false">
                <Items>
                    <telerik:RadPanelItem Value="GripsPanelItem">
                        <ItemTemplate>
                            <asp:Panel ID="pGrips" runat="server" Height="300px">
                                <telerik:RadGrid ID="rgGrips" GridLines="None" runat="server" AutoGenerateColumns="False"
                                    ShowHeader="true" OnInit="rgGrips_Init" >
                                    <MasterTableView>
                                        <Columns>
                                            <telerik:GridBoundColumn DataField="GripId" Visible="False" UniqueName="GripId">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridTemplateColumn UniqueName="gtcView" HeaderText="View">
                                                <ItemTemplate>
                                                    <asp:LinkButton runat="server" ID="lbView" Text="View" OnClientClick="return ViewClick(this)" />
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                    </MasterTableView>
                                </telerik:RadGrid>
                            </asp:Panel>
                        </ItemTemplate>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
        </Items>
    </telerik:RadPanelBar>
    <telerik:RadWindowManager ID="Singleton" runat="server" Width="1100px" Height="750px"
        VisibleStatusbar="false" Behavior="Close,Move,Resize,Pin,Reload" Modal="true"
        Skin="Telerik" Style="z-index: 7001">
    </telerik:RadWindowManager>
</asp:Content>
Marin Bratanov
Telerik team
 answered on 12 Aug 2011
1 answer
131 views
Hi,

I am having a problem with RadWindow control. On the click of server side button control, radwindow is opened which is fine. User closes it. When Page Postback happens, it automatically opens which is undesirable. How can I get rid of this behaviour?

Code Snippet - Html Source...

<telerik:RadWindowManager ID="ExclusionWindow" runat="server" Skin="Office2007" Width="500"
        Height="400" Visible="true">
    </telerik:RadWindowManager>
..................


Code behind ..


 protected void btnSetExclusion_Click(object sender, EventArgs e)
        {
            if (Master == null) return;
            Label lblPortfolio = (Label)Master.FindControl("lblPortfolioID");
            int orgID = Convert.ToInt32(lblPortfolio.Text);
            RadWindow window = new RadWindow()
            {
                ID = "Exclusion Window",
                VisibleOnPageLoad = true,
                NavigateUrl = "frmCMExclusions.aspx?OrgID=" + orgID,
                Modal = true,
                DestroyOnClose = true,
                Behaviors = WindowBehaviors.Close
            };
            ExclusionWindow.Visible = true;
            ExclusionWindow.Windows.Add(window);
            ExclusionWindow.DestroyOnClose = true;
        }


Many thanks.

Milan G



Marin Bratanov
Telerik team
 answered on 12 Aug 2011
1 answer
45 views
Hello people,

I'm using 3 RadListBoxes with 2 RadGrids on the same page aspx, but i' d'ont know how to arrange them in the page...

I'm using a <table> to group them in columns but it's not working...I d'ont like the appearence

Can you help me?

My code aspx is the next:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AssignInvoices.aspx.cs" Inherits="iConnect.InvoicesScaling.Views.AssignInvoices" 
    Title="AssignInvoices" MasterPageFile="~/Shared/Silver.master" %> 
    
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<asp:Content ID="content" ContentPlaceHolderID="DefaultContent" runat="Server"
    <script src="../Shared/js/jquery-1.6.2.min.js" type="text/javascript"></script
    <script src="../Shared/js/jquery.tooltip.js" type="text/javascript"></script
    <script type="text/javascript" src="../Silverlight.js"></script
    <h1 style="text-align: center;"
        Assign Invoices</h1
    <br /> 
    <table
        <tr
            <td
                <telerik:RadListBox ID="RadListBox1" runat="server" AllowReorder="True" Skin="Black"
                    Sort="Ascending" Height="400px" Width="250px" EnableDragAndDrop="True"
                    <ButtonSettings TransferButtons="All"></ButtonSettings
                    <HeaderTemplate
                        <h5 style="color: White; text-align: center"
                            USERS</h5
                    </HeaderTemplate
                </telerik:RadListBox
            </td
            <td
                <telerik:RadListBox ID="RadListBox2" runat="server" SelectionMode="Multiple" EnableDragAndDrop="True"
                    Height="400px" Width="150px" AllowReorder="True" Skin="Black"
                    <ButtonSettings TransferButtons="All"></ButtonSettings
                    <HeaderTemplate
                        <h5 style="color: White; text-align: center"
                            GROUPS</h5
                    </HeaderTemplate
                </telerik:RadListBox
            </td
            <td
                <telerik:RadListBox ID="RadListBox3" runat="server" EnableDragAndDrop="True" Height="400px"
                    Width="150px" AllowReorder="True" Skin="Black"
                    <ButtonSettings TransferButtons="All"></ButtonSettings
                    <HeaderTemplate
                        <h5 style="color: White; text-align: center"
                            STAGING</h5
                    </HeaderTemplate
                </telerik:RadListBox
            </td
            <td
                <telerik:RadButton ID="RadButton1" runat="server" Text="Assign" Skin="Black" Width="100px"
                    Height="50px" OnClick="RadButton1_Click"
                </telerik:RadButton
                <br /> 
                <br /> 
                <telerik:RadButton ID="RadButton2" runat="server" Text="Unassign" Skin="Black" Width="100px"
                    Height="50px" OnClick="RadButton2_Click"
                </telerik:RadButton
            </td
            <td
            </td
            <td
            </td
            <td
                <h1
                    Total Invoices Resume </h1
                <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Windows7"
                </telerik:RadGrid
            </td
        </tr
        <tr
            <td
            </td
            <tr
                <td
                </td
                <td
                    <telerik:RadGrid ID="RadGrid2" runat="server" Skin="Windows7"
                    </telerik:RadGrid
                    <h1
                    Total Invoices Resume </h1
                <telerik:RadGrid ID="RadGrid3" runat="server" Skin="Windows7"
                </telerik:RadGrid
                </td
            </tr
        </tr
    </table
    <br /> 
    <br /> 
</asp:Content>
Ricardo
Top achievements
Rank 1
 answered on 12 Aug 2011
1 answer
95 views
Hi, to get all edit row values I'm using hashtable as I found somewhere in the forum (can not know how many columns I'll have and their names).
The problem, and to me is a very big issue, is that when i iterate the hasttable, column order is completely lost (actually I don't even understand what kind of sorting it does). How can I have them in the original columns order?

Protected Sub RadGrid1_UpdateCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand
       
            Dim editItem As GridEditableItem = CType(e.Item, GridEditableItem)
            Dim newValues As Hashtable = New Hashtable()
            e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editItem)
 
            For Each entry In newValues
                'LogManager.WriteToDebugLog("c:\log\qwe\", "- newValues key" & entry.key & "  value" & CType(entry.value, String))
            Next
 
End Sub

Thank you
Mira
Telerik team
 answered on 12 Aug 2011
2 answers
72 views
Hi All

I have set the pager style to "Slider" on a radgrid & the slider control button id overflowing the grid (See attached pic)!
The grid is inside of a splitter.
Has anyone experienced this before & if so how did thet cure it?

Many Thanks

Regards

Cush
Cush
Top achievements
Rank 1
 answered on 12 Aug 2011
1 answer
204 views
We have a simple RadGrid on a page (static column widths) which is inside a div defined with a min-width of 1000px.  If a user opens their browser and the window is less than 1000px and then resizes the window, the grid will be fixed width and won't resize.  If the window is bigger than 1000px, the grid resizes with the window.

The problem exists in both IE and FF.  Looking at the source with IE, the style on the grid says width:100%.  If I look at it with FireFox, the RadGrid shows a fixed width (style="width:1067px").  If its bigger than 1000px, it shows as dynamic (style="width:100%").  What property controls this?  What is the proper way to fix it?
Pavlina
Telerik team
 answered on 12 Aug 2011
1 answer
142 views
Hi

In our product we are using jQuery ajax to load the aspx pages asynchronously.  When we try to load the page which contains Rad Editor thinks are not going correct as it need to be.

Let me explain in detail what exactly is happening. We have a Editor.aspx page which contain Rad Editor our goal is to call this page using jQuery Ajax and by using Editor Client-side API we will read html contain from Editor and populate html contain to Editor. When we load the Editor.aspx page Editor render properly in UI but none of the functionality is working at all.

Here I am able to simulate the scenario using an sample ASP.Net 4.0 Web Project

In Editor.aspx page

<form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager runat="server"></telerik:RadScriptManager>
        <telerik:RadEditor runat = "server" ></telerik:RadEditor>
    </div>
</form>

The page from where we are calling the Editor.aspx page

<script type="text/javascript">
 
        $(document).ready(function () {
           
            $("#success").load("Editor.aspx", function (response, status, xhr) {
                if (status == "error") {
                    var msg = "Sorry but there was an error: ";
                    $("#error").html(msg + xhr.status + " " + xhr.statusText);
                }
            });
 
        });
         
  </script>

due to Attachment restriction i am unable to provide the sample project. If the sample project needed, please let me know so i can able to send it by mail.

Waiting for your replay :) thanks,

Prabhudatta
BrandSystems



Rumen
Telerik team
 answered on 12 Aug 2011
3 answers
57 views

Hello,

We have certain problem by RadGrid filter. We need to bind data using DataTable class. We have prepared data for RadGrid by combination of data from database with computed data. Therefore,the SqlDataSource is not useful for us. We have found example regarding mentioned scenario in your forum. The example uses ItemCreated event, but it doesn’t work. Data is binding correctly, however the filtering doesn’t work.

We consider the solution based on DataTable (stored in a session) shared by controls inherited from a GridTemplateColumn. However, this approach seems to be complicated for described aim which appears to be trivial.

So, is there any way to accomplish the DataTable binding as a data source for the RadGrid without harm the filtering?


Thank yout very much for your advice.

<telerik:RadGrid ID="RadGridData" runat="server" Width="100%" AutoGenerateColumns="false"

    AllowPaging="true" PageSize="10" ShowGroupPanel="false" ShowFooter="true" AllowFilteringByColumn="true"

    OnPreRender="RadGridData_PreRender" AllowSorting="true" AllowMultiRowSelection="false"

    GridLines="None" EnableAjaxSkinRendering="true" EnableAJAX="true"

    onneeddatasource="RadGridData_NeedDataSource" OnItemCreated="RadGridData_ItemCreated" ViewStateMode="Disabled">

    <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true" />

    <MasterTableView AutoGenerateColumns="false" EditMode="InPlace" AllowFilteringByColumn="True"

        ShowFooter="True" TableLayout="Auto" DataKeyNames="Id" CommandItemDisplay="Top">

        <CommandItemSettings ShowRefreshButton="false" ShowAddNewRecordButton="false" ShowExportToWordButton="true" ShowExportToExcelButton="true"

                ShowExportToCsvButton="true" />

        <Columns>

            <telerik:GridBoundColumn UniqueName="Caption" DataField="Caption" HeaderText="Caption"

                AllowFiltering="true" DataType="System.String">

                <HeaderStyle Width="25%" />

                <FilterTemplate>

                    <telerik:RadComboBox ID="RadComboBoxCaption" DataTextField="Caption" DataValueField="Caption" Height="200px" AppendDataBoundItems="true"

                        SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Caption").CurrentFilterValue %>'

                        runat="server" OnClientSelectedIndexChanged="CaptionChanged">

                        <Items>

                            <telerik:RadComboBoxItem Text="All" />

                        </Items>

                    </telerik:RadComboBox>

                    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

                        <script type="text/javascript">

                            function CaptionChanged(sender, args) {

                                var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");

                                tableView.filter("Caption", args.get_item().get_value(), "EqualTo");

                            }

                        </script>

                    </telerik:RadScriptBlock>

                </FilterTemplate>

            </telerik:GridBoundColumn>

            <telerik:GridDateTimeColumn DataField="DateTime" HeaderText="RTU Date and time" SortExpression="DateTime"

                UniqueName="DateTime" PickerType="DateTimePicker" AllowFiltering="false">

                <HeaderStyle Width="25%" />

            </telerik:GridDateTimeColumn>

            <telerik:GridBoundColumn UniqueName="FormatedValue" DataField="FormatedValue" HeaderText="Value"

                AllowFiltering="true" DataType="System.String">

                <HeaderStyle Width="25%" />

            </telerik:GridBoundColumn>

            <telerik:GridBoundColumn UniqueName="State" DataField="State" HeaderText="State"

                AllowFiltering="true" DataType="System.String">

                <HeaderStyle Width="25%" />

            </telerik:GridBoundColumn>

        </Columns>

        <PagerStyle Mode="NextPrevAndNumeric" />

    </MasterTableView>

</telerik:RadGrid>

    protected void RadGridData_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)

        {

            if (e.Item is GridFilteringItem)

            {

                GridFilteringItem filterItem = (GridFilteringItem)e.Item;

                RadComboBox combo = (RadComboBox)filterItem["Caption"].FindControl("RadComboBoxCaption");

                combo.DataSource = dataTable; // this datatable is also used for binding data for table

                combo.DataBind();

                combo.AutoPostBack = true;

            }

        }

Pavlina
Telerik team
 answered on 12 Aug 2011
2 answers
426 views
I have Master grid when i selected row based on selcted row i have display more than two rad grids based on selected row for these rad grid i have add ,edit delete when i click add link it is oen rad window addd adding record and page reload but i dont want to reload page i want refresh which grid is i added recoed for that i have use following code

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
            </telerik:AjaxSetting>
      <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdFiles">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdFiles" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdResource">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdResource" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdMessages">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdMessages" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grdTasks">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdTasks" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

in code behind i wrote like this 

 protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        if (e.Argument == "Rebind")
        {
           
            RadGrid1.MasterTableView.SortExpressions.Clear();
            RadGrid1.MasterTableView.GroupByExpressions.Clear();
            RadGrid1.Rebind();
           grdFiles.MasterTableView.SortExpressions.Clear();
            grdFiles.MasterTableView.GroupByExpressions.Clear();
           grdFiles.Rebind();


            grdResource.MasterTableView.SortExpressions.Clear();
            grdResource.MasterTableView.GroupByExpressions.Clear();
            grdResource.Rebind();


            grdMessages.MasterTableView.SortExpressions.Clear();
            grdMessages.MasterTableView.GroupByExpressions.Clear();
            //grdMessages.Rebind();
           
        }
        else if (e.Argument == "RebindAndNavigate")
        {
                RadGrid1.MasterTableView.SortExpressions.Clear();
            RadGrid1.MasterTableView.GroupByExpressions.Clear();
            RadGrid1.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;
            RadGrid1.Rebind();
            grdFiles.MasterTableView.SortExpressions.Clear();
            grdFiles.MasterTableView.GroupByExpressions.Clear();
            grdFiles.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount - 1;
            grdFiles.Rebind();
       
     
        }
    }

Please help me how to reslove this issue
Maria Ilieva
Telerik team
 answered on 12 Aug 2011
3 answers
164 views
Hello,
I have a template column which contains combobox with treeview inside, as described here. But, as it's all in grid TemplateColumn, I don't want those trees to load their content on initial page load, because this will make page too heavy. So I populate it from web service when user opens a dropdown box. Here is my javascript code:

var refCbTree;
var refCb;
function ReferenceComboBoxOpeningHandler(sender, args) {
    refCb = sender;
    refCbTree = $find(sender.get_attributes().getAttribute("treeID"));
    service.LoadReferenceRoot(sender.get_attributes().getAttribute("refID"), onRequestNodesSuccess);  
}
 
function onRequestNodesSuccess(result) {
    if (!refCbTree) return;
    refCb.trackChanges();
    refCbTree.trackChanges();
    for (i = 0; i < result.length; i++) {
        var node = new Telerik.Web.UI.RadTreeNode();
        node.set_text(result[i].Text);
        node.set_value(result[i].Value);
        refCbTree.get_nodes().add(node);
    }
    refCbTree.commitChanges();
    refCb.commitChanges();
}

So when service returns nodes, all nodes seem to be populated in tree, but tree won't resize and so with combobox. Attached is screenshot of what I see.
Is that possible to resize both controls to reveal their contents after loading nodes?
Thank you.
Dimitar Terziev
Telerik team
 answered on 12 Aug 2011
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?