Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
104 views
I use EditForm template in the RadGrid.
In the 

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)  
{   
 
}  
 
I can use the following codes to refer a control in Insert Form: 
 
GridEditableItem insertItem = e.Item.OwnerTableView.GetInsertItem();   
 
ListBox ListBoxA = (ListBox)insertItem.FindControl("ListBox1");  
 
 

How can I do the same thing for the Edit Form?

"GridEditableItem insertItem = e.Item.OwnerTableView.GetInsertItem(); " doesn't work for the  Edit Form.  I got the error message "Insert item is available only when grid is in insert mode."

Please help.
Iana Tsolova
Telerik team
 answered on 17 Oct 2008
3 answers
152 views

I use RadUpload in the EditForm template in the RadGrid.
My question is: How to disable AJAX when the user clicks "Insert" or "Update" button?

The Javascript codes I used doesn't work:

 
var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$","ig");  
 
if (sender.EventTarget.match(theRegexp))  
{  
  sender.EnableAjax = false;  
} 

Please look at the codes for RadUpload and buttons in EditForm at below

<EditFormSettings EditFormType="Template">  
<FormTemplate> 
<table> 
  <tr> 
    <td>File:</td> 
    <td> 
      <telerik:RadUpload ID="RadUpload1" Skin="Vista" runat="server" InitialFileInputsCount="1" MaxFileInputsCount="1" ControlObjectsVisibility="None" MaxFileSize="1000000" AllowedFileExtensions=".pdf" TargetPhysicalFolder="<%$ appSettings:UploadPath %>" /> 
    </td> 
  </tr> 
  <tr> 
    <td> 
      <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button> 
      <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button> 
    </td> 
    <td></td>  
  </tr> 
</table> 
</FormTemplate> 
</EditFormSettings> 
 
 

Thanks,Jason

Jason M
Top achievements
Rank 2
 answered on 17 Oct 2008
3 answers
126 views
Hi,

I am using a RadTreeView control in RadCombobox. All the combobox are being generated at runtime and nodes are also added at runtime. I have checkboxes enabled in my treeview and depth of treeview is of 1 level. I am changing the RadCombobox text at OnClientNodeChecked event.
My problem is when there is no check box is selected and if I click on some node, combobox text is automatical updated with the concatenated string containing the text of all nodes. When I check or uncheck a check box, proper event is firing and my custom code is being called. But in case of node click or some times even on treeview click combobox text is being updated.

How can I resolve this.

Thanks,
Pankaj
Yana
Telerik team
 answered on 17 Oct 2008
4 answers
215 views
I have a menu with a sub menu, that has an item with another sub menu.

The last sub menu won't show.  Any help would be appreciated.  Here is the aspx and css code:
<telerik:RadMenuItem NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" CssClass="menuSpeedOrdering"> 
                        <Items> 
                            <telerik:RadMenuItem Text="TEST" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" GroupSettings-ExpandDirection="Up" GroupSettings-OffsetX="100" GroupSettings-Width="200"> 
                                <Items> 
                                    <telerik:RadMenuItem Text="TEST2" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem>     
                                    <telerik:RadMenuItem Text="TEST2" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem>     
                                    <telerik:RadMenuItem Text="TEST2" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem>     
                                    <telerik:RadMenuItem Text="TEST2" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem>     
                                    <telerik:RadMenuItem Text="TEST2" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem>     
                                    <telerik:RadMenuItem Text="TEST2" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem>     
                                    <telerik:RadMenuItem Text="TEST2" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem>     
                                    <telerik:RadMenuItem Text="TEST2" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem> 
                                </Items> 
                            </telerik:RadMenuItem>     
                            <telerik:RadMenuItem Text="TEST" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem>     
                            <telerik:RadMenuItem Text="TEST" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem>     
                            <telerik:RadMenuItem Text="TEST" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem>     
                            <telerik:RadMenuItem Text="TEST" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem>     
                            <telerik:RadMenuItem Text="TEST" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem>     
                            <telerik:RadMenuItem Text="TEST" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem>     
                            <telerik:RadMenuItem Text="TEST" NavigateUrl="~/orders/speedorder.aspx" ToolTip="Employee" ></telerik:RadMenuItem> 
                        </Items> 
                    </telerik:RadMenuItem>  

/* RadMenu Telerik Skin */ 
/* Text color size and style of whole menu*/ 
 
 
/*Entire menu*/ 
div.RadMenu_Shade ul.rmHorizontal 
{ 
    border: 0px solid #262626; 
    float: left; 
    padding: 0; 
    width: 795px; 
    height: 40px; 
    margin-left: auto; 
    margin-right: auto; 
    /*background: transparent url('../images/menu/light.gif');*/ 
} 
/* Normal Item */ 
.rmHorizontal .rmItem 
{ 
    width: 112px; 
    height: 37px; 
    /*background: transparent url('../images/menu/light.gif');*/ 
} 
 
