Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
90 views
Hi, I looking for an implementation example where there is a new button located beside the combobox. When new button click, a popup appear for user to enter new value. when saved, the new value gets populated in the combobox for selection. Not sure doable in web form. Any suggestion welcome. Thanks!

Regards
cwk
Kalina
Telerik team
 answered on 21 Apr 2012
3 answers
537 views

Anyone know how to programmatically add rows to a detail table in hierarchical radgrid?  I need to add rows to an unknown number of details tables at one time based on values the user has selected in a listbox. 

protected void btnAdd_Click(object sender, EventArgs e)
{
    foreach (RadListBoxItem li in lbSnSelected.Items)
    {
        foreach (GridDataItem gi in rgDefects.Items)
        {
            if ((gi.OwnerTableView.ParentItem as GridDataItem).GetDataKeyValue("SERIAL_NBR").ToString()
                == li.Value)
            {
                GridTableView tv = (GridTableView)gi.ChildItem.NestedTableViews[0];
 
                //Need to insert using Grid Item but not sure how to create and fill grid item object from
                //Details table
                //tv.InsertItem(ddTest.SelectedItem.Text, ddTest.SelectedValue, ddRefDes.SelectedValue,
                //    ddDefect.SelectedItem.Text, ddDefect.SelectedValue, rddTech.SelectedValue, DateTime.Now);
                //tv.Rebind();
            }
        }
    }
}
Marin
Telerik team
 answered on 21 Apr 2012
3 answers
248 views
I'm trying to find the best way to make an _AjaxRequest fired from client side java script update select controls on my page that has a masterpage.  The control may also be within a user control.  

Currently I have a master page with an AjaxManager on it as follows:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientIDMode="Static"
       RequestQueueSize="1" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
       <ClientEvents OnRequestStart="requestStart" />
   </telerik:RadAjaxManager>

I then have a aspx page using the master page my aspx page has a ajaxmanager proxy on it. On the aspx page I have a radbutton that will call a java script function to make an ajaxrequest as follows:
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    </telerik:RadAjaxManagerProxy>
    <telerik:RadCodeBlock runat="server">
        <script type="text/javascript">
            // Ajax Request
            function CallJSFileInitAjaxRequestFromButtonPress()
            {
                // alert('Start Request');
                initAjaxRequest("Pressed");
                // alert('End Request');
            }
 
function initAjaxRequest(RequestType)
{
        $find("RadAjaxManager1").ajaxRequest(RequestType);
}
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadButton ID="RadButton1" runat="server" Text="Click Me" OnClientClicking="CallJSFileInitAjaxRequestFromButtonPress">
    </telerik:RadButton>
    <asp:Label ID="lblUpdate" runat="server" Text="Loaded..."></asp:Label>
</asp:Content>

Everything works and the server side code will get called and I attempt to update the label lblupdate.  The problem is that it will not update the browser.  I was able to get this to work without a master page but when I put the masterpage in the screen will not refresh.  

From my codebehind I'm adding the ajaxsetting:
Telerik.Web.UI.RadAjaxManager myManager;
myManager = (Telerik.Web.UI.RadAjaxManager)Page.Master.FindControl("RadAjaxManager1");
myManager.AjaxSettings.AddAjaxSetting(Page.Master.FindControl("RadAjaxManager1"), Page.Master.FindControl("MainContent").FindControl ("lblUpdate"));


Iana Tsolova
Telerik team
 answered on 21 Apr 2012
4 answers
351 views
Ok, first of all hi :)

ALready programming two-months with Telerik, I feel I started to get the grip of things. However there is something that has troubled me for the past few days in my work trying different implementations, but I still cannot seem to find a solution....

