Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
89 views
Hello,

I am developing a table that displays a RadComboBox with a few options. The user is allowed to select multiple items within the RadComboBox, so check boxes are enabled. However, I am having difficulties pulling which items have been checked for each row. I cannot find the dynamically built controls to get the checked items. Also, these RadComboBoxes are not in edit mode. They are simply displaying as normal comboboxes within a grid. How would I access the checked items for each dynamically built combo box? And how could I organize this data by row?

Thanks in advance,

Derek O.
Princy
Top achievements
Rank 2
 answered on 14 Nov 2013
3 answers
274 views
Hi all again,

So it the already a way easy to put the export command buttons on the left??
Or is ther a way to do the same with the template ??


Best regards.
Shinu
Top achievements
Rank 2
 answered on 14 Nov 2013
1 answer
166 views
There is a radbutton in my page and I am writing some C# code in the button click event. In the C# code and I am parsing a date in a try block and if an exception is generated I want to display it and for that I used a radalert. But I found that the alert is displayed after all the c# lines of codes are executed. On debugging that line is executed without any error. Why the delay in displaying the alert, Is this a bug?
Shinu
Top achievements
Rank 2
 answered on 14 Nov 2013
3 answers
183 views
How can I access the value of GridCheckBox column during ItemDataBound Event?

I need access the value and if condition is true hide delete link button.  I have tried many different ways with no luck so far.

Here is my code
Protected Sub PeoplegridCheckrow(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs)
        If TypeOf e.Item Is GridDataItem Then
            Dim dataItem As GridDataItem = CType(e.Item, GridDataItem)
            Dim relationship As String = dataItem("Relationship").Text
            Dim bJournalName As Boolean = (Boolean.Parse(dataItem("UseAsJournalName").Text))
            If relationship = "Family Member" And bJournalName = True Then
                CType(dataItem("DeleteButton").Controls(0), LinkButton).Visible = False
            End If
        End If
    End Sub

Thank you for the help.
Bryan Hughes
Top achievements
Rank 1
 answered on 13 Nov 2013
4 answers
73 views
I am using Radgrid to display the number of attachements under each category. currently the boundcolumn has the datafield = "Name" (Name of the category) alone. If each category row from the master table view is clicked then it will be expanded to show the list of attachments under it, but now i have the requirement to show the count of the attachments also along with the Name of the Category in the Bouncolumn of the MasterTableview. 
BoundColCategory.DataField = "NAME"  + (deatailtable Items Count)
I want the output in the below format
Output Example: Attachment1(s) (20)
                         Attachment2(s) (10)
                         Attachment3(s) 
                        Attachment4(s) (5)
                        Attachment4(s) (11)
                        .........
                        .............
                        .............

