Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
106 views
I have a need to load 7,000 items into a template combo box.
Right now it just populates from a SqlDataSource and loads but it takes forever and a day to load.
Any suggestions or samples appreciated

thanks
Shinu
Top achievements
Rank 2
 answered on 18 Jun 2013
2 answers
214 views
Hi ,

Am working on RadNumericTextBox to enable users to enter values allowed through the spin buttons only.

Example: The control should have min value  as 10 and max value as 80 and increment by 10, so the control should allow only 10,20,30,40,50,60,70 and 80 as the allowed values and should show error message on violating this.

How this functionality can be achieved ?

Thanks,
Stalin 
Shinu
Top achievements
Rank 2
 answered on 18 Jun 2013
2 answers
550 views

The code below is supposed for adding a RadioButtonList to an existing form which uses telerik controls. An appropriate radio button is displayed as selected when the page renders the first time. After that  the user can select a different radio button, and that will trigger OnSelectedIndexChanged to save the new value to the database. Somehow the condition:if (e.Item is GridEditableItem && e.Item.IsInEditMode)  is never met. I see samples on the internet but cannot make this works. I'd appreciate it if someone can correct the codes that I have below.

I want the page to display 2 radio buttons without making the user click on any link (such as Edit) to see the 2 radio buttons.

<telerik:RadGrid ID="RadGrid1"  runat="server" AutoGenerateColumns="False"
  ShowStatusBar="True" GridLines="Both"  OnNeedDataSource="RadGrid1_NeedDataSource" OnItemDataBound="RadGrid1_ItemDataBound"
  CellSpacing="2" OnSelectedIndexChanged="RadGrid1_OnSelectedIndexChanged" >
  <MasterTableView NoMasterRecordsText="data not found" Width="100%" GridLines="Both" TableLayout="Fixed">
    <Columns>
      
            <telerik:GridBoundColumn  Visible="false"   DataField="id" SortExpression="id" UniqueName="id" />
  
      <telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderText="Country">
        <ItemTemplate>
          <asp:Label ID="Label1" runat="server">test list</asp:Label>
        </ItemTemplate>
        <EditItemTemplate>
                    <asp:RadioButtonList  CellPadding="0" DataValueField="rbtestList" SelectedValue='<%#Eval("rbtestList")%>'
                         CellSpacing="0" ID="rbtestList" runat="server" RepeatColumns="4"
                         RepeatDirection="Vertical" TabIndex="7" >
                        <asp:ListItem Text="0" Value="0"/>
                        <asp:ListItem Text="1" Value="1" />
                     </asp:RadioButtonList>
        </EditItemTemplate>
  
      </telerik:GridTemplateColumn>
        </Columns>
  </MasterTableView>
</telerik:RadGrid>
  
    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
            RadGrid1.DataSource = this.dbData;
    }
  
    protected override void Page_Load(object sender, EventArgs e)
    {
            if (!Page.IsPostBack)
            {
                if (this.dbData.Tables[0].Rows.Count < 1)
                {
                    RadGrid1.MasterTableView.IsItemInserted = true;
                }
                else
                {
                    RadGrid1.MasterTableView.IsItemInserted = false;
                }
            }
    }
      
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
            totalRows = dbData.Tables[0].Rows.Count;
              
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                GridEditableItem item = e.Item as GridEditableItem;
  
                if (totalRows > 0)
                {
                    RadioButtonList rbltestList = (RadioButtonList)item.FindControl("rbtestList");
                    rbltestList.SelectedValue = dbData.Tables[0].Rows[0]["testList"].ToString().Trim();
                }
            }
    }
  
    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
            if (!Page.IsPostBack)
            {
                GridBoundColumn testListColumn =
                       (GridBoundColumn)RadGrid1.MasterTableView.GetColumn("rbtestList");
            }
    }
Lisa
Top achievements
Rank 1
 answered on 18 Jun 2013
1 answer
152 views

Version: 2013.1.220.35 Telerik.web.UI

I have dropdown tree on a sharepoint page.

<telerik:RadDropDownTree ID="RadDropDownTreeTest" runat="server" AutoPostBack="true"

DefaultMessage="Please select" CheckBoxes="TriState"

OnEntryAdded="RadDropDownTreeTest_EntryAdded"

OnEntryRemoved="RadDropDownTreeTest_EntryRemoved">

<DropDownSettings Width="200px" />

</telerik:RadDropDownTree>


cs file:

 

protected

 

void RadDropDownTreeTest_EntryAdded(object sender, DropDownTreeEntryEventArgs e)

{

 

lblTest.Text = e.Entry.Value;

}

 

protected void RadDropDownTreeTest_EntryRemoved(object sender, DropDownTreeEntryEventArgs e)

{

 

lblTest.Text = e.Entry.Value;

}

I also tried hooking the events on page load but no change. The data appears in tree view and events are not triggering though the page shows selected node.

Not sure what is worng with the code.

thanks for you help.