.rmHorizontal .rmItem .menuSpeedOrdering 
{ 
    width: 112px; 
    height: 37px; 
    background: transparent url('../images/menu/btn_menu1.gif') no-repeat 0 0; 
} 
.rmHorizontal .menuSpeedOrdering:hover, .rmHorizontal .menuSpeedOrdering:active 
{ 
    width: 112px; 
    height: 37px; 
    background: transparent url('../images/menu/btn_menu1a.gif') no-repeat 0 0; 
} 
 
.rmHorizontal .rmItem .menuCatalogBrowse 
{ 
    width: 112px; 
    height: 37px; 
    background: transparent url('../images/menu/btn_menu2.gif') no-repeat 0 0; 
} 
.rmHorizontal .menuCatalogBrowse:hover, .rmHorizontal .menuCatalogBrowse:active 
{ 
    width: 112px; 
    height: 37px; 
    background: transparent url('../images/menu/btn_menu2a.gif') no-repeat 0 0; 
} 
 
.rmHorizontal .rmItem .menuProductFinder 
{ 
    width: 112px; 
    height: 37px; 
    background: transparent url('../images/menu/btn_menu3.gif') no-repeat 0 0; 
} 
.rmHorizontal .menuProductFinder:hover, .rmHorizontal .menuProductFinder:active 
{ 
    width: 112px; 
    height: 37px; 
    background: transparent url('../images/menu/btn_menu3a.gif') no-repeat 0 0; 
} 
.rmHorizontal .rmItem .menuTrackOrders 
{ 
    width: 112px; 
    height: 37px; 
    background: transparent url('../images/menu/btn_menu4.gif') no-repeat 0 0; 
} 
.rmHorizontal .menuTrackOrders:hover, .rmHorizontal .menuTrackOrders:active 
{ 
    width: 112px; 
    height: 37px; 
    background: transparent url('../images/menu/btn_menu4a.gif') no-repeat 0 0; 
} 
 
.rmHorizontal .rmItem .menuAdminUsers 
{ 
    width: 112px; 
    height: 37px; 
    background: transparent url('../images/menu/btn_menu5.gif') no-repeat 0 0; 
} 
.rmHorizontal .menuAdminUsers:hover, .rmHorizontal .menuAdminUsers:active 
{ 
    width: 112px; 
    height: 37px; 
    background: transparent url('../images/menu/btn_menu5a.gif') no-repeat 0 0; 
} 
 
.rmHorizontal .rmItem .menuCompanyInfo 
{ 
    width: 112px; 
    height: 37px; 
    background: transparent url('../images/menu/btn_menu6.gif') no-repeat 0 0; 
} 
.rmHorizontal .menuCompanyInfo:hover, .rmHorizontal .menuCompanyInfo:active 
{ 
    width: 112px; 
    height: 37px; 
    background: transparent url('../images/menu/btn_menu6a.gif') no-repeat 0 0; 
} 
 
.rmHorizontal .rmItem .menuCustService 
{ 
    width: 112px; 
    height: 37px; 
    background: transparent url('../images/menu/btn_menu7.gif') no-repeat 0 0; 
} 
.rmHorizontal .menuCustService:hover, .rmHorizontal .rmItem .menuCustService  .menuCustService:active 
{ 
    width: 112px; 
    height: 37px; 
    background: transparent url('../images/menu/btn_menu7a.gif') no-repeat 0 0; 
} 
 
.rmHorizontal .rmLink:hover, 
.rmHorizontal .rmFocused, 
.rmHorizontal .rmExpanded 
{ 
    width: 112px; 
    height: 37px; 
} 
 
.rmHorizontal .rmText 
{ 
    padding: 8px 24px 8px 14px; 
} 
 
ul.rmVertical 
{ 
    border: 1px solid #808080; 
    float: left; 
    background: url('../images/menu/dropdowndot.gif') repeat; 
} 
 
.rmVertical .rmItem 
{ 
       height: 20px; 
       overflow:hidden; 
       padding-bottom: 4px; 
} 
.rmVertical .rmLink 
{ 
   height: 20px; 
       overflow:hidden; 
       padding-bottom: 4px; 
} 
 
.rmVertical .rmText 
{ 
    height: 20px; 
       overflow:hidden; 
    padding-bottom: 4px; 
} 
 
.rmVertical .rmExpandRight 
{ 
} 
 
.rmVertical .rmLink:hover, 
.rmVertical .rmFocused, 
.rmVertical .rmExpanded 
{ 
    color: white; 
    background: url('../images/menu/dropdowndotdark.gif') repeat; 
    height: 20px; 
       overflow:hidden; 
} 
 
