Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
97 views

When I have a button in RadGrid commanditem as follows:

    <CommandItemTemplate>
        <div><asp:Button ID="btn_stats" runat="server" Text="Omzet statistieken"></asp:Button></div>
    </CommandItemTemplate>

 

And I want to use that button as RadWindow opener like:

    Protected Sub dtgProducts_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs)
        If TypeOf e.Item Is GridCommandItem Then

            Dim commandItem As GridCommandItem = CType(e.Item, GridCommandItem)
            Dim button As Button = CType(commandItem.FindControl("btn_stats"), Button)

            ViewState("statsopener") = button.ClientID
            rw_Stats.OpenerElementID = button.ClientID
        End If

    End Sub

I try to assure the OpenerElementID on paging the RadGrid like:

    Protected Sub dtgProducts_PageIndexChanged(sender As Object, e As GridPageChangedEventArgs)

        dtgProducts.MasterTableView.Columns(1).HeaderText = ViewState("statsopener")
        'dtgProducts.AllowPaging = False
        rw_Stats.OpenerElementID = ViewState("statsopener")

    End Sub

 

But the button does not open the RadWindow after paging the grid.

Please assist.

 

Marc

 

Fit2Page
Top achievements
Rank 2
Bronze
Iron
Iron
 answered on 23 Mar 2017
0 answers
87 views

RadMenu design breaking. I have attached the screen shot.You can see in the attached screen shot, the menu has some display issues. Please help me to solve this issue.

I have used Office2010Black skin.

Thanks & Regards

Borg Joseph J

Borg
Top achievements
Rank 1
 asked on 23 Mar 2017
5 answers
213 views
Can i use the RadDataPager with the Grid.

Thanks
John
Eyup
Telerik team
 answered on 23 Mar 2017
1 answer
188 views

I'm having difficulty understanding why some controls are changing style after a postback.  Namely I have a couple RadNumeric controls with spinners.  At first load they look and behave as expected.  After postback, the style changes somewhat dramatically.  Whether or not I use Bootstrap styling the issue persists.  I can someone get around it by rolling my own style with !important tags on everything, but seems like a kludge.  Any idea of what's going on?  Below is code from page that is in question.

 

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadAjaxManager runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ddlProduct">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlProduct" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting>
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnl" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" />
    <telerik:RadFormDecorator RenderMode="Lightweight" ID="RadFormDecorator1" runat="server" DecorationZoneID="grid" DecoratedControls="All" EnableRoundedCorners="false" />
 
    <h3>Build Plan</h3>
    <br />
 
        <asp:Panel ID="pnl" runat="server">   
        <div class="row">
            <div class="col-md-1">
                <telerik:RadLabel Text="Product" runat="server" CssClass="pull-right" />
            </div>
            <div class="col-md-2">
                <telerik:RadDropDownList ID="ddlProduct" runat="server" CssClass="pull-left" Width="150" Height="30">
                    <Items>
                        <telerik:DropDownListItem Text="Whitney" Value="3" />
                        <telerik:DropDownListItem Text="Lhotse" Value="4" />
                    </Items>
                </telerik:RadDropDownList>
            </div>
            <div class="col-md-2">
                <telerik:RadNumericTextBox RenderMode="Lightweight" ShowSpinButtons="true" IncrementSettings-InterceptArrowKeys="true" IncrementSettings-InterceptMouseWheel="true"
                    runat="server" ID="txtYear" Width="120" Height="30" MinValue="2016" MaxValue="2050" NumberFormat-DecimalDigits="0" NumberFormat-GroupSeparator="" CssClass="" Label="Year">
                </telerik:RadNumericTextBox>
            </div>
            <div class="col-md-2">
                <telerik:RadNumericTextBox RenderMode="Lightweight" ShowSpinButtons="true" IncrementSettings-InterceptArrowKeys="true" IncrementSettings-InterceptMouseWheel="true"
                    runat="server" ID="txtWeek" Width="120" Height="30" MinValue="1" MaxValue="53" NumberFormat-DecimalDigits="0" Label="Week">
                </telerik:RadNumericTextBox>
            </div>
            <div class="col-md-2">
                <telerik:RadButton runat="server" ID="btnGo" class="btn btn-default" Height="30" Text="Go" OnClick="btnGo_Click" />
            </div>
 
        </div>
        <br />
 
        <div id="grid">
            <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" GridLines="None" runat="server" Width="55%"
                AllowAutomaticInserts="True" PageSize="10" OnItemUpdated="RadGrid1_ItemUpdated" OnPreRender="RadGrid1_PreRender" AllowAutomaticUpdates="True" AllowPaging="True"
                AutoGenerateColumns="False" OnBatchEditCommand="RadGrid1_BatchEditCommand" OnCancelCommand="RadGrid1_CancelCommand">
                <MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="BuildPlanId"
                    HorizontalAlign="NotSet" EditMode="Batch" AutoGenerateColumns="False">
                    <BatchEditingSettings EditType="Cell" />
                    <CommandItemSettings ShowAddNewRecordButton="false" />
                    <NoRecordsTemplate>
                        <div>
                            <p class="alert-danger">   There are no records to display</p>
                        </div>
                    </NoRecordsTemplate>
                    <Columns>
                        <telerik:GridBoundColumn DataField="BuildPlanId" HeaderText="Product" Visible="false" UniqueName="BuildPlanId" />
                        <telerik:GridBoundColumn DataField="Product" HeaderStyle-Width="12%" HeaderText="Product" ReadOnly="true" UniqueName="Product" />
                        <telerik:GridBoundColumn DataField="Area" HeaderStyle-Width="15%" HeaderText="Area" ReadOnly="true" UniqueName="Area" />
                        <telerik:GridBoundColumn DataField="Day" HeaderStyle-Width="12%" HeaderText="Day" ReadOnly="true" UniqueName="Day" />
                        <telerik:GridBoundColumn DataField="Date" HeaderStyle-Width="12%" HeaderText="Date" ReadOnly="true" UniqueName="Date" DataFormatString="{0: MM/dd/yyyy}" />
                        <telerik:GridTemplateColumn DataField="Quantity" HeaderStyle-Width="10%" UniqueName="Quantity" HeaderText="Quantity">
                            <ItemTemplate>
                                <%# Eval("Quantity") %>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadNumericTextBox ID="txtQty" runat="server" MinValue="1" MaxValue="300" ShowSpinButtons="true" Width="80" NumberFormat-DecimalDigits="0" NumberFormat-GroupSeparator="" />
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="Shift" HeaderStyle-Width="10%" HeaderText="Shift" Visible="false" UniqueName="Shift" />
                    </Columns>
                </MasterTableView>
                <ClientSettings AllowKeyboardNavigation="true"></ClientSettings>
            </telerik:RadGrid>
        </div>
    </asp:Panel>
