Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
115 views
I have a menu that has background images.  The menu is the appropriate width (lining up with other items within the div container) when zoom is set to 100% in IE, Chrome and Firefox.  However, when I zoom in the width varies in relation to the other items on the page.  Sometimes the overall width is narrower than it should be.  Other times it is wider than the container, which causes it to wrap.

Any insight into what the cause might be would be greatly appreciated!

Thank you,
--Larry--
Ivan Zhekov
Telerik team
 answered on 31 Jan 2013
1 answer
211 views
I have a RadTabStrip + RadMultiPageView + RadPageView + RadWindow on mainpage.aspx

RadPageView  I am utilizing contenturl='contentpage.aspx'

I am wanting to do the following call on contentpage.aspx

var w = radopen('dialogpage.aspx', null);

w.maximize();

w.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close);


But this only sets it to full screen within the bounds of RadPageView.

I cant do
var w = parent.radopen('dialogpage.aspx', null);

w.maximize();

w.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close);


as I loose the ability to send requests back to the opening page utilizing:
function GetRadWindow()
{
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz as well)
return oWindow;
};
function CloseAndRebind()
{
GetRadWindow().Close();
GetRadWindow().BrowserWindow.UpdateFromPopup('information being passed back');
};

UpdateFromPopup would be called on mainpage.aspx instead of contentpage.aspx
any ideas on how to get the radwindow to maximize??
Marin Bratanov
Telerik team
 answered on 31 Jan 2013
1 answer
119 views
Hello,

While working with the TreeList Drag and Drop example, I've noticed that there doesn't appear to be a way to drag child nodes to the top-most level. Given that it is possible to drag root nodes beneath their peers to create child nodes, and since this functionality can be seen in the TreeView Drag and Drop example, I would expect that the control also supports the aforementioned scenario.

So, is there a property or setting that I must set to enable this behavior on the TreeList, or if the implementation is more complex, may I request an example showing how to achieve this?

UPDATE: I've managed to implement this functionality using a custom "ItemDrop" event handler. I'm still interested in identifying a simpler solution though.
Andrey
Telerik team
 answered on 31 Jan 2013
3 answers
96 views
Why have none of the latest webinars been posted online?
Most of us are not able to attend the webinars live due to time differences.

Are those of us who do not live in the US now no longer allowed to watch them?
Rumen
Telerik team
 answered on 31 Jan 2013
1 answer
160 views
Hi ,

I am strange issue in particular page.
I am using client side binding using following tag
        <DataBinding Location="~/ReportManagement/ReportDesigner.aspx" SelectMethod="wmBindSecurity" />
After page load 10 records display properly, but in pagination bar page number is missing ,and also it is written 0 items in 0 pages.
and page size changing works perfectly.


On change of next or prev request is not going to server side.

Please help me .
I am using following code.