J
Top achievements
Rank 1
 answered on 17 Jun 2013
6 answers
1.1K+ views
Hi there,
    I have a grid and a button inside the nested view template. What is the way of getting the parent dataitem details in the GridItemCommand event for this button? Have a look at the code below and any help would be higgly appreciated
                            <telerik:RadGrid Skin="Office2007" runat="server" ID="rdGd1" ShowFooter="False"
                                AllowSorting="True" AllowPaging="True"   PageSize="10"
                                GridLines="None">
                                <MasterTableView DataKeyNames="assetNodeID" AutoGenerateColumns="False" Name="MainGrid"
                                    CommandItemDisplay="Top" HierarchyLoadMode="ServerOnDemand">
                                    <CommandItemTemplate>
                                        <asp:Label ID="lblHeaderr" runat="server"></asp:Label>
                                    </CommandItemTemplate>
                                      <Columns>
....
....
.....
  </Columns>
                                    <NestedViewTemplate>
  
         <asp:Panel runat="server" ID="InnerContainer">
      <asp:Button ID="btnView" runat="server" Text="View" CommandName="View" />
 </asp:Panel>
                                    </NestedViewTemplate>
 <ExpandCollapseColumn Visible="True">
                                    </ExpandCollapseColumn>
                                </MasterTableView>
                            </telerik:RadGrid>
  Protected Sub rdGd1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rdGd1.ItemCommand
If e.CommandName = "View" Then
    .... Here I need the current dataItem details of this grid
 End If
  End Sub

Regards
Shafi
L
Top achievements
Rank 1
 answered on 17 Jun 2013
1 answer
189 views
Hi,

I want to find the parent of the parent in a hierarchy grid structure. I have this:
<telerik:RadGrid ID="RadGrid1" runat="server" Width="50%" ShowStatusBar="true" AutoGenerateColumns="False"
            PageSize="50" AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="True"
            OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnNeedDataSource="RadGrid1_NeedDataSource"
            OnPreRender="RadGrid1_PreRender">
            <PagerStyle Mode="NumericPages"></PagerStyle>
            <MasterTableView Width="100%" DataKeyNames="ServiceName" AllowMultiColumnSorting="True">
                <DetailTables>
                    <telerik:GridTableView DataKeyNames="MethodName" Name="MethodName" Width="100%">
                        <DetailTables>
                            <telerik:GridTableView DataKeyNames="ParameterName" Name="ParameterName" Width="100%">
                                <Columns>
                                    <telerik:GridBoundColumn SortExpression="ParameterName" HeaderText="Parameter Name"
                                        HeaderButtonType="TextButton" DataField="ParameterName">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn SortExpression="ParameterType" HeaderText="Parameter Type"
                                        HeaderButtonType="TextButton" DataField="ParameterType">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridTemplateColumn HeaderText="Parameter Value" UniqueName="ParamWrapper">
                                        <ItemTemplate>
                                            <asp:TextBox runat="server" ID="ParameterValue" Text='<%# DataBinder.Eval(Container.DataItem, "ParameterValue") %>'></asp:TextBox>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                            </telerik:GridTableView>
                        </DetailTables>
                        <Columns>
                            <telerik:GridBoundColumn SortExpression="MethodName" HeaderText="Method Name" HeaderButtonType="TextButton"
                                DataField="MethodName" UniqueName="MethodName">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn HeaderText="Status">
                                <ItemTemplate>
                                    <asp:Button runat="server" ID="btnMethodStatus" OnClick="btnMethodStatus_OnClick"
                                        Text="-"></asp:Button>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Elapsed time">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblElapsedTime" Text="0">
                                    </asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Last executed on">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblLastTimeExecuted" Text="-">
                                    </asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </telerik:GridTableView>
                </DetailTables>
                <Columns>
                    <telerik:GridBoundColumn SortExpression="ServiceName" HeaderText="Service Name" HeaderButtonType="TextButton"
                        DataField="ServiceName">
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn HeaderText="Status">
                        <ItemTemplate>
                            <asp:Button runat="server" ID="btnServiceStatus" OnClick="btnServiceStatus_OnClick"
                                Text="-"></asp:Button>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn HeaderText="Elapsed time">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblElapsedTime" Text="0">
                            </asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn HeaderText="Last executed on">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblLastTimeExecuted" Text="-">
                            </asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>

Code behind:
protected void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
            switch (e.DetailTableView.Name)
            {
                case "MethodName":
                    {
                        e.DetailTableView.DataSource = Method.GetMethods((string)dataItem.GetDataKeyValue("ServiceName"));
                        break;
                    }
 
                case "ParameterName":
                    {
                         //TODO: Get ParentItem
                        e.DetailTableView.DataSource = Parameter.GetParameters((string)dataItem.GetDataKeyValue("MethodName"), (string)parentItem.GetDataKeyValue("ServiceName"));
                        break;
                    }
            }
        }

In the case "ParamenterName", I need to be able to find the parent of the parent of the EventArgs e. Right now I can easily get the immediate parent, what I need is one step above. 

