Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
46 views
Hello

I observed different behavior of the editor depending of the navigator.

Under Firefox: start a Numbered list
1) item1
2) item2
3) item3

Put the cursor before 'item 2' and click on the Bullet option => the 2)  is replaced by a bullet and the list is re-numbered
  1. item1
  • item 2
  1. item 3

==>It is OK

Do the same with internet Explorer, the bullet is placed before the numbered list and the numbered list is indented.
It is not OK



Rumen
Telerik team
 answered on 25 Nov 2010
2 answers
166 views
hello ,

i am trying to create dynamic grid listing setting page. User will configre their report and grid options. and u ser can set grid column order and header text using dock.

1- but i have problem about that because i am creating docking dynamicly, and creating TitlebarTempalte dynamicly and creating ContentTempalte dynamicly, but when user fill the content , i cant reach docks content over the server button.

2- In demos, they show us keep dock state infos Using Session. But i need use ViewState. Not Session.When I change Session to ViewState .net error serialaziton problem.


Thats my code :

 

private RadDock CreateRadDock(String columnName)

 

{

 

RadDock dock = new RadDock();

 

dock.DockMode =

DockMode.Docked;

 

dock.EnableViewState =

true;

 

dock.EnableAnimation =

true;

 

dock.UniqueName =

Guid.NewGuid().ToString().Replace("-", "a");

 

dock.ID =

string.Format("RadDock{0}", dock.UniqueName);

 

dock.Title = columnName;

dock.Text = columnName;

dock.Width = System.Web.UI.WebControls.

Unit.Percentage(100);

 

dock.EnableRoundedCorners =

true;

 

dock.ExpandText =

"Settings";

 

 

dock.Commands.Add(

new DockCloseCommand());

 

System.Web.UI.WebControls.

Image mg = new System.Web.UI.WebControls.Image();

 

mg.Style.Add(

"float", "left");

 

mg.ImageUrl =

"~/Image/information.png";

 

mg.ID =

"mg" + dock.ID;

 

dock.TitlebarTemplate = new TitleBarTemplate(dock.Text);

 

dock.TitlebarContainer.Controls[0].FindControl(

"PanelForTitle").Controls.Add(mg);

 

 

 

 

 

dock.ContentTemplate =

new ContentTemplate(dock.Text);

 

 

return

 

dock;

 

}


 

public

 

class ContentTemplate : ITemplate

 

 

 

 

{

 

 

Panel pContainer = new Panel();

 

 

Panel pControls = new Panel();

 

 

CheckBox chkIsHidden = new CheckBox();

 

 

String columnName = String.Empty;

 

 

public ContentTemplate(String columnName)

 

{

 

this.columnName = columnName;

 

}

 

 

public void InstantiateIn(Control container)

 

{

 

Table tbl = new Table();

 

 

TableRow row = null;

 

 

TableCell cell = null;

 

 

 

// NEW ROW FOR HEADER TEXT

 

 

 

 

 

// ROW 1 (HEADER TEXT)

 

 

 

 

 

//LABEL

 

 

 

 

row =

new TableRow();

 

cell =

new TableCell();

 

 

Label lblText = new Label();

 

lblText.ID =

"lblTitle";

 

lblText.CssClass =

"rdcontent";

 

lblText.Text =

"Kolon Bal : ";

 

cell.Controls.Add(lblText);

row.Controls.Add(cell);

 

// TEXTBOX

 

 

 

 

cell =

new TableCell();

 

 

TextBox tb = new TextBox();

 

tb.Text =

this.columnName;

 

tb.ID =

"txtHeader";

 

tb.AutoPostBack =

true;

 

tb.MaxLength = 100;

tb.Width =

new System.Web.UI.WebControls.Unit(200);

 

cell.Controls.Add(tb);

row.Controls.Add(cell);

tbl.Controls.Add(row);

 

// ROW 2 (HIDDEN STATUS)

 

 

 

 

row =

new TableRow();

 

 

//LABEL

 

 

 

 

cell =

new TableCell();

 

lblText =

new Label();

 

lblText.ID =

"lblHidden";

 

lblText.CssClass =

"rdcontent";

 

lblText.Text =

"Gizli Kolon ";

 

cell.Controls.Add(lblText);

row.Controls.Add(cell);

 

//CHECKBOX

 

 

 

 

cell =

new TableCell();

 

 

CheckBox chkIsHidden = new CheckBox();

 

chkIsHidden.ID =

"cbIsHidden";

 

chkIsHidden.Checked =

false;

 

cell.Controls.Add(chkIsHidden);

row.Controls.Add(cell);

tbl.Controls.Add(row);

 

// ROW 3 (FILTER)

 

 

 

 

row =

new TableRow();

 

 

//LABEL

 

 

 

 

cell =

new TableCell();

 

lblText =

new Label();

 

lblText.ID =

"lblFilter";

 

lblText.CssClass =

"rdcontent";

 

lblText.Text =

"Filtreye Dahil Et ";

 

cell.Controls.Add(lblText);

row.Controls.Add(cell);

 

//CHECKBOX

 

 

 

 

cell =

new TableCell();

 

 

CheckBox chkIsFilter = new CheckBox();

 

chkIsFilter.ID =

"cbIsFilter";

 

chkIsFilter.Checked =

false;

 

cell.Controls.Add(chkIsFilter);

row.Controls.Add(cell);

tbl.Controls.Add(row);

pControls.ID =

"PanelForContent";

 

pControls.Controls.Add(tbl);

container.Controls.Add(pControls);

}

}




 

