Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
142 views
I used example from http://demos.telerik.com/aspnet-ajax/grid/examples/performance/linq/defaultcs.aspx to cache a data. I added just OrderBy="Name"  to LinqDataSort. When ASP.NET form is opened first time everything is good but after paging the sort order is not right. As I understand the issue Linq does OrderBy just when querying data from the database.  How to resolve this issue?  I have to keep the column Name sorted all time.

<asp:LinqDataSource ID="LinqIdDataSource" runat="server" AutoPage="false"
    TableName="V_ID_Dailies" Select="new (ID, Name)"
     ContextTypeName="IdLookupDataContext"
    OrderBy="Name" OnContextCreating="LinqIdDataSource_ContextCreating"
    OnSelected="LinqIdDataSource_Selected" OnSelecting="LinqIdDataSource_Selecting">
</asp:LinqDataSource>


Oleg
Nikolay Rusev
Telerik team
 answered on 11 Aug 2010
1 answer
122 views
My RadGrids have static headers and i am freezing the first 2 columns.
In Firefox and IE8, the radgrids are very smooth in their scrolling and everything is rendering excellently.
When I switch to IE7 compatibility mode, (or other coworkers view the site in old IE7), the header grid lines are overlapping on top of each other.

I can post my code if you all need to see it, but perhaps this is a simple fix that I am just not getting...

screen shots attached

thanks for any help!
Dimo
Telerik team
 answered on 11 Aug 2010
3 answers
226 views
I have a need to display a hierarchical grid on a touch-screen. The customer is requesting that the size of the buttons be larger for this purpose. I have tried overriding the image size using the following CSS override:

div.RadGrid .rgExpand,
div.RadGrid .rgCollapse
{
    height:32px;
    width:32px;
}

which works, however the image is located on the top left corner. It would be nicer if it were centered. Is there a better way of accomplishing this? if not is there a way to center the image?

Thanks, Steve
Dimo
Telerik team
 answered on 11 Aug 2010
3 answers
162 views
when i use the grid with with scroll that the headrer is static  "<Scrolling AllowScroll="true" UseStaticHeaders="true" />"
there is a shift between the header and the data  columns .
i use "RTL" language  and my telerik version is  "2009.1.402.20"  and the runtime version is "v2.0.50727".
when i remove the  UseStaticHeaders="true"  everything work fine, and it also work good with IE7.

here is an example code of my problem :

<%@ Page Language="C#" AutoEventWireup="true"    CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <telerik:RadCodeBlock id="rcb" runat="server">
      <script type="text/javascript" language="javascript">
    function pageLoad() {
   // if ($telerik.isIE7 || $telerik.isIE6)
   //          document.body.setAttribute('dir', 'rtl');
     //   var arr = document.getElementById("<%=gvToDoList.ClientID%>");
       
}
  </script>
 </telerik:RadCodeBlock>
</head>
<body  dir="rtl"  >
    <form id="form1" runat="server"  >
   
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
            <AjaxSettings>
               <telerik:AjaxSetting AjaxControlID="gvToDoList">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gvToDoList"  LoadingPanelID="RadAjaxLoadingPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
       
               <telerik:RadGrid ID="gvToDoList" Skin="Office2007" runat="server"
                            BorderStyle="Solid" BorderWidth="1px" AllowSorting="True" Width="100%" Height="400px" CellSpacing="1"
                       AllowFilteringByColumn="True"  AllowPaging="True" PageSize="25"   EnableAJAX="True" ShowStatusBar="True"    AutoGenerateColumns="False" meta:resourcekey="gvToDoListResource1">
                              <MasterTableView AutoGenerateColumns="false" EditMode="InPlace" AllowFilteringByColumn="True" 
                    >
                                <Columns>
                                   
                                   
                                    
                                    <telerik:GridBoundColumn    HeaderStyle-Width="100PX" FilterListOptions="VaryByDataTypeAllowCustom"    FilterControlWidth="70px"   DataField="candName" AllowSorting="true" SortExpression="candName"
                                        HeaderText="candName"   >
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn   HeaderStyle-Width="100PX"  FilterControlWidth="70px"   AllowSorting="true" DataField="JobName" SortExpression="JobName"
                                        HeaderText="JobName" meta:resourcekey="BoundFieldResource2">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn HeaderStyle-Width="100PX"  FilterControlWidth="70px"   AllowSorting="false" DataField="VacancyName" HeaderText="VacancyName "
                                        >
                                    </telerik:GridBoundColumn>
                                    
                                </Columns>
                            </MasterTableView>
                            <ClientSettings >
                                <Selecting AllowRowSelect="true"  />
                                <Scrolling AllowScroll="true" UseStaticHeaders="true"  ></Scrolling>
                            </ClientSettings>
                             <PagerStyle Mode="NextPrevAndNumeric"     VerticalAlign="Top" Height="40px"     PagerTextFormat="" />
                          
                        </telerik:RadGrid>
                     
               <telerik:RadAjaxLoadingPanel HorizontalAlign="Center" valign="middle"   Transparency="50"    ID="RadAjaxLoadingPanel1" runat="server">
             </telerik:RadAjaxLoadingPanel>
    
    </form>