.rmVertical .rmLink:hover .rmText, 
.rmVertical .rmFocused .rmText, 
.rmVertical .rmExpanded .rmText 
{ 
   height: 20px; 
       overflow:hidden; 
} 
 
.rmVertical .rmLink:hover .rmExpandRight, 
.rmVertical .rmFocused .rmExpandRight, 
.rmVertical .rmExpanded .rmExpandRight 
{ 
   height: 20px; 
       overflow:hidden; 
} 
 
.rmVertical .rmGroup 
{ 
   height: 20px; 
       overflow:hidden; 
} 
 
.rmVertical .rmGroup .rmLink 
{ 
   height: 20px; 
       overflow:hidden; 
} 
 
.rmVertical .rmGroup .rmText 
{ 
   height: 20px; 
       overflow:hidden; 
} 
 
.rmVertical .rmGroup .rmLink:hover, 
.rmVertical .rmGroup .rmFocused, 
.rmVertical .rmGroup .rmExpanded 
{ 
   height: 20px; 
       overflow:hidden; 
} 
 
 .rmVertical .rmGroup .rmLink:hover .rmText, 
 .rmVertical .rmGroup .rmFocused .rmText, 
 .rmVertical .rmGroup .rmExpanded .rmText 
{ 
   height: 20px; 
       overflow:hidden; 
} 
 
 .rmVertical .rmGroup .rmLink:hover .rmExpandRight, 
 .rmVertical .rmGroup .rmFocused .rmExpandRight, 
 .rmVertical .rmGroup .rmExpanded .rmExpandRight 
{ 
   height: 20px; 
       overflow:hidden; 
} 
 
 .rmSeparator 
{ 
} 
 
 .rmSeparator .rmText 
{ 
} 
 
 .rmTopArrowDisabled, 
 .rmBottomArrowDisabled, 
 .rmLeftArrowDisabled, 
 .rmRightArrowDisabled 
{ 
    display: none; 
} 
 
 .rmTopArrow, 
 .rmBottomArrow, 
 .rmLeftArrow, 
 .rmRightArrow 
{ 
    font-size: 0; 
    color: #fff; 
    line-height: 0; 
} 
 
 .rmTopArrow, 
 .rmBottomArrow 
{ 
    height: 10px; 
    width: 100%; 
} 
 
 .rmBottomArrow 
{ 
    background-position: center -18px; 
} 
 
 .rmLeftArrow, 
 .rmRightArrow 
{ 
    width: 10px; 
    height: 100%; 
} 
 
 .rmRightArrow 
{ 
    background-position: -18px center; 
} 

Clarence
Top achievements
Rank 1
 answered on 17 Oct 2008
1 answer
38 views
Dear forum,
I need suggestion for how to display progress indicator in grid column,
either with TemplateColumn or user control.
I have requirement for it with colored background, which is red, orange, or green. for 0-30%, 31-60%, 61-100%. Maybe someone has sample code.
Thanks all
Iana Tsolova
Telerik team
 answered on 17 Oct 2008
10 answers
429 views
Hi All,

I'm trying to display a grid and use the frozencolumns property to freeze the first column ('Shop'). However this isn't working in IE7. Here's my code for the grid:

<telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" Skin="Vista" runat="server" 
            AllowPaging="True" AllowSorting="True" GridLines="None" PageSize="50"> 
            <MasterTableView TableLayout="Auto" AutoGenerateColumns="false" Width="500px"> 
            <Columns> 
                <telerik:GridHyperLinkColumn DataNavigateUrlFields="CampaignName,BranchName", DataNavigateUrlFormatString="BranchReport.aspx?CampaignName={0}&amp;BranchName={1}" DataTextField="BranchName" HeaderText="Shop" SortExpression="BranchName"></telerik:GridHyperLinkColumn> 
                <telerik:GridBoundColumn DataField="GrossToday" HeaderText="Gross Today" SortExpression="GrossToday"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="GrossTW" HeaderText="Gross This Week" SortExpression="GrossTW"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="GrossTP" HeaderText="Gross This Period" SortExpression="GrossTP"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="GrossTY" HeaderText="Gross This Year" SortExpression="GrossTY"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="PaxToday" HeaderText="Pax Today" SortExpression="PaxToday"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="PaxTW" HeaderText="Pax This Week" SortExpression="PaxTW"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="PaxTP" HeaderText="Pax This Period" SortExpression="PaxTP"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="PaxTY" HeaderText="Pax This Year" SortExpression="PaxTY"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="TargetTW" HeaderText="Target This Week" SortExpression="TargetTW"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="TargetTP" HeaderText="Target This Period" SortExpression="TargetTP"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="TargetTY" HeaderText="Target This Year" SortExpression="TargetTY"></telerik:GridBoundColumn> 
            </Columns> 
            </MasterTableView> 
            <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true"> 
                <Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True" 
                    AllowColumnResize="True"></Resizing> 
                <Selecting AllowRowSelect="True"></Selecting> 
                <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="1"> 
                </Scrolling> 
            </ClientSettings> 
            <HeaderStyle Width="120px" /> 
            <PagerStyle Mode="NextPrevAndNumeric" /> 
        </telerik:RadGrid> 