I tried to set the datafield/text of the Boundcolumn in events like Item cretead or Pre- render and also in page load but not able to succeed Please help me how to achieve this programmmatically.
Below is the Grid in m
<am:aMGridID="amGrdNotesMaster"runat="server"TabIndex="212"AutoGenerateColumns="false"AllowSorting="false"AllowPaging="false"ClientSettings-AllowColumnsReorder="false"ClientSettings-AllowDragToGroup="false"ShowGroupPanel="false">
      <MasterTableViewDataKeyNames="ID"HierarchyDefaultExpanded="false"NoMasterRecordsText=""NoDetailRecordsText=""GroupLoadMode="Client">
                     <Columns>
                        <telerik:GridBoundColumnHeaderText="Category"DataField= "Name"UniqueName="Category"/>
                         <telerik:GridTemplateColumnUniqueName="Reorder">
                         <ItemTemplate><tm:TMButtonID="btnReorder"runat="server"CommandName="reorder"Text="Reorder based on sort"/></ItemTemplate>
                         </telerik:GridTemplateColumn>
                       </Columns>
                 <DetailTables>
                    <telerik:GridTableViewName="Detail"AllowSorting="true"AllowPaging="false"DataKeyNames="ID"NoMasterRecordsText=""NoDetailRecordsText=""EditMode="InPlace">
                      <Columns>
                         <telerik:GridBoundColumn Uniquename="ID" DataField ="ID" Aggregate ="Count" Visible ="true" ></telerik:GridBoundColumn>
                         <telerik:GridHyperLinkColumnUniqueName="Subject"HeaderText="Subject"DataNavigateUrlFormatString="~/notedisplay.aspx?id={0}"DataNavigateUrlFields="ID"DataTextField="Subject"SortExpression="Subject"ItemStyle-CssClass="gridhyperlink"HeaderStyle-Width="500px"/>
                         <telerik:GridHyperLinkColumnUniqueName="Attachment"HeaderText="Attachment"DataNavigateUrlFormatString="javascript:void(window.open('imageviewer.aspx?a=3&b=Attachment&c={0}', '_blank', 'left=0, top=0, width=785, height=585, titlebar=yes, location=no, status=no, toolbar=no, menubar=no, scrollbars=no, resizable=yes'));"DataNavigateUrlFields="ID"DataTextField="AttachmentName"SortExpression="AttachmentName"ItemStyle-CssClass="gridhyperlink"/>
                         <telerik:GridBoundColumnUniqueName="AddDate"HeaderText="Created"DataField="AddDate"SortExpression="AddDate"ReadOnly="true"/>
                         <telerik:GridBoundColumnUniqueName="ModDate"HeaderText="Last Modified"DataField="ModDate"SortExpression="ModDate"ReadOnly="true"/>
                         <telerik:GridBoundColumnUniqueName="ModUser"HeaderText="Modified By"DataField="ModUser"SortExpression="ModUser"ReadOnly="true"/>
                        <telerik:GridNumericColumn  HeaderText="Position"DataField="SortOrder"SortExpression="SortOrder"UniqueName="SortOrder"/>
                        <telerik:GridEditCommandColumnUniqueName="EditColumn">
                        <ItemStyleCssClass="gridhyperlink"/>
                         </telerik:GridEditCommandColumn>
                       </Columns>
                     </telerik:GridTableView>
                  </DetailTables>
        </MasterTableView>
    <ClientSettingsAllowExpandCollapse="true">
   </ClientSettings>
  </am:aMGrid>
thanks
jose
Joselina
Top achievements
Rank 1
 answered on 13 Nov 2013
21 answers
1.0K+ views

I have a RadEditor in a user control, which is being used on a page. What I need to do is verify if the content area on the editor is not blank on button click on client side (and display alert message) And then I need to set focus in the content area on the editor.

I'm able to do everything except set the focus.

When I try to set focus, I get a message saying "Cant move focus to the control because it is invisible, not enabled, or of a type that does not accept focus"

I figured out this is becase the style:display is set to "none". I updated that to "block" and the error message went away, but I still dont see the focus being set.

Please advice.

 

Thanks 

Ianko
Telerik team
 answered on 13 Nov 2013
1 answer
164 views
What I'm trying to accomplish is quite simple but I still didn't grasp all the ways of iterating the grid items in all the events.
I have a grid with a custom FormView inside <NestedViewTemplate> (well the FormView really is inside a user control in <NestedViewTemplate>).

What I would like to happen in the gui is this: when you click on the edit button (wich triggers a custom edit logic) I would like to check all OTHER rows to see if:
1) they are expanded (and in this case collapse them so that only the active edited row is expanded)
2) set the FormView.FormViewMode of each row OTHER than the edited one to ReadOnly so that if the user opens the row again in a later moment he finds it in view mode and no more in edit mode.
3) set the <asp:Panel runat="server" ID="RadGrid1DetailContainer" CssClass="RadGridDetailContainer" Visible="true">, wich is the first item in the <NestedViewTemplate> to visible = false for all the row OTHER than the edited one

The expand part is easy, and the custom logic wich expands the edited row and sets the FormView in edit mode is easy but I cannot find a way to address points 2 and 3.