</body>
</html>




Thanks
Dimo
Telerik team
 answered on 11 Aug 2010
0 answers
75 views
hi,


I am new to silverlight. I have aspx page and want to add silverlight controls to my page. how can i do that?
any help is appreciated.


thanks
benjamin
Benjamin
Top achievements
Rank 1
 asked on 11 Aug 2010
0 answers
114 views
Good Day

I have a Toolbar that is Declared this way

<telerik:RadToolBar ID="RadToolBar1" Runat="server" Height="100%" Skin="Forest" Width="100%">
    <Items>
        <telerik:RadToolBarButton Width="100%" runat="server" Text="Button1">
            <ItemTemplate>
                <asp:ImageButton ID="btnoweb"      runat="server" Height="50"
                    ImageUrl="~/images/o!logo.png" Width="50" />
                <asp:ImageButton ID="btnCalender"     runat="server"
                    ImageUrl="~/images/Picture5.png" OnClick="btnCalender_Click" />
                <asp:ImageButton ID="btnAttach"    runat="server" ImageUrl="~/images/Attach.png" />
                <asp:Menu ID="mnuMenu" runat="server">
                </asp:Menu>
                <telerik:RadMenu ID="mnuAdd"   runat="server" Visible="true">
                    <ItemTemplate>
                        <asp:Image ID="imgicon"     runat="server" EnableViewState="false"
                            ImageUrl="~/images/Add.png" />
                    </ItemTemplate>
                </telerik:RadMenu>
                  <asp:TextBox runat="server" ID="txtsearch" OnTextChanged="Bind_SearchBox" Font-Size="X-Large" Height="40px" Width="650px" onkeyup="this.onchange();" AutoPostBack="true" />
                <asp:ImageButton ID="btnsearch"     runat="server"
                    ImageUrl="~/images/btnsearch.png" OnClick="btnSearch_Click" />
                <asp:ImageButton ID="btnCancel"    runat="server" ImageUrl="~/images/Cancel.png"
                    OnClick="btnCancel_Click" />
            </ItemTemplate>
        </telerik:RadToolBarButton>
    </Items>
</telerik:RadToolBar>


and when i click any button on the ToolBar i get the Following Error

Server Error in '/o!Pilot' Application.

DataKeyField, DataSubjectField, DataStartField and DataEndField are required for databinding

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: DataKeyField, DataSubjectField, DataStartField and DataEndField are required for databinding

Source Error:


and my Scheduler is defined like this

         
  <telerik:RadScheduler ID="RadScheduler1"  runat="server" Skin="Forest"
    Width="100%" Height="100%" style="margin-left: 0"
    EnableViewState="false" Visible="false">
</telerik:RadScheduler>

and that EnableViewState="false" property is i set it to true, i get the Error even before the page load.

Thanks
Vuyiswa
Top achievements
Rank 2
 asked on 11 Aug 2010
0 answers
112 views
Good Day

I have a RadSchedular that is defined like this

<telerik:RadScheduler ID="RadScheduler1"  runat="server" Skin="Forest"
    Width="100%" Height="100%" style="margin-left: 0"
    EnableViewState="false" Visible="false">
</telerik:RadScheduler>

when i change the EnableViewState="true"  i get an Error

Server Error in '/o!Pilot' Application.

DataKeyField, DataSubjectField, DataStartField and DataEndField are required for databinding


I want to enable the Viewstate.

Thanks
Vuyiswa
Top achievements
Rank 2
 asked on 11 Aug 2010
1 answer
84 views
I made a survey tool with a rad rotator for an Ipad website, I am filling the rotator with RadioButtonlists and RadRating item dynamicly and the last part I add a button to say save survey. I loop though all the controls and I can not find any of the dynamic controls I even tried to use page.findcontrol and I can not find them, can anyone help out with this?

thanks!

Here is my code:
using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
using OSweb.Admin.DataTypes;
  