ASPX
<telerik:RadGrid ID="rgSecurity" runat="server" AllowPaging="true" AllowMultiRowSelection="True"
                           GridLines="None" AllowSorting="true" Width="99%">
                           <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />
                           <ItemStyle Wrap="false" />
                           <HeaderStyle Wrap="false" />
                           <ClientSettings EnableRowHoverStyle="true" AllowColumnsReorder="true" AllowColumnHide="true"
                               Resizing-AllowColumnResize="true" Resizing-EnableRealTimeResize="true" ReorderColumnsOnClient="true">
                               <Resizing ResizeGridOnColumnResize="true" ClipCellContentOnResize="false" />
                               <DataBinding Location="~/ReportManagement/ReportDesigner.aspx" SelectMethod="wmBindSecurity" />
                               <Selecting AllowRowSelect="true" />
                               <ClientEvents OnRowSelected="RowSelected" OnRowDeselected="RowSelected" OnDataBindingFailed="rgSecurity_OnDataBindingFailed">
                               </ClientEvents>
                           </ClientSettings>
                           <MasterTableView AutoGenerateColumns="false" AllowNaturalSort="false" ClientDataKeyNames="Id"
                               CommandItemDisplay="Top">
                               <CommandItemTemplate>
                                   <telerik:RadToolBar ID="rtbSecurity" runat="server" Height="26px" Width="100%" ClientIDMode="Static"
                                       OnClientButtonClicking="rtbSecurity_onToolBarClientButtonClicking">
                                       <Items>
                                           <telerik:RadToolBarButton Text="Add" ImageUrl="~/Images/NewEnable2.png" runat="server"
                                               ClientIDMode="Static" Value="Add" CommandName="Add" CssClass="RadToolBar">
                                           </telerik:RadToolBarButton>
                                           <telerik:RadToolBarButton Text="Remove" ImageUrl="~/Images/imgDelBtnEnable.png" runat="server"
                                               ClientIDMode="Static" Value="Delete" CommandName="Delete" CssClass="RadToolBar"
                                               Enabled="false">
                                           </telerik:RadToolBarButton>
                                       </Items>
                                   </telerik:RadToolBar>
                               </CommandItemTemplate>
                               <Columns>
                                   <telerik:GridClientSelectColumn UniqueName="column" HeaderStyle-Width="35px" ItemStyle-Width="35px"
                                       Resizable="false">
                                   </telerik:GridClientSelectColumn>
                                   <telerik:GridTemplateColumn UniqueName="Name" HeaderText="Name" SortExpression="Name"
                                       ShowSortIcon="true" ItemStyle-Wrap="false">
                                       <ClientItemTemplate>
                                           <label id="aName_#=Id#" border="0"  #=Type == 0 ? "style='background: url(../Images/usersetting.png) top left no-repeat !important;padding-left:18px'" :  "style='background: url(../Images/user-groups.png) top left no-repeat !important;padding-left:18px'"#>#=Name#</label>
                                       </ClientItemTemplate>
                                       <ItemStyle Wrap="false" />
                                       <HeaderStyle Wrap="false" />
                                   </telerik:GridTemplateColumn>
                                   <telerik:GridTemplateColumn UniqueName="AllowRead" HeaderText="Read" SortExpression="AllowRead"
                                       ShowSortIcon="true" HeaderStyle-Width="10%" ItemStyle-Width="10%">
                                       <ClientItemTemplate>
                                           <input type="checkbox" id="chk_read_#=Id#" #=AllowRead == true ? "checked" : "" # #=AllowWrite == true ? "disabled" : "" # onclick="javascript:OnChangeSecurity('#=Id#','#=Type#')"/>
                                       </ClientItemTemplate>
                                   </telerik:GridTemplateColumn>
                                   <telerik:GridTemplateColumn UniqueName="AllowWrite" HeaderText="Write" SortExpression="AllowWrite"
                                       ShowSortIcon="true" HeaderStyle-Width="15%" ItemStyle-Width="15%">
                                       <ClientItemTemplate>
                                             <input type="checkbox" id="chk_write_#=Id#" #=AllowWrite == true ? "checked" : "" # onclick="javascript:OnChangeSecurity('#=Id#','#=Type#')"/>
                                       </ClientItemTemplate>
                                   </telerik:GridTemplateColumn>
                               </Columns>
                           </MasterTableView>
                       </telerik:RadGrid>


JS

function RowSelected(rowObject, args) {

            if (args != null)
                gridEventArg = args;

            var length = $find(rgSecurity_id).get_selectedItems().length;
            var radGrid = $get(rgSecurity_id);
            var radToolBar = $telerik.findControl(radGrid, "rtbSecurity");
            var addButton = radToolBar.get_items().getItem(0);
            var removeButton = radToolBar.get_items().getItem(1);
            switch (parseInt(length)) {
                case 0:
                    addButton.set_enabled(true);
                    removeButton.set_enabled(false);
                    break;
                case 1:
                    addButton.set_enabled(false);
                    removeButton.set_enabled(true);
                    break;
                default:
                    addButton.set_enabled(false);
                    removeButton.set_enabled(true);
                    break;
            }
        }