Here is my logic so far that triggers in RadGrid1_ItemCommand when user clicks on the edit button and throws the EditFormView command. 

ASPX part:

<NestedViewTemplate>
    <asp:Panel runat="server" ID="RadGrid1DetailContainer" CssClass="RadGridDetailContainer" Visible="true">
        <telerik:RadTabStrip runat="server" ID="RadGrid1DetailTabStrip" MultiPageID="RadGrid1DetailMultipage1" SelectedIndex="0" CssClass="RadGridTabStrip">
            <Tabs>
                <telerik:RadTab runat="server" Text="Dati utente" PageViewID="RadGrid1DetailRadPageView1">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Anagrafica" PageViewID="RadGrid1DetailRadPageView2">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Altri dati" PageViewID="RadGrid1DetailRadPageView3">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage runat="server" ID="RadGrid1DetailMultipage1" SelectedIndex="0" RenderSelectedPageOnly="false">
            <telerik:RadPageView runat="server" ID="RadGrid1DetailRadPageView1" CssClass="RadGridPageView">
                <asp:FormView id="RadGrid1DetailForm1" CssClass="RadGridDetailForm" runat="server">
                    <ItemTemplate>
                        <div class="form-horizontal form-stripe" style="padding: 12px;">
                            <eva:FormUserDetail ID="FormUserDetail1" Item="<%# Container.DataItem %>" View="Detail1" runat="server" />
                            <div class="form-actions">
                               <asp:LinkButton ID="FormConfirmUpdate" runat="server" CssClass="btn btn-primary" CommandName="EditFormView">
                                    <i class="icon icon-pencil"></i> Edit
                                </asp:LinkButton>
                           </div>
                        </div>
                    </ItemTemplate>
 
                    <EditItemTemplate>
                        <div class="form-horizontal form-stripe" style="padding: 12px;">
                            <eva:FormUserEdit ID="FormUserDetail2" Item="<%# Container.DataItem %>" View="Detail1" runat="server" />
                            <div class="form-actions">
                              <asp:Button runat="server" ID="FormConfirmUpdate" CssClass="btn btn-success" Text="Submit" CommandName="FormConfirmUpdate" />
                               <asp:Button runat="server" ID="FormCancelUpdate" CssClass="btn" Text="Cancel" CommandName="FormCancelUpdate" />
                            </div>
                        </div>
                    </EditItemTemplate>
                </asp:FormView>
            </telerik:RadPageView>
 
            <telerik:RadPageView runat="server" ID="RadGrid1DetailRadPageView2">
 
            </telerik:RadPageView>
            <telerik:RadPageView runat="server" ID="RadGrid1DetailRadPageView3">
 
            </telerik:RadPageView>
        </telerik:RadMultiPage>
    </asp:Panel>
</NestedViewTemplate>

The code behind for the EditFormView command is:

Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) Handles RadGrid1.ItemCommand
    Dim gridFormView As FormView
    Dim primaryKey As Integer
  
    If TypeOf (e.Item) Is GridDataItem Then
        gridFormView = DirectCast(e.Item, GridDataItem).ChildItem.FindControl("RadGrid1DetailContainer").FindControl("RadGrid1DetailMultipage1").FindControl("RadGrid1DetailRadPageView1").FindControl("RadGrid1DetailForm1")
        primaryKey = Convert.ToInt32(DirectCast(e.Item, GridDataItem).GetDataKeyValue("UserId"))
    End If
  
    Select Case e.CommandName
        Case "EditFormView"
            e.Item.Expanded = True
  
            If TypeOf (e.Item) Is GridDataItem Then
                DirectCast(e.Item, GridDataItem).ChildItem.FindControl("RadGrid1DetailContainer").Visible = True
  
                ' Collapse all other opened details
                For Each item As GridItem In e.Item.OwnerTableView.Items
                    If item.Expanded AndAlso Not item Is e.Item Then
                        item.Expanded = False
                        DirectCast(item.DataItem, GridDataItem).ChildItem.FindControl("RadGrid1DetailContainer").Visible = False
  
                        Dim gridFormViewToBeClosed As FormView = DirectCast(item.DataItem, GridDataItem).ChildItem.FindControl("RadGrid1DetailContainer").FindControl("RadGrid1DetailMultipage1").FindControl("RadGrid1DetailRadPageView1").FindControl("RadGrid1DetailForm1")
  
                        ' Put form always in ReadOnly when is expanded
                        If gridFormViewToBeClosed.CurrentMode <> FormViewMode.ReadOnly Then
                            gridFormViewToBeClosed.ChangeMode(FormViewMode.ReadOnly)
                        End If
                    End If
                Next item
            End If
  
            ' Put form in EditMode when is expanded
            If gridFormView.CurrentMode <> FormViewMode.Edit Then
                gridFormView.ChangeMode(FormViewMode.Edit)
            End If
  
            ' Fill the form view from the db
            SelectUserEdit(primaryKey, gridFormView)
    End Select
