Telerik Forums
UI for ASP.NET AJAX Forum
25 answers
566 views
I'm evaluating your controls and need to be able to demonstrate a page that has multiple textboxs and a RadEditor control where all the spell checking is performed on all the controls when the page is submitted. It can be either client or server code but I need the standard dialogs for offering suggestions, replacing words, etc.

Can you point me to a specific example (I haven't seen one) that combines textboxes with the RadEditor? If not can you provide guidance on how to accomplish this? I have a very short timeframe to put together a working demo to show how the function works for the customer to review before we make a purchase decision.

Thanks.
Zack
Top achievements
Rank 1
 answered on 14 Oct 2010
1 answer
68 views
Hi,

On my RadGrid, I bind text value to a method in the code behind to translate from ID to Name. 

 

The main data is pulled from SQLDataSource and the translation that used in the methods are pulling from the XMLDataSource.  But when I try to export it's only show ID instead of the name field.
aspx
Text='<%# getProdName( DataBinder.Eval(Container.DataItem,"ProdID").ToString()) %>'

 

 

 

code behind
protected string getProdName(string ID)

 

{

 

string strProduct = string.Empty;

 

 

.......
return
strProduct;

 

}

 

Daniel
Telerik team
 answered on 14 Oct 2010
0 answers
89 views
I am using an xml datasource to populate the grid
and I was wondering if that could be the problem at all?  It is just for testing purposes, but I'd like to be able to demo the grid pages, etc.
 
In the RadGrid1_NeedDataSource() method,  I use

dt = info.GetData(); //dt is a DataTable.

 

RadGrid1.DataSource = dt; (where dt is a datatable created from an xml file.)

 
Grid aspx is here:
 
<div id="grid">
<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="true"
AutoGenerateColumns="False" AllowPaging="True"
OnNeedDataSource="RadGrid1_NeedDataSource" GridLines="None">

<MasterTableView AllowCustomSorting="true" DataKeyNames="BFNumber">
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
<Columns>
<telerik:GridBoundColumn SortExpression="Number" HeaderText="Number" DataField="Number" UniqueName="Number"></telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="Type" HeaderText="Type" DataField="Type" UniqueName="Type"></telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="Status" HeaderText="Status" DataField="Status"></telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="Description" HeaderText="Description" DataField="Description"></telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="CreatedDate" HeaderText="Created Date" DataField="CreatedDate"></telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="ClosedDate" HeaderText="Closed Date" DataField="ClosedDate"></telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="AssignedDate" HeaderText="Assigned Date" DataField="AssignedDate"></telerik:GridBoundColumn>
<telerik:GridBoundColumn SortExpression="AssignedTo" HeaderText="AssignedTo" DataField="AssignedTo"></telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<PagerStyle Mode="NumericPages" />
</telerik:RadGrid>
</div>
 
But no column ever gets sorted (the down arrow and up arrow gets displayed, so it is supposedly setup to sort), so I must have done something wrong.  I tried just creating a new telerik project, and used an MS Access database as the datasource, and sorting was working fine.  

 
Thanks.

 

 

Chris @ Intrinsic
Top achievements
Rank 1
 asked on 14 Oct 2010
2 answers
130 views

I’m new to RadScheduler and I have built a scheduler that several people update through the day and because someone else may have added an event to the schedule others will refresh their view often. The problem is that when you refresh the page the last event you added on that page gets duplicated every time you refresh the page until you move to another page. Is there a way to keep this from happening?

Thomas Kessler
Top achievements
Rank 1
 answered on 14 Oct 2010
3 answers
137 views
Does anyone have a full portal page demo with adding content from a catalog, customizable dock layouts, and database save allowing each user to create their own dashboard?

Thanks
Tom
Pero
Telerik team
 answered on 14 Oct 2010
2 answers
191 views
Greetings All,

I am trying to register some startup script during the update command of a radGrid that I have. Not sure why, but this isn't working for me.

Here is the radWindowManager markup...
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" IconUrl="../CSS/titlegraphic.gif">
</telerik:RadWindowManager>

Here is the scriptManager on the MasterPage..
<asp:ScriptManager ID="ScriptManager1" runat="server">
    <Scripts>
       <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
       <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
    </Scripts>
</asp:ScriptManager>

Here is the radGrid markup (contained in a radAjaxPanel)..
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
            <telerik:RadGrid runat="server" ID="ReportGrid" Width="936px" GridLines="Horizontal"
                                AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True" PageSize="10"
                                OnNeedDataSource="ReportGrid_NeedDataSource"
                                OnUpdateCommand="ReportGrid_UpdateCommand"
                                >
                <MasterTableView DataKeyNames="pa,report_close_id" AutoGenerateColumns="false" EditMode="InPlace" CommandItemDisplay="None">
                    <FilterItemStyle HorizontalAlign="Center" />
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderText="Edit" HeaderStyle-Width="66px" HeaderStyle-HorizontalAlign="Center" >                 
                            <ItemStyle Width="66px" HorizontalAlign="Center" />
                        </telerik:GridEditCommandColumn>
                        <telerik:GridBoundColumn DataField="report_close_id" HeaderText="Report Close ID" UniqueName="report_close_id" Visible="false" >
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="client_id" HeaderText="Client ID" UniqueName="client_id" Visible="false" >
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="client_name" HeaderText="Client Name" ReadOnly="true" UniqueName="client_name" Visible="true" HeaderStyle-Width="215px" >
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="pa" HeaderText="Performance Analyst" ReadOnly="true" UniqueName="pa" Visible="true" HeaderStyle-Width="165px" >
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn DataField="requested_date" HeaderText="Requested Completion By" UniqueName="requested_date"
                                                  HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="120px" >
                            <ItemStyle HorizontalAlign="Center" Width="120px" />
                            <ItemTemplate>
                                <asp:Label ID="lblRequestedDate" runat="server" Text='<%# Bind("requested_date", "{0:MM/dd/yyyy}") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadDatePicker ID="RequestedDatePicker" runat="server" Width="90px" DbSelectedDate='<%# Bind("requested_date", "{0:MM/dd/yyyy}") %>'>
                                </telerik:RadDatePicker>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="actual_date" HeaderText="Date Completed" UniqueName="actual_date"
                                                  HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="120px" >
                            <ItemStyle HorizontalAlign="Center" Width="120px" />
                            <ItemTemplate>
                                <asp:Label ID="lblCompletedDate" runat="server" Text='<%# Bind("actual_date", "{0:MM/dd/yyyy}") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadDatePicker ID="CompletedDatePicker" runat="server" Width="90px" DbSelectedDate='<%# Bind("actual_date", "{0:MM/dd/yyyy}") %>'>
                                </telerik:RadDatePicker>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn
                        <telerik:GridTemplateColumn DataField="comments" HeaderText="Comments" UniqueName="comments" 
                                                  HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="210px" ItemStyle-Width="210px" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:Label ID="lblComments" runat="server" Text='<%# Eval("comments") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadTextBox ID="txtComments" runat="server" MaxLength="500" Width="175px" Rows="3" Text='<%# Eval("comments") %>' TextMode="MultiLine">
                                </telerik:RadTextBox>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
            <br />
            <asp:Button ID="btnSave" runat="server" Text="Save" visible="false"/>
            <asp:Button ID="btnCancel" runat="server" Text="Cancel/Exit" OnClientClick="Close()" />
        </telerik:RadAjaxPanel>

Here is the updateCommand code.. The ScriptManager.RegisterStartupScript() call is near the end of the function.
protected void ReportGrid_UpdateCommand(object source, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.UpdateCommandName)
    {
        try
        {
        //Get the GridEditableItem of the RadGrid
        GridEditableItem editedItem = e.Item as GridEditableItem;
        int report_close_id = Convert.ToInt32(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["report_close_id"].ToString());
        ReportCloseDateBO updated_close = new ReportCloseDateBO();
        updated_close.FillByCloseDateID(report_close_id);
        DateTime actual_date_cell = new DateTime();
        DateTime requested_date_cell = new DateTime();
        DateTime updated_requested_completion_date = new DateTime(1855, 1, 1);
        DateTime updated_actual_completion_date = new DateTime(1855, 1, 1);
        string comments = ((editedItem["comments"].Controls[1] as RadTextBox).Text);
        ClientBO client = new ClientBO();
        client.FillClientByID(updated_close.client_id);
        bool pa_assigned = true;
        string pa_email = "";
        bool actual_completion_changed = false;
        bool requested_completion_changed = false;
        bool error_ind = false;
        PERAPositionBO peraPosition = new PERAPositionBO();
        if (!(editedItem["actual_date"].Controls[1] as RadDatePicker).IsEmpty)
        {
            actual_date_cell = ((editedItem["actual_date"].Controls[1] as RadDatePicker).SelectedDate.Value);
        }
        else 
        {
            actual_date_cell = new DateTime(1855, 1, 1);
        }
        if (!(editedItem["requested_date"].Controls[1] as RadDatePicker).IsEmpty )
        {
            requested_date_cell = ((editedItem["requested_date"].Controls[1] as RadDatePicker).SelectedDate.Value);
        }
        else
        {
            requested_date_cell = new DateTime(1855, 1, 1);
        }
        if (client.pa_user_id != -1)
        {
            ApplicationUserBO pa_user = new ApplicationUserBO();
            pa_user.FillByUserID(client.pa_user_id);
            pa_email = pa_user.e_mail;
        }
        else
        {
            pa_assigned = false;
        }
        //First check to see if the requested completion date has changed
        if (requested_date_cell != null)
        {
            //Check to see if the value has already been entered into the database
            updated_requested_completion_date = requested_date_cell;
            if (updated_close.requested_completion != updated_requested_completion_date)
            {
                requested_completion_changed = true;
            }
            else
            {
                requested_completion_changed = false;
            }
        }
        else
        {
            requested_completion_changed = false;
        }
        //Now check to see if a value has been entered into the actual completion date cell
        if (actual_date_cell != null)
        {
            //Check to see if the value has already been entered into the database
            updated_actual_completion_date = actual_date_cell;
            if (updated_close.actual_completion != updated_actual_completion_date)
            {
                actual_completion_changed = true;
            }
            else
            {
                actual_completion_changed = false;
            }
        }
        else
        {
            actual_completion_changed = false;
        }
        //Update the request date
        if (requested_completion_changed)
        {
            try
            {
                updated_close.UpdateRequestedReportCloseDate(report_close_id, updated_requested_completion_date, comments);
            }
            catch (Exception exe)
            {
                error_ind = true;
                //MessageBox.Show(exe.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //logger.RecordMessage(exe, Log.MessageType.Error, parent.UserID);
            }
        }
        //Update the actual completion date
        if (actual_completion_changed)
        {
            try
            {
                updated_close.UpdateActualReportCloseDate(report_close_id, updated_actual_completion_date, comments);
                updated_close = new ReportCloseDateBO();
                updated_close.FillByCloseDateID(report_close_id);
                //Now calculate the PERA position and put it in the pera position table.
                peraPosition = new PERAPositionBO();
                peraPosition.InsertPERAPosition(updated_close.client_id, updated_close.report_dated);
                //offer to notify the PA via email
                if (pa_assigned)
                {
                    int sendEmail = Convert.ToInt32(ConfigurationManager.AppSettings["SendEmail"]);
                    if (sendEmail == 1)
                    {
                        string userName = User.Identity.Name.ToString();
                        string[] tokens = userName.Split('\\');
                        ApplicationUserBO current_user = new ApplicationUserBO();
                        //current_user.FillByUserID(parent.UserID);
                        current_user.FillByUserID(7);
                        string body = tokens[1].ToString() + " has completed " + client.client_name + "'s PE report for " + updated_close.report_dated.ToShortDateString();
                        string subject = client.client_name + " PE Report Completed";
                        string to = current_user.e_mail.ToString();
                        string from = "PERA@haifc.com";
                        Session.Add("from", from);
                        Session.Add("to", to);
                        Session.Add("subject", subject);
                        Session.Add("body", body);
                        
                                 ScriptManager.RegisterStartupScript(this, this.GetType(), "mykey", "radconfirm('Would you like to notify " + client.client_name + "'s" + " PA?', confirmCallBackFn, 330, 100, null,'Send Message?');", true);
                        //RadAjaxManager1.ResponseScripts.Add("radconfirm('Would you like to notify " + client.client_name + "'s" + " PA?', confirmCallBackFn, 330, 100, null,'Send Message?');");
                          
                        //ClientScriptManager cs = Page.ClientScript;
                        //cs.RegisterClientScriptBlock(this.GetType(), "popupScript", RadWindowManager1.ClientID + ".radconfirm('Would you like to notify " + client.client_name + "'s" + " PA?', confirmCallBackFn, 330, 100, null,'Send Message?');", true);
                        //ClientScript.RegisterStartupScript(Page.GetType(), "popupScript", "radconfirm('Would you like to notify " + client.client_name + "'s" + " PA?', confirmCallBackFn, 330, 100, null,'Send Message?');", true);
                    }
                }
            }
            catch (Exception exe)
            {
                error_ind = true;
                //MessageBox.Show(exe.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //logger.RecordMessage(exe, Log.MessageType.Error, parent.UserID);
            }
           }
                             
        }
        catch (Exception ex)
        {
            ReportGrid.Controls.Add(new LiteralControl("Unable to update. Reason: " + ex.Message));
            //logger.RecordMessage(exe, Log.MessageType.Error, parent.UserID);
            e.Canceled = true;
        }
    }
}