[WebMethod]
       public static Dictionary<string, object> wmBindSecurity(int startRowIndex, int maximumRows, List<GridSortExpression> sortExpression, List<GridFilterExpression> filterExpression)
       {
           if (HttpContext.Current.Session["UserName"] == null)
               throw new Exception("SESSION_TIMEOUT");
 
           Dictionary<string, object> data = new Dictionary<string, object>();
 
           if (HttpContext.Current.Session["AnalystFile"] == null)
               throw new Exception("SESSION_TIMEOUT");
 
           List<SQCUser> allUsers = SQCUserList.GetUserList();
 
           List<SQCUserGroup> allGroups = SQCUserGroupList.GetGroupList();
 
           List<SQCUserGroupResourceMapping> lstUserGroupResourceMapping = ((SQWAnalystFile)HttpContext.Current.Session["AnalystFile"]).UserGroupReportMapping;
 
           List<SQCUserResourceMapping> lstUserResourceMapping = ((SQWAnalystFile)HttpContext.Current.Session["AnalystFile"]).UserReportMapping;
 
           List<SQCUser> oUsers = SQCUserList.GetUserList();
 
           var oData = lstUserGroupResourceMapping.Select(o => new
           {
               Id = o.GroupId,
               Name = allGroups.Find(g => g.GroupId == o.GroupId).GroupName,
               Type = "User Group",
               AllowRead = o.AllowRead,
               AllowWrite = o.AllowWrite
           }).ToList();
 
           oData.AddRange(lstUserResourceMapping.Select(p => new
           {
               Id = p.UserId,
               Name = SQCUserList.GetUserByUserID(p.UserId).UserName,
               Type = "User",
               AllowRead = p.AllowRead,
               AllowWrite = p.AllowWrite
           }).ToList());
 
           if (oData.Count > 0)
                data.Add("Data", oData.Skip(startRowIndex).Take(maximumRows));              
           else
               data.Add("Data", new List<SQCUserGroupResourceMapping>());
           data.Add("Count", 0);
           return data;
 
       }

Thanks & Regards ,
Somnath 
Antonio Stoilkov
Telerik team
 answered on 31 Jan 2013
1 answer
197 views
Hi,

How can I make  RadDatePicker's default date to today's date when it opens? My RadDatePicker is one of the column in the radgrid, when I do filter, I like to open the RadDatePicker with today's date highlighted.

Thanks,
Sigma
Shinu
Top achievements
Rank 2
 answered on 31 Jan 2013
1 answer
362 views
Hi,

I have a RadDatePicker in the EditItemTemplate of RadGRid. How to make the datepicker readonly in edit mode?

<EditItemTemplate>
   <telerik:RadDatePicker ID="RadDatePicker1" runat="server" ></telerik:RadDatePicker>
</EditItemTemplate>

Thanks,
Sigma
Shinu
Top achievements
Rank 2
 answered on 31 Jan 2013
1 answer
88 views
Data Access Layer
//Getter and setter method
public string Url
{
    get { return _url; }
    set { _url = value; }
}
public string TargetAudience
{
    get { return _targetAudience; }
    set { _targetAudience = value; }
}
public string Image
{
    get { return _image; }
    set { _image = value; }
}
public string OnMouseOverText
{
    get { return _onMouseOverText; }
    set { _onMouseOverText = value; }
}
public int AdvertisementID
{
    get { return _advertisementID; }
    set { _advertisementID = value; }
}
public int Location
{
    get { return _location; }
    set { _location = value; }
}
//Constructor
 public AdvertisementDAL(){}
 public AdvertisementDAL(int advertisementID, int location,string image,
    string targetAudience,string url, string onMouseOverText)
{
    _advertisementID = advertisementID;
    _location = location;
    _image = image;
    _targetAudience = targetAudience;
    _url = url;
    _onMouseOverText = onMouseOverText;
}
         
public int updateNoOfClick(DateTime now, int ID)
        {
            string sql = "Select NoOfClick From AdvertisementRecord " +
                "Where RecordDate = @recordDate AND FK_AdvertisementID = @aID";
            SqlConnection conn = new SqlConnection(_connStr);
            SqlCommand cmd = new SqlCommand(sql, conn);
            cmd.Parameters.AddWithValue("@recordDate", now);
            cmd.Parameters.AddWithValue("@aID", ID);
            conn.Open();
            int noOfClick = int.Parse(cmd.ExecuteScalar().ToString());
            noOfClick++;
            conn.Close();
            string sql1 = "Update AdvertisementRecord SET NoOfClick = @Click "
            + "WHERE RecordDate = @Date AND FK_ADvertisementID = @aID";
 
            //SqlConnection conn = new SqlConnection(_connStr);
            SqlCommand cmd1 = new SqlCommand(sql1, conn);
            cmd1.Parameters.AddWithValue("@Click", noOfClick);
            cmd1.Parameters.AddWithValue("@aID", ID);
            cmd1.Parameters.AddWithValue("@Date", now);
            conn.Open();
            int row = 0;
            row = cmd1.ExecuteNonQuery();
            conn.Close();
            return row;
        }
        public AdvertisementDAL selectAdvertisementLocation1(DateTime now, string gender)
        {
            AdvertisementDAL dal = null;
            string sql = "Select * From Advertisement Where @currentDate between StartDate AND EndDate AND TargetAudience = @gender AND Location = 1";
            SqlConnection conn = new SqlConnection(_connStr);
            SqlCommand cmd = new SqlCommand(sql, conn);
            cmd.Parameters.AddWithValue("@currentDate", now);
            cmd.Parameters.AddWithValue("@gender", gender);
            conn.Open();
            SqlDataReader dr = cmd.ExecuteReader();
 
            while (dr.Read())
            {
                _advertisementID = int.Parse(dr["AdvertisementID"].ToString());
                _location = int.Parse(dr["Location"].ToString());
                _image = dr["Image"].ToString();
                _targetAudience = dr["TargetAudience"].ToString();
                _url = dr["Url"].ToString();
                _onMouseOverText = dr["OnMouseOverText"].ToString();
                dal = new AdvertisementDAL(_advertisementID, _location, _image, _targetAudience,
                    _url, _onMouseOverText);
            }
            conn.Close();
            dr.Close();
            dr.Dispose();
            return dal;
        }
 