End Sub

The item.Expanded = False part works like expected. The issue I'm facing is how to retrieve a reference to the FormView(s) and to the RadGrid1DetailContainer  for each other row

I tried with 
DirectCast(item.DataItem, GridDataItem).ChildItem.FindControl("RadGrid1DetailContainer").Visible = False
But I guess item.DataItem is not what I'm looking for since I always have a  System.NullReferenceException on that line... 

Any hint on how to iterate and access the FormView in all the rows other than the one where the click command triggered, would be greatly appreciated. 

Thanks in advance




Marin
Telerik team
 answered on 13 Nov 2013
1 answer
218 views
<script type="text/javascript">
    function OnClientFileOpen(oExplorer, args)
    {
        //get the extension of the opened item
        var fileExt = args.get_item().get_extension();
        if (fileExt && fileExt.toLowerCase() == "pdf")
        {
            //cancel the default behavior
            args.set_cancel(true);
            //open new RadWindow
            var oWnd = radopen(args.get_item().get_path(), "RadWindow1");
            //set size to the newly opened RadWindow
            oWnd.setSize(600, 400);
            //if you want to open the PDF file in a new browser window
            //you can use the following code
            //window.open(args.get_item().get_path());
        }
    }
</script>


I am getting "The resource cannot be found." error when i use UNC path and the above javascript. Is there any solution for this problem?

Thanks
Corey
Top achievements
Rank 1
 answered on 13 Nov 2013
1 answer
248 views
I have a radnumerictextbox in one column of a radgrid and a label in another column of the same radgrid.

I'm trying to calculate the value of the label when the radnumerictextbox changes. If I set up the event handler clientside it fires the event, but I don't know how to figure out what row in the radgrid to update the value in. If I try to set up the handler in the itemcreated event of the radgrid, it fires the function right away.( I assume this is because of the parenthesis). Here is the code snippets. Any ideas?

 

 

