Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
184 views
I am developing from the demo you provided here: http://demos.telerik.com/aspnet-ajax/calendar/examples/datepicker/shareddatepicker/defaultcs.aspx?product=grid

In the OnItemCommand event handler I am looping through all the fields that have been changed and save or delete them when the "Update4 All" button is clicked. The problem is when the user clicks the "Add new Record" button. In the UI, the row appears and the user can add new values for each column. But when they click "Update All" this new row is not in the RadGrid1.Items collection. I would like to add this while I am updating and deleting the other rows. Is there a way to do this?

protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e) 
    if (e.CommandName == "UpdateChanges"
    { 
        ArrayList editedItems = new ArrayList(); 
        foreach (GridDataItem item in RadGrid1.Items) 
        { 
            if ((item is GridEditableItem) && (item.IsInEditMode)) 
            { 
                Hashtable ht = new Hashtable(); 
 
 
                //add in delete flag 
                ht["ShouldDelete"] = false
                if (item.Selected) 
                { 
                    ht["ShouldDelete"] = true
                } 
                //add in read only columns 
                ht["ServerID"] = (item.EditManager.GetColumnEditor("ServerID"as GridTextBoxColumnEditor).TextBoxControl.Text; 
 
                if (item.Selected || presenter.ValuesChanged((string)ht["ServerID"])) 
                { 
                    item.ExtractValues(ht); 
 
                    //add in any template columns 
                    ht["OrderDate"] = ((TextBox)(item.EditManager.GetColumnEditor("OrderDate"as GridTemplateColumnEditor).ContainerControl.FindControl("TextBox1")).Text; 
 
                    editedItems.Add(ht); 
                } 
            } 
        } 
 
        if (editedItems.Count > 0) 
        { 
            presenter.UpdateAll(editedItems); 
            XmlDataSource1.Save(); 
            RadGrid1.Rebind(); 
            notificationDisplayMsg.NotificationType = Trizetto.Web.UI.Controls.NotificationType.Information; 
            notificationDisplayMsg.Text = "All changes have been saved."
        } 
    } 



Sebastian
Telerik team
 answered on 29 Jul 2009
1 answer
273 views

Hi,

I'm trying to design a master page with a RadMenu to navigate the user to the appropriate url without a full page refresh. All the pages share the same masterpage and need to find a way to have a loading panel display in the ContentPlaceHolder while only the ContentPlaceHolder refreshes.

Here is the code:

MASTER PAGE

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="DefaultTest.master.cs" Inherits="_Default" %>

<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

<

 

html>

 

 

<

 

head id="Head1" runat="server">

 

 

 

<title>Default</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

 

 

 

<link rel="Stylesheet" type="text/css" href="CSS/styleExternal.css" />

 

 </

 

head>

 

 <

 

body>

 

<form runat="server">

 


<
telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableTheming="True">

 

</telerik:RadScriptManager>

 


<
telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

<AjaxSettings>

 

<telerik:AjaxSetting AjaxControlID="ContentArea">

 

<UpdatedControls>

 

<telerik:AjaxUpdatedControl ControlID="ContentArea" LoadingPanelID="RadAjaxLoadingPanel1" />

 

</UpdatedControls>

 

</telerik:AjaxSetting>

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager> 

<
telerik:RadMenu ID="rmMain" runat="server" Skin="Default">

 

 

 

<Items>

 

<telerik:RadMenuItem runat="server" NavigateUrl="~/DefaultTest.aspx" TabIndex="1"  Text="Dashboard">

 

 

</telerik:RadMenuItem>

 

<telerik:RadMenuItem runat="server" NavigateUrl="~/DefaultTest2.aspx" TabIndex="2"  Text="School Information">

 

 

</telerik:RadMenuItem>

 

</Items>

 

</telerik:RadMenu>

<

 

asp:ContentPlaceHolder ID="ContentArea" runat="server">

 

</asp:ContentPlaceHolder>

<

 

telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">

 

 

 

<table style="height: 100%; width: 100%" border="0">

 

 

 

<tr>

 

<td width="100%" align="center" valign="middle">

 

 

<asp:Image ID="Image1" runat="server" ImageUrl="~/Images/Loading/loading.gif"></asp:Image>

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</telerik:RadAjaxLoadingPanel>

</
form>

 

</

 

body>

 

</

 

html>

Thanks so much for your help.

Evan

 

 

 

 

 

 

 

 

Arun
Top achievements
Rank 1
 answered on 29 Jul 2009
1 answer
111 views
Hi,

Pls Guide me on how to get the selected Row index from server side.
I have tried the following and did not get the right answer.

protected

 

void SimpleGrid_SelectedIndexChanged(object sender, EventArgs e)

 

{

Response.Write(SimpleGrid.SelectedItems[0].RowIndex);
}

Jidesh

Shinu
Top achievements
Rank 2
 answered on 29 Jul 2009
0 answers
136 views
protected void RadMenu1_ItemClick(object sender, Telerik.Web.UI.RadMenuEventArgs e)  
    {  
        if (e.Item.AccessKey.ToString() == "1")  
        {  
            Control control = LoadControl("home.ascx");  
            control.ID = control.ToString();  
            ContentPlaceHolder1.Controls.Clear();  
            ContentPlaceHolder1.Controls.Add(control);  
        }  
        else 
        {  
            Control control = LoadControl("abt.ascx");  
            control.ID = control.ToString();  
            ContentPlaceHolder1.Controls.Clear();  
            ContentPlaceHolder1.Controls.Add(control);  
        }  
    } 


The above code works fine. And the refresh is eliminated using RadAjaxManager, but for further development process we need do do the above function in client side. I dnt hve an idea whether its is possible, or is there any better method that can be followed to do this in client side.

Thanks in Advance.
Arun.M

Arun
Top achievements
Rank 1
 asked on 29 Jul 2009
1 answer
128 views
I am trying to remove all nodes in server side but it is not working. Anyone have a sample code?

My code is like this

foreach

 

(RadTreeNode node in mytreeView.GetAllNodes())

 

{

    node.Remove();

}


Thanks




Shinu
Top achievements
Rank 2
 answered on 29 Jul 2009
1 answer
96 views
Hi

Is it possible to have a master table grid whereby the master grid is bound declaratively by a data source and then the detail table is bound programmatically? I cannot get this to work.

thanks
Shinu
Top achievements
Rank 2
 answered on 29 Jul 2009
3 answers
264 views
Hi Team,
I am using the version 2008.3.1125.35
this is the code i use to export 
                grid.Rebind();
                grid.ExportSettings.IgnorePaging = true;
                grid.ExportSettings.FileName = "Name";
                grid.ExportSettings.ExportOnlyData = true;
                grid.MasterTableView.ExportToExcel();
it exports the data in .xls format by default... i have excel 2007 installed in my machine
it also gives the warning messages as below

The file you are trying to open, <pagename>.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?"

is there anything i can ovoid the format realted warning message? and also .xlsx file is very lighter than the .xls so we want to use the lighter version.

or is there any simple c# code i can write each row to excel file for telerik grid.

Thanks
-krishna

Saranya
Top achievements
Rank 2
 answered on 29 Jul 2009
2 answers
101 views
Hi,

I started using telerik scheduler by downloading trial version - 2008.3.1314.35. In this we will have time picker which allows us to select time from a list - like 9:00 am, 8:30 pm so on. Then I used telerik licenced version - 2008.1.619.35. This has manually entering start time and end time column. Is there any way that I could get automatic time picker in this version?

Thanks
Saranya
Saranya
Top achievements
Rank 2
 answered on 29 Jul 2009
1 answer
178 views
My client wants to be able to click on a part number to begin editing the record.  He also wants to be able to filter on the PartNumber field.

When I attempt to filter on the following column, I get the error "The query syntax is not valid., near keyword 'LIKE', line 6, column 6." (Using Entity Framework.

How do I get a LinkButton and filtering to work together?

Here's the code:

                    <telerik:GridTemplateColumn UniqueName="TemplateColumn4" AllowFiltering="True" Groupable="False" 
                        HeaderStyle-Width="55px" ItemStyle-Width="55px" Reorderable="False" ShowSortIcon="True">  
                        <ItemTemplate> 
                            <asp:LinkButton  runat="server" CausesValidation="false" CommandName="Edit" 
                                Text='<%#Eval("PartNumber") %>' /> 
                        </ItemTemplate> 
                        <HeaderStyle Width="55px"></HeaderStyle> 
                        <ItemStyle Width="55px"></ItemStyle> 
                    </telerik:GridTemplateColumn> 

Ken
kencox
Top achievements
Rank 1
 answered on 28 Jul 2009
1 answer
88 views
HI

I have this code in a button in an edit form template

           <asp:Button ID="btnUpdate" Text='<%# Iif (TypeOf Container is GridEditFormInsertItem, "Insert", "Update") %>' 
 
                                        runat="server" CommandName='<%# Iif(TypeOf Container is GridEditFormInsertItem, "PerformInsert" , "Update" ) %>'>  
                                    </asp:Button> 
and it doesnt appear to be working as the button doesn't have any text or a command property. Please can you tell me what i'm doing wrong


many thanks
andieje
Top achievements
Rank 1
 answered on 28 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
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
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?