Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
868 views
Team,

Kindly tell me the RadGrid Events Firing order...

for ex:

1) Radgrid_Prerender
2) Radgrid_ItemCommand

etc.,
Shinu
Top achievements
Rank 2
 answered on 15 Oct 2010
2 answers
67 views
Hello, guys.
I forward result of search to RadGridView.
At column, which points field of find I would like mark(color,bold) a portion of the text(search string).
How can I do this.


Thanks, Andrew
Andrew
Top achievements
Rank 1
 answered on 15 Oct 2010
2 answers
192 views
Help me to create multiple column filtering on a single click
I have 5 columns in a table. I want to filter this table according to first 3 columns. Display concatinated string of first tree columns in a seperate radcombobox. Combobox should have "ALL" default option. when user select ALL, show up all items in radgridview. when user type a letter, combobox should show up first three colum items. When postback rad grid should filter according to the selected three columns. filter the grid with first three column on a single click. Anybody can help me to complete this task.
Ben
Top achievements
Rank 1
 answered on 15 Oct 2010
3 answers
117 views
Hi Folks,

I've spent a bit of time trawling through the web looking for a solution for this problem. I can achieve my goals when the grid is bound server side, but I need the grid to be bound client side.

I am able to bind it client side alright, that isnt the problem , the problem is that when I'm using declarative  GroupByExpressions I get the error   Field xxxxx not found  in the source table, please check expression syntax. 

I understand why I'm getting this, the grid is getting rendered prior to the client databinding firing. and the dataset for the grid doesn't exist at this point.

I've tried using the client GroupColumn   method when binding the grid but no joy. 

has anyone managed to use grouping with client side binding, if so, can you please give me a pointer as to how to do it 

thanks 

Mark
mark
Top achievements
Rank 1
 answered on 15 Oct 2010
25 answers
607 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
83 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
110 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
145 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
165 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
229 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?