<telerik:RadGrid runat="server" ID="RewardProductsGrid" EnableViewState="True" ShowStatusBar="False" ShowFooter="False"
 
 DataSourceID="RewardProductsSource" ShowHeader="False"
 
 OnItemDataBound="RewardProductsGrid_OnItemDataBound"
 
 OnItemCreated="RewardProductsGrid_OnItemCreated">
 
 <ClientSettings EnableAlternatingItems="False" ></ClientSettings>
 
 <mastertableview autogeneratecolumns="False" datakeynames="ProductId"
 
 editmode="EditForms" nomasterrecordstext="No orders found." allowsorting="False"
 
 allowmulticolumnsorting="False">
 
 <Columns>
 
 <telerik:GridTemplateColumn AllowFiltering="False">
 
 <ItemTemplate>
 
 <asp:Image runat="server" ImageUrl='<%# ((Product)Container.DataItem).CartImageUrl %>'/>
 
 </ItemTemplate>
 
 </telerik:GridTemplateColumn>
 
 <telerik:GridTemplateColumn AllowFiltering="False">
 
 <ItemTemplate>
 
 <asp:Label runat="server" ID="ProductNameLabel" Text='<%# ((Product)Container.DataItem).NameLocalized %>'></asp:Label><br/>
 
 <asp:Label runat="server" ID="ItemNumberLabel"></asp:Label>:#<asp:Label runat="server" ID="ItemNumber" Text='<%# ((Product)Container.DataItem).ProductNumber %>'></asp:Label>
 
 </ItemTemplate>
 
 </telerik:GridTemplateColumn>
 
 <telerik:GridTemplateColumn AllowFiltering="False">
 
 <ItemTemplate>
 
 <asp:Label runat="server" ID="PointsLabel"></asp:Label>:<br/>
 
 <asp:Label runat="server" ID="Points" Text='<%# String.Format("{0:#}",((Product)Container.DataItem).CurrentRewardPointPrice) %>'></asp:Label>
 
 </ItemTemplate>
 
 </telerik:GridTemplateColumn>
 
 <telerik:GridTemplateColumn AllowFiltering="False">
 
 <ItemTemplate>
 
 <asp:Label runat="server" ID="QuantityLabel"></asp:Label>:<br/>
 
 <telerik:RadNumericTextBox runat="server" ID="QuantityTextBox" Value="1" MaxValue="10" MinValue="1">
 
 <NumberFormat DecimalDigits="0"></NumberFormat>
 
 <%-- <ClientEvents OnValueChanged="QuantityTextBoxValueChanged"></ClientEvents>--%>
 
 </telerik:RadNumericTextBox>
 
 </ItemTemplate>
 
 </telerik:GridTemplateColumn>
 
 <telerik:GridTemplateColumn AllowFiltering="False">
 
 <ItemTemplate>
 
 <asp:Label runat="server" ID="ItemTotalLabel"></asp:Label>:<br/>
 
 <asp:Label runat="server" ID="ItemTotal"></asp:Label>
 
 </ItemTemplate>
 
 </telerik:GridTemplateColumn>
 
 </Columns>
 
 </mastertableview>
 
 </telerik:RadGrid>
 
 
protected void RewardProductsGrid_OnItemCreated(object sender, GridItemEventArgs e)
 
{
 
 if (e.Item is GridDataItem)
 
{
 
 GridDataItem item = (GridDataItem)e.Item;
 RadNumericTextBox radNumericTextBox = (RadNumericTextBox)item.FindControl("QuantityTextBox");
 // chkBox.Attributes.Add("onclick", "clicked_chkBox('" + item.ItemIndex + "')");
 radNumericTextBox.ClientEvents.OnValueChanged = "change_quantity('" + item.ItemIndex + "')";
}
 
}
<telerik:RadScriptBlock ID="RadGridScriptBlock" runat="server">
<script type="text/javascript">
 
function CloseActiveToolTip() {
setTimeout(function () {
var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();
if (tooltip) tooltip.hide();
}, 1000);
}
 
function refreshGrid() {
var masterTable = $find("<%= RewardProductsGrid.ClientID %>").get_masterTableView();
masterTable.rebind();
}
 
 function QuantityTextBoxValueChanged(sender, args) {
 alert("Test");
 alert(sender.get_value());
}
 function change_quantity(index) {
 alert(index);
}
</script>
</telerik:RadScriptBlock>

 

 

Dash
Top achievements
Rank 1
 answered on 13 Nov 2013
2 answers
87 views
This has been going on for a long time, just taking time to post now because I'm getting a little tired of it...

I get notifications regularly that I have updates to my Telerik products, only to find, when I launch the Control Panel, that I do not.  How do I resolve this?  Please see the attached screenshots.  You'll see I get a bubble saying I have 4 updates available.  Then I click it and get the popup with the updates listed.  If I launch the CP I see that I do not have 4 updates (in this case I did have one, but often I have NONE). 

PLEASE fix these issues with the Control Panel!
Software
Top achievements
Rank 1
 answered on 13 Nov 2013
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?