Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
102 views
Hi,

I have an .aspx page with a master page and two controls. One control (UserControl1) contains a  linkButton and the other control (UserControl2) contains a RadGrid. My goal is to update the radgrid of UserControl2 on click of the linkbutton of UserControl1. Now I have inserted this code in the aspx page

<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ctl00_ContentPlaceHolder_Center_CategorySearch1_LinkButton_AdvanceSearch">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ctl00_ContentPlaceHolder_Center_ViewCategories1_GridView_Report" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

The problem is that the code still does the postback. What shall i do to solve this problem. Do i use the RadAjaxManagerProxy?? if if then in which control shall i write it and how to get the the id of the other control(Button or grid).

One more questation how to get the clientId of the control. shall i use the javascript to get it???


Kevin
Top achievements
Rank 1
 answered on 29 May 2009
4 answers
108 views
Hi,

I find something, maybe you can help me. 

Il my Page_Load I put : 
RadGridFacturatio.MasterTableView.EditFormSettings.EditColumn.ButtonType = GridButtonColumnType.ImageButton;

In the aspx page I put : 
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGridFacturatio">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGridFacturatio" LoadingPanelID="RadAjaxLoadingPanel"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
       </AjaxSettings>
</telerik:RadAjaxManager>

And when I Insert or update I have this error : 
'Erreur d'exécution Microsoft JScript: Sys.WebForms.PageRequestManagerServerErrorException: Une erreur s'est produite, car un contrôle avec l'id 'ctl00$body$RadGridFacturation$ctl00$ctl02$ctl02$PerformInsertButton' n'a pas été trouvé ou un autre contrôle est assigné au même ID après la publication. Si l'ID n'est pas assigné, définissez explicitement la propriété ID des contrôles qui déclenchent les événements de publication pour éviter cette erreur.'
This, mean that there is 2 controls with the same ID.

But, when I put : 
<EditFormSettings>
     <EditColumn ButtonType="ImageButton"></EditColumn>
</EditFormSettings>

and comment : 
//RadGridFacturatio.MasterTableView.EditFormSettings.EditColumn.ButtonType = GridButtonColumnType.ImageButton;

It work very well !
Do you have an idea ?


Thank

Jean-Yves
Sebastian
Telerik team
 answered on 29 May 2009
1 answer
439 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
166 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
85 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
167 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
282 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
196 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
98 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
127 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?