public class TitleBarTemplate : ITemplate

 

{

 

Label lblText = new Label();

 

 

Panel pContainer = new Panel();

 

 

Panel pControls = new Panel();

 

 

String columnName = String.Empty;

 

 

 

public TitleBarTemplate(String columnName)

 

{

 

this.columnName = columnName;

 

}

 

public void InstantiateIn(Control container)

 

{

 

Literal l;

 

lblText.ID =

"lblTitleText";

 

lblText.Text =

this.columnName;

 

pControls.ID =

"PanelForTitle";

 

l =

new Literal();

 

l.Text =

"<table style='float: left;'><tr><td class='rdcontent'>";

 

pContainer.Controls.Add(l);

pContainer.Controls.Add(lblText);

l =

new Literal();

 

l.Text =

"</td><td>";

 

pContainer.Controls.Add(l);

pContainer.Controls.Add(pControls);

l =

new Literal();

 

l.Text =

"</td></tr></table>";

 

pContainer.Controls.Add(l);

container.Controls.Add(pContainer);

}

}



after that i raise on page_int to keep dock states :

 

protected void Page_Init(object sender, EventArgs e)

 

{

 

//// check source is changing

 

 

////Recreate the docks in order to ensure their proper operation

 

 

 

for (int i = 0; i < CurrentDockStates.Count; i++)

 

{

 

RadDock dock = CreateRadDockFromState(CurrentDockStates[i]);

 

 

//We will just add the RadDock control to the RadDockLayout.

 

 

// You could use any other control for that purpose, just ensure

 

 

// that it is inside the RadDockLayout control.

 

 

// The RadDockLayout control will automatically move the RadDock

 

 

// controls to their corresponding zone in the LoadDockLayout

 

 

// event (see below).

 

RadDockLayout1.Controls.Add(dock);

 

//We want to save the dock state every time a dock is moved.

 

CreateSaveStateTrigger(dock);

}

}



 

private void CreateSaveStateTrigger(RadDock dock)

 

{

 

//Ensure that the RadDock control will initiate postback

 

 

// when its position changes on the client or any of the commands is clicked.

 

 

//Using the trigger we will "ajaxify" that postback. by mr@h

 

 

//dock.AutoPostBack = true;

 

 

//dock.CommandsAutoPostBack = true;

 

 

AsyncPostBackTrigger saveStateTrigger = new AsyncPostBackTrigger();

 

saveStateTrigger.ControlID = dock.ID;

saveStateTrigger.EventName =

"DockPositionChanged";

 

UpdatePanel1.Triggers.Add(saveStateTrigger);

saveStateTrigger =

new AsyncPostBackTrigger();

 

saveStateTrigger.ControlID = dock.ID;

saveStateTrigger.EventName =

"Command";

 

UpdatePanel1.Triggers.Add(saveStateTrigger);

 

 

}



 

