Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
435 views
I would like to ask, is it possible for your telerik calendar to adopt the language of a user?

I have a page that a user can change the language to German.

The German calendar starts on Monday

and its caption of the day are in German

Is their a way to change you calendars defaults caption of the day and months..

If its possible please show me

Thanks in advance
Shinu
Top achievements
Rank 2
 answered on 29 May 2009
1 answer
165 views
Could someone please help with a slightly confusing matter?

I am creating a RadGrid programatically. When the OnClick event of a button on the same form fires, I call my own Method that loops through the .Items collection and tries to find the values stored in controls that reside in columns in the grid. These controls are added to the grid programatically as per the documentation using my own class (implementing ITemplate for the ItemTemplate property of the columns.

Initially I could not find the controls using the FindControl method. After a little investigation I found that if I define my grid programatically in either the Page_Init method or the Init method of the RadPageView that the grid is in - then I can access the controls using the FindControls method. 

However..... as the two methods above get called very frequently before the OnClick event of my button gets fired, the columns are added everytime either Init method runs. If I include a RadGrid.Columns.Count check or RadGrid.MasterTableView.Columns.Count check, the value is always 0.

Any ideas?

Thanks in advance.



EDIT: Code Samples...

Here is the template class I have;

 

public class TextBoxTemplate : ITemplate  
    {  
        protected RadNumericTextBox textBox;  
 
        public void InstantiateIn(System.Web.UI.Control container)  
        {  
            textBox = new RadNumericTextBox();  
            textBox.ID = "txtTest";  
            textBox.Skin = "Telerik";  
            textBox.Width = Unit.Pixel(100);  
            container.Controls.Add(textBox);  
        }  
    } 

Here is how I define the gris programatically;

protected void DefineGrid();  
{  
    grdData.MasterTableView.Columns.Clear();    
    grdData.Height = Unit.Pixel(300);  
    grdData.Width = Unit.Percentage(100);  
    grdData.AutoGenerateColumns = false;  
    grdData.AllowMultiRowSelection = false;  
    grdData.AllowPaging = false;  
    grdData.ClientSettings.Scrolling.AllowScroll = true;  
    grdData.MasterTableView.DataKeyNames = new string[] { "ID" };  
 
    GridTemplateColumn templateColumn = new GridTemplateColumn();  
    templateColumn.ItemTemplate = new TextBoxTemplate();  
    templateColumn.UniqueName = templateColumn.HeaderText = "Some Text Here";  
    grdData.MasterTableView.Columns.Add(templateColumn);  

Here is where the grid is defined in order to keep the required number of columns;

protected void rpv4_Init(object sender, EventArgs e)  
{  
   DefineGrid();  

These are the lines of code called in the OnClick event that will bind the data;

DefineGrid();  
grdData.DataSource = DataStoredInSessionVariable;  
grdData.DataBind();  
 
Sebastian
Telerik team
 answered on 29 May 2009
1 answer
74 views
This is a bug I experience only in IE 7, firefox works fine. When I select an image in the editor and click the 'Set Image Properties' button the dialogue fails to show and the cursor jumps to the end of the html

<div><img title="testImage" alt="testImage" src="/images/testImage.png" border="0" /></div

another problem is when I try to make a selected image a link, the dialogue appears but the image is de-selected and the link is inserted as a text link at the start of the page when I click ok

any help would be great

thanks


Rumen
Telerik team
 answered on 29 May 2009
2 answers
159 views
Hi,

I have table in Database with fields: id, title, text, position.

Every record in table it is RadDock control.

I need on load page add RadDock Control in RadZone with position from database.
I can add RadDock in RadZone, but position RadDock is not position from database.

How I can make it?

my aspx file:
<telerik:RadDockLayout ID="RadDockLayout1" runat="server" OnLoadDockLayout="RadDockLayout1_LoadDockLayout" 
            OnSaveDockLayout="RadDockLayout1_SaveDockLayout" Skin="Vista"
            <div style="float:left;"
                <telerik:RadDockZone ID="rdZone" runat="server" Height="100%" Skin="Vista" Width="500px"
                </telerik:RadDockZone> 
            </div> 
</telerik:RadDockLayout> 

my cs file:
protected void Page_Init(object sender, EventArgs e)  
    {  
        if (!IsPostBack)  
        {  
            //data - this is DataSet; da - this is DataAdapter  
            da.Fill(data);  
  
            for (int i = 0; i < data.Rows.Count; i++)  
            {  
                RadDock dock = CreateRadDock(data[i].Title, data[i].Text, data[i].Id, data[i].Position-1);  
  
                    rdZone.Controls.Add(dock);  
                    ScriptManager.RegisterStartupScript(  
                        dock,  
                        this.GetType(),  
                        "AddDock",  
                        string.Format(@"function _addDock() {{  
                            Sys.Application.remove_load(_addDock);  
                            $find('{1}').dock($find('{0}'));  
                            $find('{0}').doPostBack('DockPositionChanged');  
                            }};  
                            Sys.Application.add_load(_addDock);", dock.ClientID, rdZone.ClientID),  
                        true);  
        }  
        else  
        for (int i = 0; i < CurrentDockStates.Count; i++)  
        {  
            RadDock dock = CreateRadDockFromState(CurrentDockStates[i]);  
            RadDockLayout1.Controls.Add(dock);  
        }  
    }  
 
private List<DockState> CurrentDockStates 
    { 
        get 
        { 
            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; 
        } 
    } 
 
    private RadDock CreateRadDockFromState(DockState state) 
    { 
        RadDock dock = new RadDock(); 
        dock.ID = string.Format("RadDock{0}", state.UniqueName); 
        dock.DefaultCommands = Telerik.Web.UI.Dock.DefaultCommands.ExpandCollapse; 
        dock.Style.Add("padding-bottom", "10px"); 
        dock.ApplyState(state); 
 
        return dock; 
    } 
 
    private RadDock CreateRadDock(string title, string text, int id, int position) 
    { 
        int docksCount = CurrentDockStates.Count; 
 
        RadDock dock = new RadDock(); 
        dock.UniqueName = Guid.NewGuid().ToString(); 
        dock.ID = string.Format("RadDock{0}", dock.UniqueName); 
        dock.Title = title
        dock.Text = text
        dock.Skin = "Vista"
        dock.Style.Add("padding-bottom", "10px"); 
        dock.Collapsed = true
        dock.DefaultCommands = Telerik.Web.UI.Dock.DefaultCommands.ExpandCollapse; 
        dock.Attributes.Add("id", id.ToString()); 
 
        return dock; 
    } 
 
    protected void RadDockLayout1_LoadDockLayout(object sender, DockLayoutEventArgs e) 
    { 
        foreach (DockState state in CurrentDockStates) 
        { 
            e.Positions[state.UniqueName] = state.DockZoneID; 
            e.Indices[state.UniqueName] = state.Index; 
        } 
    } 
    protected void RadDockLayout1_SaveDockLayout(object sender, DockLayoutEventArgs e) 
    { 
        CurrentDockStates = RadDockLayout1.GetRegisteredDocksState(); 
    } 

Thanks!!!!!!!


tieu
Top achievements
Rank 1
 answered on 29 May 2009
3 answers
272 views
I can't get my GridNumericColumn to filter when the data is a percentage.  I can get the data formatted so that it shows as a percentage but the filtering doesn't work.  When I filter the results are always GreaterThan the value I am trying to filter on.

<telerik:GridNumericColumn DataField="Completionhours" NumericType="Percent" DataType="System.Double" CurrentFilterFunction="GreaterThan"   UniqueName="Completionhours" HeaderText="Completion Rate" />
                               

Tsvetoslav
Telerik team
 answered on 29 May 2009
1 answer
187 views

Hi Telerik Support,
I am having problems databinding to a grid inside a sliding pane.
Here is the scenerio:
    I am error checking a dynamically created form for errors, and I write the errors to a datatable.
    On Button clicked event  (code behind)
    We clear the DataTable and add the errors found to the datatable 
    then we re-bind to the grid.
    After the rebind, In debug I check the items count and it is at 7.
     I don't see the rows after the rebind, in the sliding pane.  When I pull the grid out of the sliding pane I see all the rows I would expect (count = 7)
Please help! An example on how to fix this would be greatly appreciated.

Thanks
Julie
Tsvetie
Telerik team
 answered on 29 May 2009
2 answers
89 views
Hi Telerik Support,
I am having problems databinding to a grid inside a sliding pane. 
Here is the scenerio:
    I am error checking a dynamically created form for errors, and I write the errors to a datatable.

    private

 

DataTable ErrorDataTable = new DataTable();

 

    

ErrorDataTable.Clear();

 

//-- Add columns to the data table

 

ErrorDataTable.Columns.Add(

"TemplateLineID", typeof(int));

 

ErrorDataTable.Columns.Add(

"TemplateControlID", typeof(int));

 

ErrorDataTable.Columns.Add(

"ParentControlID", typeof(int));

 

ErrorDataTable.Columns.Add(

"ToggledControlID", typeof(int));

 

ErrorDataTable.Columns.Add(

"Section", typeof(string));

 

ErrorDataTable.Columns.Add(

"Page", typeof(string));

 

ErrorDataTable.Columns.Add(

"ErrorMsg", typeof(string));

 

 

 

// Now Test the binding

 

 

ErrorDataTable.Rows.Add(-1, -1, -1, -1,

"", "", "No Errors Found");

 


gridErrors2.DataSource = ErrorDataTable;

gridErrors2.DataBind();


**********
Button clicked event
We clear the ErrorDataTable and add more rows
then we bind to gridErrors2 as above...
I am not getting any data, gridErrors outside of the sliding pane returns the rows as expected.


//The ASPX...

<

 

telerik:RadSlidingPane ID="ErrorSlidingPane" runat="server"

 

 

iconurl="Images/Toolbar/AttachBtn.gif" tabview="ImageOnly" title="Errors" width="460px">

 

 

<telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server">

 

 

<asp:Panel ID="Panel2" runat="server" Height="200px" style="OVERFLOW: auto"

 

 

Width="440px">

 

 

 

<telerik:RadGrid ID="gridErrors2" runat="server" AutoGenerateColumns="False"

 

 

ClientSettings-Selecting-AllowRowSelect="true" CssClass="gridText"

 

 

Skin="Vista" Width="420px">

 

 

<headercontextmenu enabletheming="True">

 

 

<collapseanimation duration="200" type="OutQuint" />

 

 

</headercontextmenu>

 

 

 

<MasterTableView ClientDataKeyNames="TemplateLineID,TemplateControlID,Page">

 

 

<RowIndicatorColumn>

 

 

<HeaderStyle Width="20px" />

 

 

</RowIndicatorColumn>

 

 

<ExpandCollapseColumn>

 

 

<HeaderStyle Width="20px" />

 

 

</ExpandCollapseColumn>

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="TemplateLineID" HeaderText="Node ID"

 

 

ReadOnly="true" UniqueName="TemplateLineID" Visible="False">

 

 

<HeaderStyle Width="50px" />

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="TemplateControlID" HeaderText="Control ID"

 

 

ReadOnly="true" UniqueName="TemplateControlID" Visible="False">

 

 

<HeaderStyle Width="50px" />

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="ParentControlID" HeaderText="Parent Control ID"

 

 

ReadOnly="true" UniqueName="ParentControlID" Visible="False">

 

 

<HeaderStyle Width="50px" />

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="ToggledControlID" HeaderText="Toggled Control ID"

 

 

ReadOnly="true" UniqueName="ToggledControlID" Visible="False">

 

 

<HeaderStyle Width="50px" />

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Section" HeaderText="Section"

 

 

ReadOnly="true" UniqueName="Section" Visible="True">

 

 

<HeaderStyle Width="70px" />

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="Page" HeaderText="Page"

 

 

ReadOnly="true" UniqueName="Page" Visible="True">

 

 

<HeaderStyle Width="50px" />

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="ErrorMsg" HeaderText="Please Correct the Following Errors" ItemStyle-CssClass="gridTextRequired"

 

 

ReadOnly="True" UniqueName="ErrorMsg" HeaderStyle-ForeColor="Red">

 

 

<HeaderStyle Width="220px" />

 

 

<ItemStyle CssClass="gridTextRequired" />

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Select" HeaderText="Select" ItemStyle-CssClass="gridTextRequired" Text="Go To Page"

 

 

UniqueName="column">

 

 

</telerik:GridButtonColumn>

 

 

 

</Columns>

 

 

</mastertableview>

 

 

<clientsettings enablepostbackonrowclick="True">

 

 

<selecting allowrowselect="True" />

 

 

 

 

</clientsettings>

 

 

<filtermenu enabletheming="True">

 

 

<collapseanimation duration="200" type="OutQuint" />

 

 

</filtermenu>

 

 

</telerik:RadGrid>

 

 

</asp:Panel>

 

 

</telerik:RadAjaxPanel>

 

 

 

</telerik:RadSlidingPane>

 

    I have two exact same grids one in the sliding pane and one outside of the sliding pane.  
    I bind both grids to the same data source
    The data source is populated when the users clicks a toolbar button labeled check errors.
    The one not located in the pane displays the data
    The other located in the pane does not display the data.

Any help would be appreciated
Thanks in advance
~Julie
I am currently on the version released before April 2, we are too close for release to change out the controls and update with the new ones. 
Tsvetie
Telerik team
 answered on 29 May 2009
2 answers
121 views
Hello,

You can easily calculate an aggregate for a column by setting the Aggregate-property of a Grid-Column to something like Max, Min or Avg.
What if I want more than 1 aggregate (like Min ánd Max) for the same column ?

Can I do that also with the property-settings or do I have to do that programmatically (in the ItemDataBound-event ?) ?

Gr,
Walter
Walter
Top achievements
Rank 1
 answered on 29 May 2009
1 answer
118 views
I used WebBlue skin for RadGrid for asp.net ajax, how to modify the existing skin (WebBlue) , can u give me the sample coding.

thanks






Pavlina
Telerik team
 answered on 29 May 2009
1 answer
77 views
I have an instance where a Radgrid is being ajaxified via a RadAjaxManager.  The problem we're having is related to the user trying to interact with the grid when an ajax request is being performed and the user clicks on something else.  For example, the grid does not have paging enabled and has maybe 50 rows.  If the user clicks edit for a row and the ajax request begins (loading panel displays), using IE, the user can click edit for another row before the first request completed.  Whent they do this, an http exception occurs (see below).

In Firefox, you can't interact with the grid during an ajax request and this isn't a problem.  It's only when the user is using IE.  Any help to prevent this in IE would be greatly appreciated!

Here's the exception...

System.Web.HttpException: Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.


Pavlina
Telerik team
 answered on 29 May 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?