Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
54 views
I must really be stupid, but I am trying to location the AutoCompleteBoxData class and the AutoCompleteBoxItemData class.

These 2 classes are referenced in the AutoCompleteBox - Data Binding - Various Data Sources demo, but I cannot locate them so I can set up a demo on my locale system that mirrors what is on your site.

Any help you can give me would be most appreciated!

Thanks in advance!

Lynn
Lynn
Top achievements
Rank 2
 answered on 26 Nov 2014
1 answer
58 views
I have a simple radMenu with 6 items and no children in mobile mode. When it is displayed on my iPhone 6 Plus in portrait mode then all six items are shown, when in landscape mode then only four items are show. Why? Screen shots attached.
Dimitar
Telerik team
 answered on 26 Nov 2014
4 answers
238 views
I have a RadComboBox in an edit template of a grid with a RequiredFieldValidator. The combo box is set to to Filter="Contains", with an empty message of "--Select--". The RequiredFieldValidator will stop them from submitting if they have not entered any text, however it will not stop them if they have not selected at item. If they try filtering by a value that is not in the list and hit save without selecting it will not prevent this action. 

I tried using a CompareValidator but I can't get it to fire when nothing is selected. Also I believe this would only compare the text they have entered as it grabs the Text field and not the Value field.

Is there a Validator I can use to verify they have actually selected an item when allowing filtering, or will I need to write some javascript validation for this?

<telerik:GridTemplateColumn Display="false" UniqueName="colClass" HeaderText="Class">
  <ItemTemplate>
    <asp:Label runat="server" ID="lblClass" Text=<%# Eval("Class") %> ></asp:Label>
  </ItemTemplate>
  <EditItemTemplate>
    <telerik:RadComboBox runat="server" ID="cbbClass" DataSourceID="classesDS" OnSelectedIndexChanged="cbbClass_SelectedIndexChanged" AutoPostBack="true" EmptyMessage="--Select a Class--" Filter="Contains" DataValueField="Class_ID" DataTextField="Class" SelectedValue = <%# Eval("Class_ID") %> ></telerik:RadComboBox>
    <asp:RequiredFieldValidator runat="server" ID="cbbClassValidator" ValidationGroup="SessionSave" ErrorMessage="You must select a Class!" Text="*" Display="Dynamic" ControlToValidate="cbbClass" ></asp:RequiredFieldValidator>
    <asp:CompareValidator runat="server" ID="cbbClassValidator2" ValueToCompare=""
                    Operator="NotEqual" ControlToValidate="cbbClass" Display="Dynamic" ErrorMessage="You must select a Class2!" Text="*" ValidationGroup="SessionSave" />
  </EditItemTemplate>
</telerik:GridTemplateColumn>

Thanks,
James
Steve
Top achievements
Rank 1
 answered on 26 Nov 2014
1 answer
439 views
Hi,

I have used RadComboBox inside my DetailsView. I send the value of combobox as comma separated to the database as (1,2,3,4). When I want to retrieve the data (1,2,3,4) from the database on edit mode of DetailsView, how can I set or bind the "Checked" values and display them as checked back in the combobox.

Here is what i have done:

WebForm1.Aspx

<%----------------------- DATA SOURCE FOR DELIVERABLE -------------------------%>
 
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ITSConnectionString %>"
            DeleteCommand="DELETE FROM [Deliverable] WHERE [DeliverableId] = @DeliverableId"
            InsertCommand="INSERT INTO [Deliverable] ([DeliverableTitle],[CCIds]) VALUES (@DeliverableTitle, @CCIds)"
            SelectCommand="SELECT * FROM [Deliverable] WHERE ([DeliverableId] = @DeliverableId)"
            UpdateCommand="UPDATE [Deliverable] SET [DeliverableTitle] = @DeliverableTitle, [CCIds] = @CCIds WHERE [DeliverableId] = @DeliverableId">
            <DeleteParameters>
                <asp:Parameter Name="DeliverableId" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="DeliverableId" Type="int32" />
                <asp:Parameter Name="DeliverableTitle" Type="String" />
                <asp:Parameter Name="CCIds" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="DeliverableId" Type="int32" />
                <asp:Parameter Name="DeliverableTitle" Type="String" />
                <asp:Parameter Name="CCIds" Type="String" />
            </UpdateParameters>
   <SelectParameters>
      <asp:QueryStringParameter Name="DeliverableId" QueryStringField="DeliverableId" Type="Int32" />
   </SelectParameters>