private RadDock CreateRadDockFromState(DockState state)

 

{

 

RadDock dock = new RadDock();

 

dock.DockMode =

DockMode.Docked;

 

dock.ID =

string.Format("RadDock{0}", state.UniqueName);

 

dock.ApplyState(state);

System.Web.UI.WebControls.

Image mg = new System.Web.UI.WebControls.Image();

 

mg.Style.Add(

"float", "left");

 

mg.ImageUrl =

"~/Image/information.png";

 

mg.ID =

"mg" + dock.ID;

 

 

//dock.Commands.Add(new DockExpandCollapseCommand());

 

 

 

return dock;

 

}



..


well, you can see textboxes and check boxes in the dock content template. there is a button in the page,and i need all text box and check values inside docks for create xml setting file by using c#

and i dont need the keep state infos into session. i want ViewState.


 

private List<DockState> CurrentDockStates

 

{

 

get

 

{

 

//Store the info about the added docks in the session. For real life

 

 

// applications we recommend using database or other storage medium

 

 

// for persisting this information.

 

 

List<DockState> _currentDockStates = (List<DockState>)Session["CurrentDockStatesDynamicDocks"];

 

 

if (Object.Equals(_currentDockStates, null))

 

{

_currentDockStates =

new List<DockState>();

 

Session[

"CurrentDockStatesDynamicDocks"] = _currentDockStates;

 

}

 

return _currentDockStates;

 

}

 

set

 

{

Session[

"CurrentDockStatesDynamicDocks"] = value;

 

}

}



pls help me. thanks

Pero
Telerik team
 answered on 25 Nov 2010
1 answer
105 views

Hi,

I need to retrive ComboBox id which was in RadGrid EditItemTemplate.

Here is my code:

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
   {
       if (e.Item is GridEditFormItem && e.Item.IsInEditMode)// if EditMode is EditForm or PopUp
       {
           GridEditFormItem editItem = (GridEditFormItem)e.Item;
           RadComboBox ddlCity = editItem.FindControl("gvddlPOWCity") as RadComboBox;
           string city = ddlCity.SelectedValue;
           . . . . . . . .
       }
   }


I am set the property in MasterTable view as below:

<MasterTableView DataKeyNames="POWId" EditMode="EditForms">

Eventhough I am getting e.Item.IsInEditMode is always false.

Is there any more modifications need to perform.Please tell me...

Thanks...

Pavlina
Telerik team
 answered on 25 Nov 2010
1 answer
75 views

Hi All,

I'm using Telerik's RadScheduler Control with WebService Binding.

Originally I used RadScheduler with Server Side Binding which has an event called "OnTimeSlotCreated" which fires every time when a particular time slot is created so that i can access the time slot and get the control (HtmlTableCell Control) to modify it according to the requirement.

But now i'm binding it from client side through WebService which has no such "onClientTimeSlotCreated" event, also these time slots are not having any identity at client side to access.

Is there any one who has encountered such kind of issue and solved or can someone give some suggestions?

Thanks in advance...

Veronica
Telerik team
 answered on 25 Nov 2010
1 answer
86 views
RadGrid: 2010.2.929.40

Originally, I was very excited to upgrade to a new Windows 7 system running VS2010 and Q2 2010 rad controls.  I switched from my XP system running VS2005 and Q3 2008 rad controls.

The excitement was very short-lived.  Even on a more powerful system, that runs great with other programs, VS2010 is very sluggish.  Of course, my first attempt at using the new version was to create an ASP.NET page with a combo box, a radgrid and ajax manager.  Selecting an item in the combo forces a databind on the grid.  Other than the sluggish response, that all worked fine. 

The real problems began when I tried to structure the elements on the page, by placing the grid and a couple of other rad cotrolss in table cells.  WHAT A BIG, FAT PAIN IN THE #^$##!!!!!
When I resize the grid to be smaller than the width of the columns, you can see the columns extending beyond the width of the grid.  I resolved this the way I had been told to with the old product.  By adding style='overflow:hidden' to the grid.  This hides it, but it is still there if you try to click in an adjacent table cell where it was overlowing.  This didn't happen with the old version of rad controls.

