Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
152 views
Hi,

Currently, I don't know how to get the Grid at client site for the case below

1. I have a user control which contains a RadGrid control inside
2. I don't load this user control at the first time load of the page
3. When user clicks on the "Load" button, I will call back to the server via Ajax to render the content of the User Control above and set this data to the DIV element

Now, I can show entire content of that user control to the screen however I don't know how to get the Grid object inside that user control.

It always returns NULL when I use: var grid = $find(radGridClientId);

So my question is How can I get back the Grid in that case?

Any helps is appreciated,
Thanks,
Dan
Maria Ilieva
Telerik team
 answered on 01 May 2013
3 answers
103 views
When using a RadButton with icons, when the mouse is over the icon, it should display the PrimaryHoveredIconURL.  Then when you move the mouse off of the icon it should change to the PrimaryIconURL.  

This works fine in most cases.  However if you have a client event on the button - OnClientClicked - that launches a RadAlert, when you move the mouse off the button to close the RadAlert, the icon does not change back to the PrimaryIconURL.  So you are left with an icon that appears to be hovered. It 'fixes itself' once you move the mouse back over the icon and off it again.

An interesting not is that if you use a JavaScript alert instead of the RadAlert, it works as expected and the PrimaryIconURL is displayed.  Both RadAlert and RadWindow have the same issue.  Is there any way around this?

<telerik:RadButton runat="server" ID="btnAdvertiserSearch" AutoPostBack="false"
     Skin="Metro" OnClientClicked="openAlert">
     <Icon PrimaryIconUrl="~/resources/images/ui-icon-search.png"
         PrimaryHoveredIconUrl="~/resources/images/ui-icon-search_hover.png" />
 </telerik:RadButton>

function openAlert(sender, args)
{
    radalert('a', null, null, 'b', null);
}
Bozhidar
Telerik team
 answered on 01 May 2013
1 answer
120 views
When I resize startTime of appointment it works but when I re-size endTime of appointment it does not work.
Current Time is 11:00 to 11:30. When I re-size startTime to 9:00 it works. Now Time is 9:00 to 11:30. But when I resize endTime to 14:00 e.ModifiecdAppointment still is 11:30!
Plamen
Telerik team
 answered on 01 May 2013
1 answer
148 views
Hello Telerik,

My Apologies, the thread title should read:

Dynamic GridBoundColumn Width During Development Time Renders Differently When Deployed To Web Server

I'm at a loss here. I have a static RadGrid "rgEventQuery". I successfully create the columns for this RadGrid dynamically and I also dynamically change the width of any of these columns. What I can't understand is why the width of these dynamic columns appears different when the grid is displayed during development time than when it is deployed to the web server.

The property I'm changing is the HeaderStyle.Width property. Below are some code snippets: 

fld = "DEPARTMENT"
fldWidth = "55:T"
gbc =
New GridBoundColumn
gbc.DataField = fld
rgEventQuery.MasterTableView.Columns.Add(gbc)
gbc.UniqueName = fld
gbc.SortExpression = fld
gbc.HeaderButtonType = GridHeaderButtonType.LinkButton
If fldWidth <> "" Then
    If fldWidth.Contains(":") Then
        If IsNumeric(fldWidth.Split(":")(0)) Then
            gbc.HeaderStyle.Width = fldWidth.Split(":")(0)
        End If
    Else
        If IsNumeric(fldWidth) Then
            gbc.HeaderStyle.Width = fldWidth.Split(":")(0)
        End If
    End If
End If
gbc.AllowSorting = True
rgEventQuery.MasterTableView.SortExpressions.AddSortExpression(gbc.SortExpression)


If you could create a sample website (that works on your end) that I can test on my end, that would be greatly appreciated.

Thank you.

Virgil
Martin
Telerik team
 answered on 01 May 2013
4 answers
133 views
If a serie has a value which is the maximum value of the Y-axis, then the point is not rendered completely, only a semicircunference is shown.

Is this a bug?
Ves
Telerik team
 answered on 01 May 2013
4 answers
237 views
I have a RadGrid with NeedDataSource binding.  It also has an EditTemplate. The following code works well for saving the users updates except that the EditTemplate doesn't close. How do I close the EditTemplate?