Also, the Hyperlink column doesn't generate a Hyperlink, just the text in bold. Am I doing anything basic wrong?

Thanks.

Pavel
Telerik team
 answered on 17 Oct 2008
1 answer
146 views

Well if I put raddock control into some div which can be resized and raddock mode is docked I can't change its width via java script.

Can you write a sample of resizing the raddock via undocking and docking (java script).

Sample: User Comtrol inside the raddock. User Control has a button. when I make click on the button I want the raddock to be resize to 300X300 let's say.

Thanks. It is very important and I think not only for me.


P.S of course the raddock is docked and I don't want the user tp see it undocked. It should be done in java script all the logic of undocking and docking back.
Obi-Wan Kenobi
Top achievements
Rank 1
 answered on 17 Oct 2008
3 answers
253 views
Hi,

I have a form that has a number of RadComboBox'es, and selectively add a javascript client event to some comboboxes.

To put it simple..:
C#:
{
    var cb = RadComboBox1;
    if (some_condition == true) 
        cb.OnClientSelectedIndexChanged = "OnClientSelectedIndexChanged"; 
} 

ASPX:
<telerik:RadComboBox ID="RadComboBox1" runat="server" Width="200px" 
    MarkFirstMatch="true" HighlightTemplatedItems="true" 
    DataTextField="Text" DataValueField="ID" ItemRequestTimeout="500" 
    Skin="Vista"> 
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</telerik:RadComboBox> 


javascript:
function OnClientSelectedIndexChanged(item) 
{ 
    var combo = item.ComboBox; 
    alert(combo.GetText() + ' ' + combo.GetValue() + ' - ' + combo.ClientID); 
} 
 


However when I do some selection change to the combobox in the browser, the item.ComboBox returns 'undefined'.

What else do I need to do?


Veselin Vasilev
Telerik team
 answered on 17 Oct 2008
3 answers
278 views
Is there any client-side event that will fire after the detail table is expanded or collapsed? 

I'm trying to solve this problem: I have a CommandItemTemplate with a LinkButton which should only be enabled when the number of selected rows > 0.  The JS works fine, when linked to ClientEvents-OnRow{Selected|Deselected}.  The problem comes when the row expands, and the ItemCommand is fired in conjunction with the BindDetailTable.  After this event, the LinkButton is never again seen.

I have tried ItemCommand code-behind to set the Style["visibility"] = "none" (or "inline", if SelectedItems.Count>0), and I have tried a plethora of the ClientEvents-On* but nothing seems to work.

Here is the JS function which works as long as the detail table is not expanded:

function ConditionallyEnableClearButton(sender, eventArgs) { 
    var masterTableView = sender.get_masterTableView(); 
    var selectedItems = masterTableView.get_selectedItems(); 
    var visibility = selectedItems.length > 0 ? "inline" : "none"; 
 
    var button = document.getElementById('<%= AlertGrid.MasterTableView.GetItems(GridItemType.CommandItem)[0].FindControl("ClearButton").ClientID %>'); 
    if (button) { 
        button.style.display = visibility; 
    } 
} 
 

And here is the ItemCommand code-behind:

LinkButton clearButton = 
                grid.MasterTableView.GetItems(GridItemType.CommandItem)[0].FindControl(CLEAR_BUTTON) as LinkButton; 
var oldValue = clearAlertsButton.Style["display"]; 
clearAlertsButton.Style["display"] = grid.SelectedItems.Count > 0 ? "inline" : "none"; 
 

I think a pure JS solution would work, if I could hook up the JS function to the end of the expand or collapse event, client-side.

Thanks,
Tim

Tim
Top achievements
Rank 1
 answered on 17 Oct 2008
1 answer
108 views

I have a custom dialog to upload any type of video and convert it to a .fla and insert it into the RadEditor. I have all the code completed and everything works fine to a point.

I think this is an easy one.

After the video is converted and saved I set a hiddenfield with the path and video name. When i try to set - closeArgument.videopath to the hiddenfield it is nothing.

I checked and the hiddenfield is being set. Why cant I get the value of the hiddenfield that was set serverside?

 

closeArgument.videopath = document.getElementById(

"savefolder").value;

Thanks for your help

 

 

 

 

 

Rumen
Telerik team
 answered on 17 Oct 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?