If I have this many problems just structuring the layout, FORGET IT!!! I'll go back to VS2005.

I've attached a screenshot.


Thanks,

Tim
Marin
Telerik team
 answered on 25 Nov 2010
3 answers
128 views
Hi I have a toolbar work just fine in an aspx page.  I want to do the same on a user control.  So I copied and pasted my radtoolbar to a user control but for some reason, the bar only stretches up to the last button.  I tried style="width:100%" and Width="100%", none worked.  I tried to read the Telerik CSS article but not very helpful in my situation.  Can someone please tell me why it's doing that? 

My line of code in user control:
<telerik:RadToolBar ID="RadToolBar1" runat="server" Skin="Vista" style="display:block; float:none" Width="100%">     
        <Items>      
             <telerik:RadToolBarButton runat="server" ImageUrl="~/Style/Images/alarm1.gif"  CommandName="cmd1" /> 
             <telerik:RadToolBarButton runat="server" ImageUrl="~/Style/Images/alarm2.gif"  CommandName="cmd2"/>   
        </Items>     
    </telerik:RadToolBar> 
Yana
Telerik team
 answered on 25 Nov 2010
1 answer
115 views
Hi All,

I have used telerik RadGrid control and my problem is that the paging items are overlapping when I use the screen resolutions 1024x768. Is there any way to wrap the RadGrid paging in 2 lines when the screen resolution is 1024x768?

Please find the attachment for the screen shot of the RadGrid Paging section. The overlapping is pointed with the arrow.

Please let me know if anyone know the solution for this problem.

Veli
Telerik team
 answered on 25 Nov 2010
4 answers
72 views
Hi, I am getting the following error in my code:

Microsoft JScript runtime error: Sys.InvalidOperationException: Could not find UpdatePanel with ID 'RadListView1_ctrl0_Panel1Panel'. If it is being updated dynamically then it must be inside another UpdatePanel.

Here is the exact code to reproduce it:(press any of the buttons on the pages causes the error)

<%@ Page Theme="TSC" Language="C#" AutoEventWireup="true" CodeFile="Test2.aspx.cs" Inherits="rq2DN_Test2" %>
  
   
    <!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 id="Head1" runat="server">
        <title>Test</title>
    </head>
    <body>
    <form id="form1" runat="server">
     
  
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
     
  
    <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" />
  
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" >
    </telerik:RadAjaxLoadingPanel>
  
    <asp:HiddenField ID="hfCatalogueId" runat="server" />
    <asp:HiddenField ID="hfTemporary" runat="server" />
  
    <asp:Panel ID="ListViewPanel" runat="server">
        <telerik:RadListView ID="RadListView1" runat="server" DataKeyNames="StockNumber" DataSourceID="objCatalogue"
            onitemcreated="RadListView1_ItemCreated">
            <LayoutTemplate>
                <div class="RadListView RadListView_Default">
                    <div id="itemPlaceholder" runat="server">
                    </div>
                </div>
            </LayoutTemplate>
            <ItemTemplate>
                <table>
                    <tr>
                        <td>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("StockNumber") %>'></asp:Label>
                        </td>
                        <td rowspan="2" valign="top">
                            <asp:Panel ID="Panel1" runat="server">
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("StockNumber") %>'></asp:Label>
                                <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
                            </asp:Panel>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("StockNumber") %>'></asp:Label>
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
        </telerik:RadListView>
    </asp:Panel>
  
    <asp:ObjectDataSource ID="objCatalogue" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="getCatalogueWithShoppingInfo" TypeName="com.srb.rq2.CatalogueDAO"
        EnablePaging="True" SelectCountMethod="getRowCount">
        <SelectParameters>
            <asp:ControlParameter ControlID="hfCatalogueId" PropertyName="Value" Name="catalogueId" Type="Int32"/>
            <asp:ControlParameter ControlID="hfTemporary" PropertyName="Value" Name="searchText" Type="String"/>
        </SelectParameters>
    </asp:ObjectDataSource>
  
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"></telerik:RadAjaxManager>
  
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    </telerik:RadAjaxManagerProxy>
  
    </form>