protected void ModelGrid_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == RadGrid.UpdateEditedCommandName)
            {
                if (e.Item is GridEditFormItem)
                {
                    GridEditFormItem item = (GridEditFormItem)e.Item;
                    string id = item.GetDataKeyValue("ModelId").ToString();
                    if (!String.IsNullOrEmpty(id))
                    {

                        Model m = new Model();
                        try
                        {
                            m.ModelId = id;
                            m.ManufacturerId = SelctedManufacturerId;
                            m.ModelNumber = ((TextBox)item.FindControl("txtEditModelNumber")).Text;
                            m.Description = ((TextBox)item.FindControl("txtEditDescription")).Text;
                            m.ProductLineId = ((RadComboBox)item.FindControl("ddlProductLine")).SelectedValue;
                            m.AssetTypeId = ((RadComboBox)item.FindControl("ddlAssetType")).SelectedValue;
                            m.DefAssetPosition = int.Parse(((DropDownList)item.FindControl("ddlDefAssetPos")).SelectedValue);

                            m.UseRackUnits = ((CheckBox)item.FindControl("chkUseRack")).Checked;
                            m.Height = (Double)((RadNumericTextBox)item.FindControl("numEditHeight")).Value;
                            m.Width = (Double)((RadNumericTextBox)item.FindControl("numEditWidth")).Value;
                            m.Depth = (Double)((RadNumericTextBox)item.FindControl("numEditDepth")).Value;

                            AssetVueBLL.UpdateModel(m, MySession.Current.UserId);
                            ModelGrid.Rebind();
                            
                        }
                        catch (Exception ex)
                        {
                            ModelGrid.Controls.Add(new LiteralControl("<strong>Unable to save Model</strong> - " + ex.Message));
                            e.Canceled = true;
                        }
                    }
                }
            }
        }
Tsvetoslav
Telerik team
 answered on 01 May 2013
1 answer
212 views
I have a RadGrid with a  NeedDataSource binding.  The grid also has an EditTemplate.  The update is working well, but on hitting Add New Item, I'm getting errors binding to the edit controls because there is no default value.  The dropdownlist errors because the selectedvalue of "" is not in the list.  When I fix that by adding a blank item to the list (which I really don't want) the RadNumericEdit errors because "" can't be converted to a double.  How do I set default values?
Tsvetoslav
Telerik team
 answered on 01 May 2013
1 answer
107 views

In the demo ODataDataSource - Filtering, Sorting and Paging with RadGrid, the paging does not work as expected.  The page size can be changed, but it does not "stick" as you move between pages.  For example, change the page size to 10 and move to the second page and you will find that while 10 is still the page size shown on the grid, that 20 rows are shown.

I noticed this bug in my own code and traced it back to how the demo worked.  I have not yet solved the issue (despite the fact that it looks like there is an easy fix when you examine the code).  Can you provide any guidance on this issue and then get the demo fixed so this bug doesn't spread all around the internet as people copy the demo code? Thanks. :)
Pavlina
Telerik team
 answered on 30 Apr 2013
0 answers
111 views
I have a Checkbox in DetailItemTemplate in a RadGrid.  I am triggering an AjaxRequest with javascript

How can I get each checkbox value in my event? [protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)]

I have a button called "delete checked".  I have several other action I run thru by sending different arguments, not sure how to handle this one. Would I loop thru the rows?

Any direction?

Thanks,

Marty

SOLVED: 
List<string> selectedItems = new List<string>();
                foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
                {
                    RadButton DelCheck = item.DetailTemplateItemDataCell.FindControl("DelCheck") as RadButton;
                    if (DelCheck.Checked)
                    {
                        selectedItems.Add(DelCheck.CommandArgument);
                    }
                }



moegal
Top achievements
Rank 1
 asked on 30 Apr 2013
0 answers
183 views

After my user drags a column to be grouped (i.e. client, sales person) it generates a summary value (order total) in the group footer.  I want to sort the grouped results by that summary value that shows up in the footer.

Looking for results like this:

Client         Total Amount
ABC Corp   $1000
ABC Corp   $1500
                   $2500

XYZ LLC     $2000
XYZ LLC     $1750
                    $3750