</asp:SqlDataSource>
 
<%----------------------- DATA SOURCE FOR COMBOBOX -------------------------%>
 
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ITSConnectionString %>" SelectCommand="SELECT [UserId], [DisplayName] FROM [Users]"></asp:SqlDataSource>
 
<%----------------------- THE DETAILS VIEW -------------------------%>
 
<asp:DetailsView ID="DetailsView1" runat="server" DefaultMode="Insert" AutoGenerateRows="False" DataKeyNames="DeliverableId" DataSourceID="SqlDataSource2" Height="50px" Width="125px" OnItemInserting="DetailsView1_ItemInserting" OnDataBinding="DetailsView1_DataBinding" OnDataBound="DetailsView1_DataBound">
            <Fields>
                <asp:BoundField DataField="DeliverableId" HeaderText="DeliverableId" InsertVisible="False" ReadOnly="True" SortExpression="DeliverableId" />
                <asp:BoundField DataField="DeliverableId" HeaderText="DeliverableId" SortExpression="DeliverableId" />
                <asp:BoundField DataField="DeliverableTitle" HeaderText="DeliverableTitle" SortExpression="DeliverableTitle"/>
                <asp:TemplateField>
                    <ItemTemplate>
                     <telerik:RadComboBox ID="CCIds" Text='<% #Bind("CCIds") %>' runat="server"
                         DataSourceID="SqlDataSource1" DataTextField="DisplayName"  DataValueField="UserId"
                         CheckBoxes="true"></telerik:RadComboBox>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ShowEditButton="True" />
                <asp:ButtonField Text="Insert" CommandName="Insert" />
                <asp:ButtonField Text="Update" CommandName="Update" />
            </Fields>
        </asp:DetailsView>

WebForm1.Aspx.CS
        public string GetCheckBoxValues(string RadComboBoxName)
        {
            RadComboBox rcb = (RadComboBox)DetailsView1.FindControl(RadComboBoxName);
            var collection = rcb.CheckedItems;
            StringBuilder sbValues = new StringBuilder();
            if (collection.Count != 0)
            {
                foreach (var item in collection)
                {
                    sbValues.Append(item.Value);
                    sbValues.Append(Delimiter);
                }
                if (sbValues.ToString().EndsWith(Delimiter))
                    sbValues.Remove(sbValues.Length - 1, 1);
            }
            return sbValues.ToString();
        }
         
// Get the comma separate values and insert them into the DB.
        protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
        {
            string CCIds = GetCheckBoxValues("CCIds");
            if (CCIds != null)
            {
                e.Values["CCIds"] = CCIds;
            }
         }

Now how can I get the comma separated values and bound them with the combobox so that it should check only those items.
Hristo Valyavicharski
Telerik team
 answered on 26 Nov 2014
1 answer
102 views
hi is there any way , or plan to add functionality to the HTMLChart to allow it to have a range selector on non stock based data , as i would love to use the navigator but the data i have isnt price based.

Danail Vasilev
Telerik team
 answered on 26 Nov 2014
1 answer
64 views
I need some help on the steps to take to bind data from a sharepoint webserivce call with C# ( calling the webservice from our public website as to display non editable events ).  

Can't seem to feed an XmlDocument object into the XmlSchedulerProvider, seems to need to be stored as a document on the server. 

Would it be better to parse the xml from the web service call into a generic list? 

Any insights will be helpful.  
Boyan Dimitrov
Telerik team
 answered on 26 Nov 2014
5 answers
274 views
Hi all,

I am struggling with binding some entities from the Entity Framework 6.0 to the RadGrid.
The solution contains an Entity Framework 6.1.1 Code First Migrations project in which I have a DBContext which contains several DBSets. A DBSet is just a set of POCO classes.