</body>
</html>

and here is the code-behind:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Threading;
using Telerik.Web.UI;
using com.srb.rq2;
using com.srb.core.util;
  
public partial class rq2DN_Test2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
  
  
        if (!IsPostBack)
        {
            hfCatalogueId.Value = "18";
            hfTemporary.Value = "";
        }
    }
  
    protected void Button1_Click(object sender, EventArgs e)
    {
        Thread.Sleep(2000);
    }
    protected void RadListView1_ItemCreated(object sender, Telerik.Web.UI.RadListViewItemEventArgs e)
    {
        if (e.Item is RadListViewDataItem)
        {
            RadListViewDataItem item = (RadListViewDataItem)e.Item;
            Button button = (Button)e.Item.FindControl("Button1");
            Panel panel = (Panel)e.Item.FindControl("Panel1");
  
  
  
            RadAjaxManagerProxy1.AjaxSettings.AddAjaxSetting(button, panel, RadAjaxLoadingPanel1);
        }
    }
}
Radoslav
Telerik team
 answered on 25 Nov 2010
1 answer
145 views
(Working in VS 2010, C# 4.0, RadControls for ASP.NET AJAX 2010.2.929.40, Sql Server 2008)
When I have the following radgrid :
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
        AllowSorting="True" GridLines="None" OnNeedDataSource="RadGrid1_NeedDataSource"
        AutoGenerateColumns="true" AutoGenerateEditColumn="true">
</telerik:RadGrid>

and this in my code behind :

protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    LinqDataSource ds = new LinqDataSource();
    ds.Selecting += (sd, evt) => evt.Result = new UserManager().GetAllUsers();
    RadGrid1.DataSource = ds;
}
3 queries are generated :
SELECT COUNT(*) AS [value]
FROM [dbo].[Portal_Users] AS [t0]
  
SELECT [t1].[Id], [t1].[FirstName], [t1].[LastName], [t1].[Email], [t1].[LastLogin], [t1].[Created]
FROM (
    SELECT ROW_NUMBER() OVER (ORDER BY [t0].[Id], [t0].[FirstName], [t0].[LastName], [t0].[Email], [t0].[LastLogin], [t0].[Created]) AS [ROW_NUMBER], [t0].[Id], [t0].[FirstName], [t0].[LastName], [t0].[Email], [t0].[LastLogin], [t0].[Created]
    FROM [dbo].[Portal_Users] AS [t0]
    ) AS [t1]
WHERE [t1].[ROW_NUMBER] BETWEEN @p0 + 1 AND @p0 + @p1
ORDER BY [t1].[ROW_NUMBER]
  
SELECT [t0].[Id], [t0].[FirstName], [t0].[LastName], [t0].[Email], [t0].[LastLogin], [t0].[Created]
FROM [dbo].[Portal_Users] AS [t0]

The first 2 queries are as expected but the 3rd one queries the whole users table. As this gives horrible performance with a large dataset I started digging around. Then I discovered that this :

<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
    AllowSorting="True" GridLines="None" DataSourceID="linqDS"
    AutoGenerateColumns="true" AutoGenerateEditColumn="true">
</telerik:RadGrid>
<asp:LinqDataSource ID="linqDS" OnSelecting="selecting" runat="server" />
and this in my codebehind :
protected void selecting(object sender, LinqDataSourceSelectEventArgs e)
{
    e.Result = new UserManager().GetAllUsers();
}
only gives the first 2 queries of the aforementioned 3 which solves my problem.

However, I don't know why in the first case I get 3 queries instead of 2. I would expect only the 2 queries in both cases. More worrying, I can imagine forgetting (me or my colleagues) that I must declare the LinqDataSource in the aspx page and not in my codebehind and so end up querying the whole table.
Veli
Telerik team
 answered on 25 Nov 2010
1 answer
53 views
Hi!

I am using a user control to edit the values within a grid using

.MasterTableView.EditFormSettings.UserControlName =



Within the user control there is a table that is used to format the display and I want this table to be 100% of the width of the grid.  Is there a way to access the width of the grid from within the user control so that it can be set in codebehind.

Tsvetina
Telerik team
 answered on 25 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?