Thanks in advance,
L
Top achievements
Rank 1
 answered on 17 Jun 2013
2 answers
568 views
I have a support ticket open for this (380752), but I thought I would give the forums a shot as well. The web application I am working on is for an annual review at my company. At the top of the form there is a standard ASP.NET drop down box with a list of names that the person logged into the website manages. They can select the person from the drop down box and on the server side, it will check to see if that use already has an annual review in the database or not. If not, it will display a blank form for the person to fill out and submit to the database.

If there is already one in the database, it will pull the information from the database and populate the many RadTextBoxes and RadNumericTextBoxes I have on the form with the information from the database. This is so they can update it or make changes before the final submission to the employee. That all works fine up to this point. The issue comes in when I try to change a value on the form that was populated with data from the database. If I try to change a rating on one of the RadNumericTextBoxes or change the comments or any change with any of the RadInput controls, when I hit the save button, on the watch list, the values are exactly as they were initially populated from the database and not the changed values I typed in the browser. I am testing this on IE 9.0.7930 and I have also tested it on Firefox 3.6.13 to make sure it was not an IE issue.

Any ideas on what I may be doing wrong?

Thanks.
Kaiser
Top achievements
Rank 1
 answered on 17 Jun 2013
2 answers
66 views
Hi All,
I have an Ajax-ified page with six RadGrids. To avoid duplicate code the grid is in a usercontrol that get's loaded into six panels. The datasource for each grid is handled in the "main" page in code-behind.
Everything's working, except for paging. I believe I need to handle the NeedDataSource event, but I'm unsure where to do this.
Thx in advance for help and/or pointers!
Rgds - M.


Pseudocode (code behind)
// SqlConnection sqlconn = ......
// Dataset, fill etc ...
 
// Findcontrol grid in pnl1
grid1.Datasource = ds.Tables[0];
grid1.DataBind();
 
// Findcontrol grid in pnl2
grid2.Datasource = ds.Tables[1];
grid2.DataBind();
 
//etc


Pseudocode (aspx)
<telerik:RadAjaxManager ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Execute">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnl1" />
                    <telerik:AjaxUpdatedControl ControlID="pnl2" />
                    <telerik:AjaxUpdatedControl ControlID="pnl3" />
                     .......
                  </UpdatedControls>
            </telerik:AjaxSetting>
</telerik:RadAjaxManager>
 
<asp:Panel ID="pnl1" runat="server" Visible="false">
        <uc:Grid ID="Grid1" runat="server" />
</asp:Panel>
<asp:Panel ID="pnl2" runat="server" Visible="false">
        <uc:Grid ID="Grid2" runat="server" />
 </asp:Panel>
...
Marcus
Top achievements
Rank 1
 answered on 17 Jun 2013
3 answers
132 views
HI,

               I have a requirement before inserting an appointment to the scheduler i need to validate it. for that i want to have a serverside call on OnClientAppointmentInserting and then continue with next event OnAppointmentInsert.
currently, i am able to call a server side function on OnClientAppointmentInserting  but the next event i.e. OnAppointmentInsert is not getting fired. May i know how can i handle this?


TIA.

-Teja
Plamen
Telerik team
 answered on 17 Jun 2013
2 answers
178 views

The following code somehow does not display the filtering for columns ID and First Name in the grid. Does it require any code behind or anything for it to show filtering? I just want a very simple filtering for the grid columns.

<telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server"> 
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadGrid1"> 
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl  ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            </AjaxSettings> 
    </telerik:RadAjaxManagerProxy> 
    
    <telerik:RadAjaxLoadingPanel  ID="RadAjaxLoadingPanel1" runat="server" /> 
    <telerik:RadWindowManager  ID="RadWindowManager1" runat="server"  /> 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1" runat="server" > 
    
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" PageSize="7"
                 AllowFilteringByColumn="true" AllowSorting="True" AllowPaging="True" ShowStatusBar="True" GridLines="None"  
                 OnNeedDataSource="RadGrid1_NeedDataSource"   
                 OnPreRender="RadGrid1_PreRender"> 
             <MasterTableView  DataKeyNames="Id" 
                    AllowMultiColumnSorting="True" 
                    TableLayout="Fixed"  CommandItemDisplay="Top"    
                    AllowFilteringByColumn="True"> 
    
                    <Columns> 
                         <telerik:GridBoundColumn  ReadOnly="True" HeaderText="ID" DataField="id"
                            SortExpression="id" UniqueName="id" /> 
                        <telerik:GridBoundColumn  HeaderText="First Name" DataField="Name"
                            SortExpression="name" UniqueName="Name" /> 
                    </Columns> 
                    </MasterTableView> 
    
                <FilterMenu EnableImageSprites="False" /> 
    
            </telerik:RadGrid> 
      </telerik:RadAjaxPanel>
Lisa
Top achievements
Rank 1
 answered on 17 Jun 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?