The updateCommand works as I would expect, however there is no radconfirm following the update. Any help or thoughts would be most appreciated.

Regards,
Tom
Tom M
Top achievements
Rank 1
 answered on 14 Oct 2010
9 answers
285 views
Hi,

I'm trying to extend RadTab in order to create a tab with a close button. (looking somewhat like this http://demos.telerik.com/aspnet-ajax/tabstrip/examples/applicationscenarios/deletetabs/defaultcs.aspx)

My first attempts have not been very successful at all, and I hoped that you could point me in the right direction. I have looked around the forums but haven't found anything.

class ClosableRadTab : RadTab
{
    public ClosableRadTab()
    {
        this.Template = new ClosableRadTabTemplate(this);
    }
    private class ClosableRadTabTemplate : ITemplate
    {
        private RadTab _tab;

        public ClosableRadTabTemplate(RadTab tab)
        {            
            _tab = tab;
        }

        public void InstantiateIn(Control container)
        {
            Table table = new Table();           
            TableRow row = new TableRow();
            table.Rows.Add(row);
            TableCell cellLabel = new TableCell();
            row.Cells.Add(cellLabel);                       
            Label lbl = new Label() { Text = _tab.Text };
            cellLabel.Controls.Add(lbl);
            TableCell cellCloseButton = new TableCell();
            row.Cells.Add(cellCloseButton);
            ImageButton btnClose = new ImageButton()
            {
                SkinID = "btnDeleteSmall",
                CommandArgument = _tab.Value
            };
            //btnClose.Click += new EventHandler(btnCloseProject_Click);
            cellCloseButton.Controls.Add(btnClose);

            container.Controls.Clear();
            container.Controls.Add(table);
        }
    }
}