This is my business Logic Layer
public AdvertisementDAL selectAdLocation1(DateTime now, string gender)
        {
            AdvertisementDAL dal = new AdvertisementDAL();
            return dal.selectAdvertisementLocation1(now, gender);
        }
        public void InsertOrUpdateupdateNoOfClick(DateTime now, int aID)
        {
            AdvertisementDAL dal = new AdvertisementDAL();
            int existDate = dal.checkRecordDateIsExist(now, aID);
            if (existDate == 0)
            {
                dal.insertAdvertisementRecord(now, aID);
            }
            else if (existDate > 0)
            {
                dal.updateNoOfClick(now, aID);
            }
        }


Presentation Layer.
                        <telerik:RadRotator ID="RadRotator1" runat="server">
                            <ItemTemplate>
                                <asp:ImageButton ID="ImageButton1" runat="server" 
    Height="224px" Width="102px" />
                            </ItemTemplate>
                        </telerik:RadRotator>


I have a radrotator with a image button control. I wanted the rad rotator look similar like this 
http://demos.telerik.com/aspnet-ajax/rotator/examples/bannerrotation/defaultcs.aspx
They will load a lot of advertisement images.  
when a user click on the specific advertisement, 
they will update the specific advertisement the no of click.  
The problem is how do I do it in aspx.cs? at page_load

Marin Bratanov
Telerik team
 answered on 31 Jan 2013
4 answers
229 views
Hi,

i use RadTab with Metro skin. RadTab shows starting letter in lower case.
How can i change starting letter lower case to upper case?

For Example: - product detail
i want to show:- Product Detail

Thanks In Advance ....
Madhu Palakurthi
Top achievements
Rank 1
 answered on 31 Jan 2013
1 answer
141 views
Hello.
I have a problem. I'm trying to achive one thing ( as I wrote in a title ), but what I have is hard to get rid of.
Data source is gotten from a database as a list via linq. I set up groupin by expression tags
<GroupByExpressions>
    <telerik:GridGroupByExpression>
        <SelectFields>
            <telerik:GridGroupByField FieldAlias="Gmina" FieldName="NazwaOrganuProwadzacego"
                FormatString="{0:D}" />
        </SelectFields>
        <GroupByFields>
            <telerik:GridGroupByField FieldName="NazwaOrganuProwadzacego" SortOrder="Ascending" />
        </GroupByFields>
    </telerik:GridGroupByExpression>
    <telerik:GridGroupByExpression>
        <SelectFields>
            <telerik:GridGroupByField FieldAlias="Nazwa Placówki" FieldName="NazwaPlacowki" FormatString="{0:D}" />
        </SelectFields>
        <GroupByFields>
            <telerik:GridGroupByField FieldName="NazwaPlacowki" SortOrder="Ascending" />
        </GroupByFields>
    </telerik:GridGroupByExpression>
</GroupByExpressions>
And it is groupped but it's too much for me.
I made a picture of a simple table that represents of how it looks like ( "is.png" ), and how I want it to look like ( "want.png" ).

Thanks in advance for every kind of help.
Maciej.
Maciej
Top achievements
Rank 1
 answered on 31 Jan 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?