Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
135 views
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0111: Type 'ASP.admissions_controls_inquirymanager_ascx' already defines a member called '__BuildControlradTimePicker' with the same parameter types

Source Error:

Line 5725:        
Line 5726:        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 5727: private global::Telerik.Web.UI.RadTimePicker @__BuildControlradTimePicker() {Line 5728:            global::Telerik.Web.UI.RadTimePicker @__ctrl;
Line 5729:            
Pavlina
Telerik team
 answered on 27 Apr 2009
1 answer
370 views
I hate it when an item in a form makes an ajax request and then I lose focus where I was at in the form. Here is the RadAjax solution I came up with to solve this problem. There's probably 100 solutions to this, but here's what I did.


In the Page_Load I check to see if there was an ajax request, and if there was, set the focus. "radAjaxManager" is the ID of my RadAjaxManager control.

//Maintain cursor position on ajax postback
var rad = RadScriptManager.GetCurrent(this.Page);
string ajaxTrigger = rad.AsyncPostBackSourceElementID;
Control c = rad.FindControl(ajaxTrigger);

if (c != null)
{
   if (!string.IsNullOrEmpty(ajaxTrigger) && !ajaxTrigger.Contains("radAjaxManager"))
   {
      radAjaxManager.FocusControl(c.ClientID);
   }
}


Iana Tsolova
Telerik team
 answered on 27 Apr 2009
1 answer
150 views
Ive followed some examples and I'm trying to bind at runtime but it wont work :(

I'm using an EntityDatasource by the way.
so its like at page_load

Radchart1.DataSource = EDS;
....
Radchart1.DataBind();
Dessy
Telerik team
 answered on 27 Apr 2009
1 answer
117 views
I try to do as following:

mychrt.Width = Unit.Point(507) 

this ends up in 507px in the Chart.
It seems not to be possible to set an Width in Point.
When I try:
System.Web.UI.WebControls.Unit.Point(507).ToString()
Then I get 507pt back.

How to set the Chartwidth in Point?

Regards,





Giuseppe
Telerik team
 answered on 27 Apr 2009
1 answer
151 views
Hello,

I have a grid the allows multi row editing

<telerik:RadGrid ID="entriesGrid" runat="server" 
        AllowPaging="True" AutoGenerateColumns="False" Skin="Gray" GridLines="Both" AllowMultiRowEdit="True" 
        ShowStatusBar="true" Font-Names="Arial"

The grid is working fine. The problem is that I would like to have a different background color / image for alternate rows.
In the HTML every row is rendered like this:

<TR id="ctl00_mainContentPlaceHolders_entriesGrid_ctl00__4" class="GridEditRow_Gray"

There is no altrow class. Is it because of the AllowMultiRowEdit?

How can I modify the grid to change the background for the alternate row in edit mode?

Thanks,

Oded
Shinu
Top achievements
Rank 2
 answered on 27 Apr 2009
3 answers
141 views
I have found buried away in the table accessibility options a textbox for specifying the number of header rows, can I set a default value for this so that it creates new tables with a header row as default?

Ideally what I'd like a table to default to is:
<table> 
  <thead> 
    <tr> 
      <th></th
      <th></th
      <th></th
      <th></th
    </tr> 
  </thead> 
  <tbody> 
    <tr> 
      <td></td
      <td></td
      <td></td
      <td></td
    </tr> 
      ..... 
    </tbody> 
</table> 

Cheers,
Nick
Rumen
Telerik team
 answered on 27 Apr 2009
1 answer
99 views

I have a heirachial grid that has several radcomboboxes. In the radcomboboxes I have found it now necessary to pass either a key from that heirachial grid, whereas I hadn't needed to before. I posted needed code

 

<telerik:RadGrid ID="rdgActivities" runat="server"  EnableViewState="true"

    AllowFilteringByColumn="True" Visible="True"
    DataSourceID="objGetLifeCycleActivties"

    Skin="Office2007"   
    GridLines="None">
    <PagerStyle Mode="NextPrevAndNumeric"  />
    <MasterTableView DataSourceID="objGetLifeCycleActivties" 
           DataKeyNames="LifeCycleActivityID,ProjectLifeCyclePhaseID"
           EditMode="EditForms" 
            CommandItemDisplay="Top" 
            CurrentResetPageIndexAction="SetPageIndexToFirst" Dir="LTR"
             TableLayout="Auto" >
             <DetailTables>
            
                    <telerik:GridTableView   DataKeyNames="LifeCycleTaskID" CommandItemDisplay="Top"
                        DataSourceID="objGetLifeCycleTasks" AllowFilteringByColumn="False" Width="100%" runat="server">
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="LifeCycleActivityID" MasterKeyField="LifeCycleActivityID" />
                        </ParentTableRelation>
                        <Columns>
                                                       
                                <telerik:GridBoundColumn DataField="LifeCycleActivityID" Visible="False"
                                 HeaderText="LifeCycleActivityID" SortExpression="LifeCycleActivityID"
                                    UniqueName="LifeCycleActivityID" ReadOnly="True">
                                </telerik:GridBoundColumn>   

 
                               <telerik:GridTemplateColumn UniqueName="TaskID"  Visible="False"
                                         DataField="TaskID" HeaderText="Task">
                                    <ItemTemplate></ItemTemplate>
                                    <EditItemTemplate>
                                    <telerik:RadComboBox ID="rdcTask" runat="server" Height="190px" 
                                        Skin="Office2007"
                                        Width="150px" MarkFirstMatch="true"
                                        HighlightTemplatedItems="true"
                                        ItemRequestTimeout="500"
                                        DataSourceID="objGetTasks" 
                                        SelectedValue='<%# Bind("TaskID")%>'
                                        AllowCustomText="False"
                                        DataTextField="TaskName" DataValueField="TaskID"   >
                                        <HeaderTemplate>
                                            <div style="width:100%; position:inherit; ">
                                                <span style="float:right; width: 100%;">Task</span>
                                            </div>
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                           <div style="position:inherit">
                                                <div style="width:100%;">
                                                    <span style="float:left; width:100%;"><%# DataBinder.Eval(Container.DataItem, "TaskName")%></span>
                                                </div>
                                           </div>   
                                        </ItemTemplate>
                                     </telerik:RadComboBox>

                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>

The object data source looks like this.

<asp:ObjectDataSource ID="objGetTasks" runat="server" 
    SelectMethod="GetTasksByLifeCycleActivityID" 
    TypeName="Hunt.LandDevelopment.Components.LDDController">
    <SelectParameters>
        <asp:SessionParameter Name="LifeCycleActivityID" SessionField="LifeCycleActivityID" Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>

So how can I reference the datakey parameter LifeCycleActivityID within the ObjectDataSource? In the heirchial grids I am able to reference the sessionparameter for that key and bind the sub grid using the sessionparameter in the select parameters of the child grid.

Thank you, Robin

Tsvetoslav
Telerik team
 answered on 27 Apr 2009
5 answers
389 views
Hello.

I'm having problems adding a custom validator to a textbox inside a Telerik component - I would like to validate the text box ComputernameInsert but I don't get any of the following in the drop-down list of ControlToValidate. What am I doing wrong?

<asp:CustomValidator runat="server" OnServerValidate="ServerValidation"  />

<telerik:RadDockZone ID="RadDockZoneComputerDetailsInsertMode" runat="server" Width="552px"
                        BorderStyle="None" MinHeight="" MinWidth="" Visible="False">
                        <telerik:RadDock ID="RadDockComputerDetailsInsertMode" runat="server"
                            Width="550px"
                            DefaultCommands="None" DockHandle="None" Left="" BorderStyle="None"
                                BorderWidth="0px" EnableTheming="True">
                            <ContentTemplate>
                                <asp:DetailsView ID="ComputerDetails_InsertMode" runat="server"
                                    AutoGenerateRows="False"
                                    DataSourceID="ComputerDetailsInsertDataSource" DefaultMode="Insert"
                                    HeaderText="Basis-Informationen:"
                                    Width="550px" DataKeyNames="ObjectTreeID"
                                    >
                                    <Fields>
                                        <asp:TemplateField HeaderText="Computername" SortExpression="Computername">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="ComputernameEdit" runat="server" Text='<%# Bind("Computername") %>'></asp:TextBox>
                                            </EditItemTemplate>
                                            <InsertItemTemplate>
                                                <asp:TextBox ID="ComputernameInsert" runat="server" MaxLength="15"
                                                    Text='<%# Bind("Computername") %>'></asp:TextBox>
                                            </InsertItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label3" runat="server" Text='<%# Bind("Computername") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
[...]

Thanks for any help.

B.M.

ManniAT
Top achievements
Rank 2
 answered on 27 Apr 2009
5 answers
172 views
I'm new to the Rad Editor tool and read that I should be able to add a new drop down menu to the editor via the ToolsFile.xml file. I'm able to successfully add a new drop down to the editor and populate it with the following code:

<tool name="NewsletterStyles" type="dropdown">
   <item  name="MainHeader" vaule="this is some test text" />
</tool> 

But when I select a value from the newly created dropdown I get the following error "Could not find the command NewsletterStyles please update your command list."

Unless I missed it I didn't see anything about updating the command list in the Telerik demo that I'm trying to follow (http://demos.telerik.com/aspnet-ajax/editor/examples/customdropdowns/defaultcs.aspx) and I'm not sure how to do this. Any help on this would be greatly appreciated.

Thanks
Todd
Tervel
Telerik team
 answered on 27 Apr 2009
1 answer
107 views
I have a grid with many columns in it.  I made several columns 'ReadOnly' and 'Display='false''.  When I accesss one of those columns in code behind it then shows up when the grid is refreshed, though with no real data, just this: "System.Data.DataRowView"

Here is the code that matters:
<telerik:GridTemplateColumn UniqueName="SetPrice" Display="false" HeaderText="SetPrice" HeaderStyle-Width="0px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ReadOnly="false">  
                        <ItemTemplate> 
                            <asp:Label ID="lblSetPrice" runat="server" Text='<%# Eval("SetPrice") %>'></asp:Label> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 

AND:
        private void SetTotalAmount()  
        {  
            double total = 0;  
            foreach (GridDataItem item in grdContractItems.Items)  
            {  
                Label lblMetalValue = (Label)item.FindControl("lblExPrice"as Label;  
                Label lblLabor = (Label)item.FindControl("lblExPrice"as Label;  
                Label lblPrice = (Label)item.FindControl("lblExPrice"as Label;  
                Label lblExPrice = (Label)item.FindControl("lblExPrice"as Label;  
                Label lblSetPrice = (Label)item.FindControl("lblSetPrice"as Label;  
                if (lblSetPrice.Text != "0")  
                {  
                    lblMetalValue.Text = lblLabor.Text = lblPrice.Text = "";  
                    lblExPrice.Text = lblSetPrice.Text;  
                }  
                if (lblExPrice != null && lblExPrice.Text.Trim() != string.Empty)  
                {  
                    total += double.Parse(lblExPrice.Text);  
                }  
            }  
            lblTotalAmount.Text = GetDollar(total.ToString());  
        } 
Pavel
Telerik team
 answered on 27 Apr 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?