What I want to do:
I want to redirect to a new page through a button ( - I don't know if there are practical differences between Image and Link button other than how it is viewed on the user, but I prefer ImageButton - ), which also will pass a variable it in the url (http://www.lala.com?var=myvar - any other way are acceptable)

What I currently do:
In my .aspx file I have
(Grid Properties)
<
 
telerik:RadGrid ID="rdEthnologicalImages" runat="server"
 
AllowSorting="True" AutoGenerateColumns="False" CellSpacing="0"
 
AllowPaging="True" ShowStatusBar="True" GridLines="None"
 
OnItemCommand="RadGrid_Command" OnNeedDataSource="RadGrid_NeedDataSource"
 
OnItemDataBound="RadGrid_ItemDataBound">

(Grid Buttons - Download is the button to redirect, Link keeps the text to parse)
<telerik:GridButtonColumn
    FilterControlAltText="Filter Download column" HeaderText="Download"
    ImageUrl="~/Img/download.png" ItemStyle-HorizontalAlign="Center" Text="Download"
    CommandName="Download" UniqueName="Download"><HeaderStyle Width="50px"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</telerik:GridButtonColumn>
<telerik:GridBoundColumn DataField="Link"
        FilterControlAltText="Filter ImageLink column" HeaderText="Link"
        UniqueName="ImageLink" Visible="False">
</telerik:GridBoundColumn>

In my .cs file
(I eventually found out that LinkButton has no OnCLick attribute, so that brings me at a dead end...I think..)
(After it found the correct element, it should call the javascript function in the MasterPage - included in the <head>)
if (e.Item.ItemType == GridItemType.Item)
            {
                GridDataItem dataItem = (GridDataItem)rdEthnologicalImages.MasterTableView.GetItems(GridItemType.Item)[0];
                //LinkButton downloadButton = (LinkButton)dataItem.FindControl("Download");
                LinkButton downloadButton = (LinkButton)e.Item.FindControl("Download");
                if (downloadButton != null)
                {
                    downloadButton.Attributes.Add("OnClick", "popup");
                }
            }


In my .js file
(Since I have the text I need in a hidden column, I get it and pass it to the page I want)

function popup()
        {
 
            var grid = $find("<%=rdEthnologicalImages.ClientID %>");
            var MasterTable = grid.get_masterTableView();
            var selectedRows = MasterTable.get_selectedItems();
 
            for (var i = 0; i < selectedRows.length; i++)
            {
                var row = selectedRows[i];
                var link = MasterTable.getCellByColumnUniqueName(row, "ImageLink");
                window.open("~/DownloadPopup.aspx?filename=link");
                break;
            }
        }


Errors:
My main error is that downloadbutton(.cs) is always null. And even if it progressed properly I already have a bad feeling it won't work even then.

For some parts, I am not even 100% of what their functions are.
Any help in the matter?
Jayesh Goyani
Top achievements
Rank 2
 answered on 21 Apr 2012
1 answer
73 views
Attached is the image that describes my situation:

I input a number for each line. When I undo it I expected the number to be removed (per click of undo function) but it did not because it removes the Enter (new line) first then when I clicked the undo function again, that's the time that it removed the number.

Is that a normal behavior? But, I tried the radEditor demo in the demo site, it does not include Enter in the undo history list. The number was removed per click of undo function.

I am using Telerik.Web.UI.dll  v4.0.30319


Thank you.

Rumen
Telerik team
 answered on 21 Apr 2012
0 answers
92 views
Hello,

I used the recurring rule format string which create by the recurring control.
Recurring Rule:
DTSTART:20100923T120000Z  DTEND:20100923T130000Z  RRULE:FREQ=DAILY;UNTIL=20201231T000000Z;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU 
Date: 2010-09-23.
FromTime: 12:00:00.
ToTime: 13:00:00
.
I updated a row using this recurring format. I used the same string.
But it doesn't display in the calender. How should I do?

What is the  problem?
Please help me ASAP.

Thanks

Jiten Mutum
Jiten
Top achievements
Rank 1
 asked on 21 Apr 2012
3 answers
237 views
When I click on a button inside the RADGrid, how do I also update controls that exist outside of the grid?
I've tried the following so far:

1) RADAjaxManager.ResponseScripts.Add(String.Format("window['{0}'].AjaxRequest();", Me.RadAjaxPanel_PackageDetails.ClientID)
2) I also tried RADAjaxManager.AjaxSettings.AddAjaxSetting(Me.gridMain, Me.RadAjaxPanel_PackageDetails)
3) I also tried wrapping my grid in it's own RadAjaxPanel and used it's ResponseScripts.Add() method

None of these options seemed to have any effect what-so-ever. What link am I missing to get this to work?
Ben
Top achievements
Rank 1
 answered on 20 Apr 2012
1 answer
76 views
I've set a css class on each panel item and I can't get more spacing between each item. I just simply want there to be some more white space between each panel item. Do you have tutorials on styling a panel item?
Web Services
Top achievements
Rank 2
 answered on 20 Apr 2012
1 answer
143 views
Hello I have the Grid from this example on my page: 

http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/clienteditbatchupdates/defaultcs.aspx