Now comes the struggle... How to bind it with a RadGrid inside an ASP.NET project. I already tried some things which I found in the demo`s forums and other internet posts.
I tried it with the EntityDataSource but this one only uses a ObjectContext instead of a DBContext. I know there is a NuGetPackage which contains an updated EntityDataSource and need to test this.
I also tried connecting the DBSet directly to the datasource property of the datagrid by using the NeedDataSource event. In this case I get an error on loading the web page: Data binding directly to a store query (DbSet, DbQuery, DbSqlQuery, DbRawSqlQuery) is not supported......For ASP.NET WebForms you can bind to the result of calling ToList() on the query or use Model Binding.

When I try to do as described in the above error and call the ToList() method on the DBSet the page is rendered correctly but all things like sorting, filtering, paging, etc are not working.

Can someone please help me on this and give me some advice how to bind the RadGrid to the Entity Framework 6.1.1 entities so the sorting, filtering, grouping, paging, etc is working out of the box?
Beside the above functionality I also need CRUD operations. I guess this has to be implemented through code and will not come Out Of the Box?

Thank you all in advance!!!
Sander
Top achievements
Rank 1
 answered on 26 Nov 2014
1 answer
165 views
I'm having an issue trying to update an ajaxpanel that contains a placeholder on a master page from the child page. 

In my master page, i expose the panel to the child page. The panel is wrapped in an ajaxpanel.

In the child page, I may have a button that does some function within its own ajaxpanel, the codebehind for that button will change the panel in the parent page, however the ajax panel on the parent page does not update.

Is there a better way to to do this?

My end result is to have a set of status-notifications (error, success, info, etc) on the master page that can easily be called from child pages within the application without the need for client-side scripting. 
Maria Ilieva
Telerik team
 answered on 26 Nov 2014
1 answer
198 views
Hi,
I am trying to get the RadComboBox [Cmb_Lst_Sel] in CommandItemTemplate on Page_Load. Once I have the list ids [lst_ids] from the RadComboBox [Cmb_Lst_Sel], I pass these IDs to SqlDataSource to filter and rebind the RadGrid [Grd_Url]. But I get error and cannot get a reference to the RadComboBox [Cmb_Lst_Sel]. 

What am I doing wrong?


    ASPX Code:
    ------------------------------------------------------------------------------
    <telerik:RadGrid ID="Grd_Url" runat="server" GridLines="None" AllowSorting="true" AllowPaging="true" PageSize="50"
        AllowFilteringByColumn="true" AutoGenerateColumns="False" AllowMultiRowSelection="true" AllowMultiRowEdit="true"
        AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowAutomaticDeletes="True" 
        DataSourceID="Sql_Url" Width="100%">
        <SortingSettings SortToolTip=""/>
        <FilterItemStyle Width="100%"></FilterItemStyle>
        <GroupingSettings CaseSensitive="false"></GroupingSettings>
        <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric"/>
        <MasterTableView DataKeyNames="url_id" CommandItemDisplay="Top" EditMode="InPlace" InsertItemPageIndexAction="ShowItemOnCurrentPage"
            GroupLoadMode="Client" GroupsDefaultExpanded="true" TableLayout="Fixed" Width="100%">
            <GroupByExpressions>
                <telerik:GridGroupByExpression>
                    <SelectFields>
                        <telerik:GridGroupByField FieldName="lst_name"></telerik:GridGroupByField>
                        <telerik:GridGroupByField FieldName="lst_sort"></telerik:GridGroupByField>
                    </SelectFields>
                    <GroupByFields>
                        <telerik:GridGroupByField FieldName="lst_sort" SortOrder="Ascending"></telerik:GridGroupByField>
                        <telerik:GridGroupByField FieldName="lst_name" SortOrder="Ascending"></telerik:GridGroupByField>
                    </GroupByFields>
                </telerik:GridGroupByExpression>
            </GroupByExpressions>
            <CommandItemTemplate>
            <div id="Div_Tlb_Fixed">
                <telerik:RadToolBar ID="Tlb_Url" runat="server" EnableImageSprites="true"
                    OnButtonClick="CsTlbClick" OnClientButtonClicking="jsTlbUrl">
                    <Items>
                        <telerik:RadToolBarButton CommandName="Toggle" PostBack="false" ToolTip="Expand/Collapse Folders"
                            CssClass="Btn_ToggleN" HoveredCssClass="Btn_ToggleH"
                            CheckOnClick="true" AllowSelfUnCheck="true" Group="T">
                        </telerik:RadToolBarButton>
    
                        <telerik:RadToolBarButton CommandName="Clear" PostBack="false" ToolTip="Clear Website Selection"
                            CssClass="Btn_ClearN" HoveredCssClass="Btn_ClearH">
                        </telerik:RadToolBarButton>
                    </Items>
                </telerik:RadToolBar>
                <telerik:RadComboBox ID="Cmb_Lst_Sel" runat="server" DataTextField="lst_name" CheckBoxes="true"
                    DataValueField="lst_id" AutoPostBack="True" EnableCheckAllItemsCheckBox="true" 
                    DataSourceID="Sql_Lst" Width="20%">
                    <Items>
                        <telerik:RadComboBoxItem Text="All" Value="" Selected="true"></telerik:RadComboBoxItem>
                    </Items>
                </telerik:RadComboBox> 
            </div>
            </CommandItemTemplate>
            <Columns>
                <%--Some Columns here--%>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    
    <asp:SqlDataSource ID="Sql_Lst" runat="server" OnSelecting="CsSqlSelectingCmb"
    ConnectionString="<%$ ConnectionStrings:Con_Str %>"
        SelectCommand="SELECT [lst_id], [lst_name] 
                       FROM [t_Lists] 
                       WHERE [usr_id] = @usr_id 
                       ORDER BY [lst_sort]">
        <SelectParameters>
            <asp:Parameter Name="usr_id"/>
        </SelectParameters>
    </asp:SqlDataSource>
    
    
    C# Code:
    ------------------------------------------------------------------------------
    
        public partial class Cls_Url : System.Web.UI.UserControl
        {
            protected void Page_Load(object s, EventArgs e)
            {
                // Grab the RadComboBox in CommandItemTemplate on Page_Load
                CsSqlSelect(s, e);
            }
    
            protected void CsSqlSelect(object s, EventArgs e)
            {
                // I get error for the 2 lines below and cannot get a reference to the RadComboBox [Cmb_Lst_Sel]
                // What am I doing wrong?
                GridItem cmdItem = Grd_Url.MasterTableView.GetItems(GridItemType.CommandItem)[0];
                RadComboBox cmbLst = (RadComboBox)cmdItem.FindControl("Cmb_Lst_Sel");
    
                if (cmbLst.CheckedItems.Count > 0)
                {
                    var items = cmbLst.CheckedItems;
                    string lst_ids = "";
    
                    foreach (var item in items)
                    {
                        lst_ids += "'" + item.Value + "'" + ",";
                    }
    
                    lst_ids = lst_ids.Remove(lst_ids.Length - 1);
                }
    
                // Once I have the list ids [lst_ids] from the RadComboBox [Cmb_Lst_Sel], 
                // I pass these IDs to SqlDataSource to filter and rebind the RadGrid [Grd_Url]
            }
    
            protected void CsTlbClick(object s, RadToolBarEventArgs e)
            {
            }
    
            protected void CsSqlSelectingCmb(object s, SqlDataSourceCommandEventArgs e)
            {
                e.Command.Parameters["@usr_id"].Value = Membership.GetUser(HttpContext.Current.User.Identity.Name).ProviderUserKey;
            }
    
        } 

    ------------------------------------------------------------------------------

Radoslav
Telerik team
 answered on 26 Nov 2014
3 answers
48 views
There's a breaking change between Q2 and Q3 2014. Requests for a Telerik.Web.UI.WebResource (axd) now calls the Application_AcquireRequestState method in the global.asax. Anything before Q3 and the standard ASP AJAX axd requests do not call this method.

We have had to manually add specific code to ignore axd requests, this was not necessary before, is this going to be fixed?

Thanks,
Dimitar Terziev
Telerik team
 answered on 26 Nov 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?