Thank you!
Veronica
Telerik team
 answered on 14 Oct 2010
3 answers
75 views
I'm using a RadGrid GridDropDownColumn which is connected to a SqlDataSource:

 

 

 

<telerik:GridDropDownColumn DataField="Status_ID" DataSourceID="SqlDataSource_WTGTasksStatus"
  
HeaderText="Status" ListTextField="Status_Text" ListValueField="Status_ID" UniqueName="Status_ID"
  
ColumnEditorID="StatusDropdownEditor">

 

 

Here is my Column Editor:

<telerik:GridDropDownListColumnEditor ID="StatusDropdownEditor" DropDownStyle-Width="75px" runat="server" />

This is my datasource:
<asp:SqlDataSource ID="SqlDataSource_WTGTasksStatus" runat="server" ConnectionString="<%$ ConnectionStrings:ParkAnalyticsConnectionString %>"
SelectCommand="SELECT [Status_ID], [Status_Text] FROM [WTGTasksStatus]">
</asp:SqlDataSource>

When I click on 'Add a Record' button, the dropdown does not populate with the records from the datasource, but if I click on the Refresh button while it is in Insert mode (showing textboxes and the empty dropdown), then the dropdown populates.

I've wasted a lot of time trying to make this work, so that the dropdown populates when the user clicks on the 'Add a Record' button, but I've not succeeded.

Can you please help me out with this?

I would really appreciate it.
Martin
Telerik team
 answered on 14 Oct 2010
1 answer
73 views
Hello,

Our project uses the GroupByExpressions collection to generate SQL when NeedDataSource is fired. I noticed that when a group is added to the grid by dragging it onto the group panel, the GroupByExpressions collection does not include a GridGroupByExpression for this new group when handling NeedDataSource. Checking the collection later, in PreRender, I see that the new GridGroupByExpression is included, but a rebind at that point does not seem to affect the grid.

The reverse operation of removing a group by dragging it away from the group panel seems to work as expected, i.e. the GroupByExpressions collection does not include the removed group.

Is there a setting or some workaround which will ensure that GroupByExpressions always contains the correct information after adding or removing a group? I don't really want to have to rebind in any case.

Telerik version is 2009.3.1314.35.

Thanks,
Daniel
Telerik team
 answered on 14 Oct 2010
4 answers
91 views
I'd like to use the scheduler without databinding by setting it up using Javascript. Is this possible?
Veronica
Telerik team
 answered on 14 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?