It was working fine but now everytime it loads it gives me a javascript error saying "RadGrid1_Command" is undefined and it shows me this line of code:




Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadGrid, {"ClientID":"ctl00_ContentPlaceHolder1_GridQtyDeduction","ClientSettings":{"AllowAutoScrollOnDragDrop":true,"ShouldCreateRows":true,"DataBinding":{},"Selecting":{"CellSelectionMode":0},"Scrolling":{},"Resizing":{},"ClientMessages":{},"KeyboardNavigationSettings":{"AllowActiveRowCycle":false,"EnableKeyboardShortcuts":true,"FocusKey":89,"InitInsertKey":73,"RebindKey":82,"ExitEditInsertModeKey":27,"UpdateInsertItemKey":13,"DeleteActiveRow":127,"ExpandDetailTableKey":39,"CollapseDetailTableKey":37},"Animation":{}},"Skin":"Hay","UniqueID":"ctl00$ContentPlaceHolder1$GridQtyDeduction","_activeRowIndex":"","_controlToFocus":"","_currentPageIndex":0,"_editIndexes":"[]","_embeddedSkin":true,"_gridTableViewsData":"[{\"ClientID\":\"ctl00_ContentPlaceHolder1_GridQtyDeduction_ctl00\",\"UniqueID\":\"ctl00$ContentPlaceHolder1$GridQtyDeduction$ctl00\",\"PageSize\":15,\"PageCount\":1,\"EditMode\":\"InPlace\",\"AllowPaging\":true,\"CurrentPageIndex\":0,\"VirtualItemCount\":0,\"AllowMultiColumnSorting\":false,\"AllowNaturalSort\":true,\"AllowFilteringByColumn\":false,\"PageButtonCount\":10,\"HasDetailTables\":false,\"PagerAlwaysVisible\":false,\"changePageSizeComboBoxTopClientID\":\"ctl00_ContentPlaceHolder1_GridQtyDeduction_ctl00_ctl02_ctl01_PageSizeComboBox\",\"changePageSizeComboBoxClientID\":\"ctl00_ContentPlaceHolder1_GridQtyDeduction_ctl00_ctl03_ctl02_PageSizeComboBox\",\"IsItemInserted\":false,\"clientDataKeyNames\":[\"TranDet_ID\"],\"_dataBindTemplates\":false,\"_selectedItemStyle\":\"\",\"_selectedItemStyleClass\":\"rgSelectedRow\",\"_columnsData\":[{\"UniqueName\":\"rprodcode\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"rprodcode\",\"ReadOnly\":true,\"Display\":true},{\"UniqueName\":\"rname\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"rname\",\"ReadOnly\":true,\"Display\":true},{\"UniqueName\":\"pack_qty_req_for_packing\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.Decimal\",\"DataField\":\"pack_qty_req_for_packing\",\"ReadOnly\":true,\"Display\":true},{\"UniqueName\":\"pack_qty_req_for_packing_unit\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"pack_qty_req_for_packing_unit\",\"ReadOnly\":true,\"Display\":true},{\"UniqueName\":\"label_qty\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"label_qty\",\"Display\":true},{\"UniqueName\":\"label_claim_unit\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"label_claim_unit\",\"Display\":true},{\"UniqueName\":\"qty_reqd_per_dosage_unit\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"qty_req_per_dosage_unit\",\"Display\":true},{\"UniqueName\":\"Qty_reqd_per_dosage_unit_UNIT\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"Qty_reqd_per_dosage_unit_UNIT\",\"Display\":true},{\"UniqueName\":\"RM_assay\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"RM_assay\",\"Display\":true},{\"UniqueName\":\"perc_overage\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.Decimal\",\"DataField\":\"perc_overage\",\"Display\":true},{\"UniqueName\":\"adj_qty_per_dos_unit\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.Decimal\",\"DataField\":\"adj_qty_per_dos_unit\",\"Display\":true},{\"UniqueName\":\"perc_in_form\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.Decimal\",\"DataField\":\"perc_in_form\",\"Display\":true},{\"UniqueName\":\"pot_as_is\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.Decimal\",\"DataField\":\"pot_as_is\",\"Display\":true},{\"UniqueName\":\"qty_req_for_std_kg\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.Decimal\",\"DataField\":\"qty_req_for_std_kg\",\"Display\":true},{\"UniqueName\":\"qty_req_for_order_kg\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.Decimal\",\"DataField\":\"qty_req_for_order_kg\",\"Display\":true},{\"UniqueName\":\"receiving_no\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.String\",\"DataField\":\"receiving_no\",\"Display\":true},{\"UniqueName\":\"pack_qty_tot_qty_used\",\"Resizable\":true,\"Reorderable\":true,\"Selectable\":true,\"Groupable\":true,\"ColumnType\":\"GridTemplateColumn\",\"DataTypeName\":\"System.Decimal\",\"DataField\":\"pack_qty_tot_qty_used\",\"Display\":true}]}]","_loadingText":"Loading...","_masterClientID":"ctl00_ContentPlaceHolder1_GridQtyDeduction_ctl00","_readyText":"Ready","_shouldFocusOnPage":false,"_statusLabelID":"ctl00_ContentPlaceHolder1_GridQtyDeduction_ctl00_ctl03_ctl02_statusPanel","allowMultiRowSelection":false,"clientStateFieldID":"ctl00_ContentPlaceHolder1_GridQtyDeduction_ClientState"}, {"command":RadGrid1_Command,"rowClick":RowClick,"rowCreated":RowCreated,"rowDestroying":RowDestroying}, null, $get("ctl00_ContentPlaceHolder1_GridQtyDeduction"));
});

Can anyone explain what that means? I am not sure how to go about fixing it. Thanks.
Ekjot
Top achievements
Rank 1
 answered on 20 Apr 2012
4 answers
207 views
Hi,

I created a custom control that inherits from the RadCombobox. I do 2 things within the control: I added a new property and I override the Databind() method.

I use the control in the EditItemTemplate of the RadGrid, and it is defined as such:

<cc:RatingValuesDropDownField ID="ddlRatingValue" runat="server" RatingType="Type1"  MaxHeight="200px" />

I don't change anything related to the look of the control in my code, yet it ends up looking like what's displayed in the attached picture in IE7.

I use RadFormDecorators inside my code, so I am not sure if that's the issue or not.

Any ideas?

Thanks.

edit: forgot to add that the drop down displays fine when outside of a radgrid.
radfreak
Top achievements
Rank 1
 answered on 20 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?