</asp:Content>
Dan
Top achievements
Rank 1
 answered on 22 Mar 2017
6 answers
191 views

Hello All
I have a Issue with the RadButton ToggleType="Radio" buttons. In Insert Mode Radio Button Selected Value Save Data is Properly
but When I Edit Mode and I Press My Edit  Button Then RadButton Selected Value is Unchecked

 

 

<table>
           <tr>
               <td valign="top" align="right">
                   <asp:Label ID="lblSchedule" runat="server" CssClass="labelText" Text="Schedule: "></asp:Label>
               </td>
               <td valign="top" align="left" colspan="3">
                   <telerik:RadButton ID="rdEmployer1" runat="server" ButtonType="ToggleButton" GroupName="Schedule" ToggleType="Radio" AutoPostBack="false" Text="Mon" Value="1"></telerik:RadButton>
                   <telerik:RadButton ID="rdEmployer2" runat="server" ButtonType="ToggleButton" GroupName="Schedule" ToggleType="Radio" AutoPostBack="false" Text="Tue" Value="2"></telerik:RadButton>
                   <telerik:RadButton ID="rdEmployer3" runat="server" ButtonType="ToggleButton" GroupName="Schedule" ToggleType="Radio" AutoPostBack="false" Text="Wed" Value="3"></telerik:RadButton>
                   <telerik:RadButton ID="rdEmployer4" runat="server" ButtonType="ToggleButton" GroupName="Schedule" ToggleType="Radio" AutoPostBack="false" Text="Thr" Value="4"></telerik:RadButton>
                   <telerik:RadButton ID="rdEmployer5" runat="server" ButtonType="ToggleButton" GroupName="Schedule" ToggleType="Radio" AutoPostBack="false" Text="Fri" Value="5"></telerik:RadButton>
                   <telerik:RadButton ID="rdEmployer6" runat="server" ButtonType="ToggleButton" GroupName="Schedule" ToggleType="Radio" AutoPostBack="false" Text="Sat" Value="6"></telerik:RadButton>
               </td>
           </tr>
       </table>
       protected void btnEmployerEdit_Click(object sender, EventArgs e)
       {
             DataSet dsEmploerList = General.General.objService.GetEmployerBYID(Convert.ToInt32(EmployerPK);
             if (dsEmploerList != null && dsEmploerList.Tables.Count > 0 && dsEmploerList.Tables[0].Rows.Count > 0)
               {
                   if (Convert.ToString(dsEmploerList.Tables[0].Rows[0]["Schedule"]) == "1")                   
                       rdEmployer1.Checked = true; 
                   if (Convert.ToString(dsEmploerList.Tables[0].Rows[0]["Schedule"]) == "2")
                       rdEmployer2.Checked = true;
                   if (Convert.ToString(dsEmploerList.Tables[0].Rows[0]["Schedule"]) == "3")
                       rdEmployer3.Checked = true;
                   if (Convert.ToString(dsEmploerList.Tables[0].Rows[0]["Schedule"]) == "4")
                       rdEmployer4.Checked = true;
                   if (Convert.ToString(dsEmploerList.Tables[0].Rows[0]["Schedule"]) == "5")
                       rdEmployer5.Checked = true;
                   if (Convert.ToString(dsEmploerList.Tables[0].Rows[0]["Schedule"]) == "6")
                       rdEmployer6.Checked = true;
                   if (Convert.ToString(dsEmploerList.Tables[0].Rows[0]["Schedule"]) == "")
                       rdEmployer1.Checked = rdEmployer2.Checked = rdEmployer3.Checked = rdEmployer4.Checked = rdEmployer5.Checked = rdEmployer6.Checked = false;
               }
       }
 
     protected void btnEmployerSave_Click(object sender, EventArgs e)
       {
           string Scheduler = string.Empty;
           if (rdEmployer1.Checked == true)
               Scheduler = "1";
           if (rdEmployer2.Checked == true)
               Scheduler = "2";
           if (rdEmployer3.Checked == true)
               Scheduler = "3";
           if (rdEmployer4.Checked == true)
               Scheduler = "4";
           if (rdEmployer5.Checked == true)
               Scheduler = "5";
           if (rdEmployer6.Checked == true)
               Scheduler = "6";
 
           if (EmployerPK > 0)
           {
               EmployerPK = General.General.objService.UpdateEmployer(EmployerPK, Scheduler);
           }
           else
           {
               EmployerPK = General.General.objService.InsertEmployer(Scheduler);
           }        
       }

 

 

 

Yasha
Top achievements
Rank 1
 answered on 22 Mar 2017
0 answers
82 views

I have radajaxpanel and inside of that I have a radscriptblock. In the block I am writing dynamic javascript code. It has to be updated on postback with the changes made on the page by the user. Now, this process was working well for a while.

However, when I went to review the page. After postback, the javascript did not work. I noticed in firebug that when the page initially loaded I saw the script tag and the dynamic code. When I did a postback, I no longer saw the script tag, and no javascript was loaded. The only thing I recall was that I updated telerik on the site to  2017.1.118.45. Did something change in the newer version or could it be something else?

 

 

Paul
Top achievements
Rank 1
Iron
 asked on 22 Mar 2017
3 answers
120 views

Hi,

I'm using a RadTreeList with data bound using a DataTable in NeedDataSource.

I set AllowRecursiveSelection to true so that all child nodes are selected too, even if they are not expanded.

Unfortunately, it doesn't work as expected. If I check SelectedItems on the server, I only get a list containing the currently VISIBLE selected items. The child items are not included. If I expand this selected node, the children are selected as expected and appear in the SelectedItems. If I collapse the node again, they don't appear in SelectedItems anymore.

Also, the Items property only contains the currently VISIBLE items,  I expected it to contain all items.

The SelectedIndexes property is always correct, but I don't know how I could use this information to find the according data in the DataTable.

 

What do I have to do to get SelectedItems to return the invisble selected items too?

Thanks!

Eyup
Telerik team
 answered on 22 Mar 2017
6 answers
993 views

I have a page with some search criteria. When the page comes up the first time, I would like to present the page with no data in the grid. And once the user clicks the search button, I would populate the grid with data using the search criteria selected.

    'Search Button Click Event
    Private Sub cmdSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdSearch.Click
        RadGrid2.DataSource = Data.SubmissionTracking.GetSubmissionDetails()

    End Sub

    'Rad Grid NeedDataSource Event
    Private Sub RadGrid2_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs) Handles RadGrid2.NeedDataSource
        If Not e.IsFromDetailTable Then
            RadGrid2.DataSource = Data.SubmissionTracking.GetSubmissionDetails()
        End If
    End Sub

This is what I see that occurs at runtime:
The page populates with some data even on initial load, because the NeedDataSource event is fired. I would like to avoid that and present the user with no grid.
Also, when the search button is clicked, the NeedDataSource event is fired before the Search button click event. And in some cases, I found that the entire grid events are bypassed (in the sense none of the events get fired on postback).

Please let me know what I may be missing.

Thanks!
Naveen
Top achievements
Rank 1
 answered on 22 Mar 2017
3 answers
124 views
It's possibile add custom controls (ex: RadButton) in a RadGrid pager?
Rumen
Telerik team
 answered on 22 Mar 2017
5 answers
170 views
I'm having a problem with the RadGrid GridSelectColumn where if the user misses the checkbox by a single pixel, it deselects the rest of the items they've selected and selects just that one row. I realize this is because clicking a row selects only that row by default, but I was wondering if there was some way that I could make it so that clicking anywhere in the cell with the checkbox would work the same as clicking the checkbox.
Pavlina
Telerik team
 answered on 22 Mar 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?