namespace OSweb.Controls
{
    public partial class DisplayQuestions : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                RadRotator1.ItemTemplate = new RadRotatorTemplate();
                RadRotator1.DataSource = CreateRotatorData(Convert.ToInt32(Session["DealerId"].ToString()), Convert.ToInt32(Session["GroupId"].ToString()));
                RadRotator1.DataBind();
            }
            else
            {
                Button bt = (Button)Page.FindControl("ButtonSubmitSurvey");
                LabelTest.Text = bt.Text;
            }
        }
  
        private List<Questions> CreateRotatorData(Int32 DealerId, int GroupId)
        {
            List<Questions> lq = new List<Questions>();
            using (OSWEB_GenericRemittanceEntities OSWEBe = new OSWEB_GenericRemittanceEntities())
            {
                var qg = (from l in OSWEBe.QuestionGroups where (l.GroupID == GroupId) && (l.DealerId == DealerId) select l.GroupID).FirstOrDefault();
                if (qg != null)
                {
                    var q = (from l in OSWEBe.GroupOfQuestions where (l.GroupID == GroupId) select l);
                    foreach (GroupOfQuestion goq in q)
                    {
                        Questions qs = new Questions();
                        qs.QuestionText = goq.Question.QuestionText;
                        qs.QuestionType = goq.Question.QuestionType;
                        qs.QuestionId = Convert.ToInt32(goq.QuestionID);
                        lq.Add(qs);
                    }
                    Questions qsEnd = new Questions();
                    qsEnd.QuestionType = "End";
                    lq.Add(qsEnd);
                }
            }
            return lq;
        }
          
    }
  
    public class RadRotatorTemplate : ITemplate
    {
  
        public RadRotatorTemplate() { }
  
        public void InstantiateIn(Control container)
        {
            HtmlGenericControl wrapper = new HtmlGenericControl("div");
            wrapper.DataBinding += new EventHandler(wrapper_DataBinding);
            container.Controls.Add(wrapper);
        }
  
        void wrapper_DataBinding(object sender, EventArgs e)
        {
            HtmlGenericControl wrapper = sender as HtmlGenericControl;
            RadRotatorItem item = wrapper.NamingContainer as RadRotatorItem;
            wrapper.InnerHtml = string.Format("<strong>{0}</strong>", ((Questions)item.DataItem).QuestionText);
            switch (((Questions)item.DataItem).QuestionType)
            {
                case "YesNo":
                    {
                        RadioButtonList rbl = new RadioButtonList();
                        rbl.ID = ((Questions)item.DataItem).QuestionId.ToString();
                        ListItem liYes = new ListItem();
                        liYes.Text = "Yes";
                        rbl.Items.Add(liYes);
                        ListItem liNo = new ListItem();
                        liNo.Text = "No";
                        rbl.Items.Add(liNo);
                        wrapper.Controls.Add(rbl);
                        break;
                    }
                case "Rate":
                    {
                        RadRating rr = new RadRating();
                        rr.ID = ((Questions)item.DataItem).QuestionId.ToString();
                        rr.ItemCount = 10;
                        wrapper.Controls.Add(rr);
                        break;
                    }
                case "Multi":
                    {
                        Int32 qId = ((Questions)item.DataItem).QuestionId;
                        RadioButtonList rbl = new RadioButtonList();
                        rbl.ID = ((Questions)item.DataItem).QuestionId.ToString();
                        using (OSWEB_GenericRemittanceEntities OSWEBe = new OSWEB_GenericRemittanceEntities())
                        {
                            var answers = (from a in OSWEBe.Answers where a.QuestionID == qId select a);
                            foreach (Answer a in answers)
                            {
                                ListItem li = new ListItem();
                                li.Text = a.AnswerText;
                                li.Value = a.AnswerID.ToString();
                                rbl.Items.Add(li);
                            }
                            wrapper.Controls.Add(rbl);
                        }
                        break;
                    }
                case "End":
                    {
                        Button bt = new Button();
                        bt.Text = "Submit Survey";
                        bt.ID = "ButtonSubmitSurvey";
                        bt.Click += new System.EventHandler(bt_Click);
                        wrapper.Controls.Add(bt);
                        break;
                    }
            }
        }
        private void bt_Click(object Sender, EventArgs e)
        {
              
        }
    }
}
Fiko
Telerik team
 answered on 11 Aug 2010
1 answer
159 views
I have a combobox in a table like this:

<table width="100%">
    <tr>
        <td width="40px">
            <telerik:RadComboBox ID="TitleArticle" runat="server" Width="40px">
                <Items>
                    <telerik:RadComboBoxItem runat="server" Text="A" Value="A" />
                    <telerik:RadComboBoxItem runat="server" Text="An" Value="An" />
                    <telerik:RadComboBoxItem runat="server" Text="The" Value="The" />
                </Items>
            </telerik:RadComboBox>
        </td>
        <td>
            <telerik:RadTextBox ID="ShortTitle" runat="server" Width="100%">
            </telerik:RadTextBox>
        </td>
    </tr>
</table>

Firefox gets it right, in Chrome the ComboBox is too wide, it's not listening to the width.  See the attachment.
Kalina
Telerik team
 answered on 11 Aug 2010
6 answers
153 views
Although the built-in skins include this control VSB neither allows it to be modified or includes it in the generated download.

As I'm trying to skin the RadEditor I really rather need this.

-- 
Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 11 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?