LMN Inc      $4500
                    $4500

If this helps, my static radgrid definition is as follows:

<telerik:RadGrid ID="rgOrders" ShowGroupPanel="True" Width="1300px" Height="750px"
                AutoGenerateColumns="False" AllowPaging="True" PageSize="25" AllowSorting="True"
                runat="server" OnNeedDataSource="rgOrders_NeedDataSource" Skin="WebBlue" OnItemCommand="rgOrders_ItemCommand"
                AllowFilteringByColumn="False" CellSpacing="0" ShowFooter="true" GridLines="None"
                OnItemDataBound="rgOrders_ItemDataBound">
                <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true"
                    HideStructureColumns="true">
                </ExportSettings>
                <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True" AllowGroupExpandCollapse="True"
                    ReorderColumnsOnClient="True" AllowDragToGroup="True">
                    <Scrolling AllowScroll="False" UseStaticHeaders="True" />
                    <Resizing AllowColumnResize="true" AllowRowResize="true" />
                </ClientSettings>
                <MasterTableView CommandItemDisplay="Top" EnableLinqGrouping="false" ShowGroupFooter="True">
                    <CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true"
                        ShowExportToCsvButton="true" ShowExportToPdfButton="true" ShowAddNewRecordButton="false" />
                    <Columns>
                        <telerik:GridTemplateColumn HeaderText="Edit" ItemStyle-HorizontalAlign="Center"
                            ItemStyle-Width="40" HeaderStyle-Width="40">
                            <ItemTemplate>
                                <asp:imagebutton id="ibtnUpdate" commandname="Edit" runat="server" imageurl="images/silk/pencil_go.png" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Order Summary" ItemStyle-HorizontalAlign="Center"
                            ItemStyle-Width="60" HeaderStyle-Width="60">
                            <ItemTemplate>
                                <asp:imagebutton id="ibtnView" commandname="View" runat="server" imageurl="images/1258747021_old-edit-find.png" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Set Location" ItemStyle-HorizontalAlign="Center"
                            ItemStyle-Width="60" HeaderStyle-Width="60">
                            <ItemTemplate>
                                <asp:imagebutton id="ibtnLocation" commandname="Location" runat="server" imageurl="images/1366329632_map.png" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="ClientName" ItemStyle-Width="200px" HeaderStyle-Width="200"
                            FilterControlAltText="Filter ClientName column" HeaderText="Client Name" ReadOnly="True"
                            AllowFiltering="false" SortExpression="ClientName" UniqueName="ClientName" AutoPostBackOnFilter="false"
                            CurrentFilterFunction="EqualTo" FilterDelay="4000" ShowFilterIcon="True" />
                        <telerik:GridBoundColumn DataField="OrderID" ItemStyle-Width="75px" HeaderStyle-Width="75px"
                            FilterControlAltText="Filter OrderID column" HeaderText="Order ID" ReadOnly="True"
                            AllowFiltering="false" SortExpression="OrderID" UniqueName="OrderID" />
                        <telerik:GridBoundColumn DataField="OrderDate" DataFormatString="{0:MM/dd/yyyy}"
                            ItemStyle-Width="75px" HeaderStyle-Width="75px" FilterControlAltText="Filter OrderDate column"
                            HeaderText="Order Date" ReadOnly="True" AllowFiltering="True" SortExpression="OrderDate"
                            UniqueName="OrderDate" />
                        <telerik:GridNumericColumn Aggregate="Sum" AllowSorting="true"  DataField="TotalAmount" DataFormatString="{0:C}"
                            ItemStyle-Width="75px" HeaderStyle-Width="75px" FilterControlAltText="Filter TotalAmount column"
                            HeaderText="Total MRR" ReadOnly="True" AllowFiltering="True" SortExpression="TotalAmount"
                            UniqueName="TotalAmount" ItemStyle-HorizontalAlign="Right" />
                        <telerik:GridNumericColumn Aggregate="Sum" AllowSorting="true" DataField="NRC" DataFormatString="{0:C}"
                            ItemStyle-Width="75px" HeaderStyle-Width="75px" FilterControlAltText="Filter NRC column"
                            HeaderText="Total NRC" ReadOnly="True" AllowFiltering="True" SortExpression="NRC"
                            UniqueName="NRC" ItemStyle-HorizontalAlign="Right" />
                        <telerik:GridBoundColumn DataField="OrderStatus" ItemStyle-Width="75px" HeaderStyle-Width="75px"
                            FilterControlAltText="Filter OrderStatus column" HeaderText="Order Status" ReadOnly="True"
                            AllowFiltering="false" SortExpression="OrderStatus" UniqueName="OrderStatus" />
                        <telerik:GridTemplateColumn HeaderText="Invoiced?" ItemStyle-Width="70px" HeaderStyle-Width="70px">
                            <ItemTemplate>
                                <%# GetYesNo(Eval("Invoiced"))%>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="OrderTrialType" ItemStyle-Width="50px" HeaderStyle-Width="50px"
                            FilterControlAltText="Filter OrderTrialType column" HeaderText="Order Trial?"
                            ReadOnly="True" AllowFiltering="false" SortExpression="OrderTrialType" UniqueName="OrderTrialType" />
                        <telerik:GridBoundColumn DataField="FullName" ItemStyle-Width="100px" HeaderStyle-Width="100px"
                            FilterControlAltText="Filter FullName column" HeaderText="Sales Rep" ReadOnly="True"
                            AllowFiltering="false" SortExpression="FullName" UniqueName="FullName" />
                        <telerik:GridBoundColumn DataField="FirmOrderDeliveryDate" DataFormatString="{0:MM/dd/yyyy}"
                            ItemStyle-Width="75px" HeaderStyle-Width="75px" FilterControlAltText="Filter FirmOrderDeliveryDate column"
                            HeaderText="Target Delivery Date" ReadOnly="True" AllowFiltering="false" SortExpression="FirmOrderDeliveryDate"
                            UniqueName="FirmOrderDeliveryDate" />
                        <telerik:GridBoundColumn DataField="ContractStartDate" DataFormatString="{0:MM/dd/yyyy}"
                            ItemStyle-Width="75px" HeaderStyle-Width="75px" FilterControlAltText="Filter ContractStartDate column"
                            HeaderText="Contract Start Date" ReadOnly="True" AllowFiltering="false" SortExpression="ContractStartDate"
                            UniqueName="ContractStartDate" />
                        <telerik:GridBoundColumn DataField="ContractEndDate" DataFormatString="{0:MM/dd/yyyy}"
                            ItemStyle-Width="75px" HeaderStyle-Width="75px" FilterControlAltText="Filter ContractEndDate column"
                            HeaderText="Contract End Date" ReadOnly="True" AllowFiltering="false" SortExpression="ContractEndDate"
                            UniqueName="ContractEndDate" />
                        <telerik:GridBoundColumn DataField="PM_Name" ItemStyle-Width="100px" HeaderStyle-Width="100px"
                            FilterControlAltText="Filter PM_Name column" HeaderText="Prov. Mgr" ReadOnly="True"
                            AllowFiltering="false" SortExpression="PM_Name" UniqueName="FullPM_NameName" />
                        <telerik:GridBoundColumn DataField="BillingFrequency" FilterControlAltText="Filter BillingFrequency column"
                            HeaderText="Billing Frequency" ReadOnly="True" AllowFiltering="false" SortExpression="BillingFrequency"
                            UniqueName="BillingFrequency" />
                        <telerik:GridButtonColumn ConfirmText="Mark Inactive?" ConfirmDialogType="RadWindow"
                            ItemStyle-Width="50" HeaderStyle-Width="50" ConfirmTitle="Mark Inactive?" ButtonType="ImageButton"
                            CommandName="MakeInactive" Text="Mark Inactive?" UniqueName="MarkInactiveColumn"
                            ImageUrl="images/1263447248_cross.png">
                            <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle>
                        </telerik:GridButtonColumn>
                    </Columns>
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                        </EditColumn>
                    </EditFormSettings>
                </MasterTableView>
                <GroupingSettings ShowUnGroupButton="true" />
                <PagerStyle PageSizes="25,50,100,250 " />
            </telerik:RadGrid>


Any help is appreciated.  Thanks.
Hunter

Hunter
Top achievements
Rank 1
 asked on 30 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?