Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
101 views
Hi

 

for (int i = 0; i < RadTreeView1.Nodes.Count; i++)

 

{

 

        bool bchk= RadTreeView1.Nodes[i].Checked;

 

 

}
Response.Redirect("WebForm1.aspx");

 

 

I have treeview control with checkbox.
I selected some nodes and click on save button at the time i can able to get all the checked nodes.But when i come back to the same page using click on browser back button at the time i can not get the checked node in button click event. all the nodes are returning false only .But in the UI its seems to be selected only.what i needs to do?

I am using IE 7.0 and
Telerik .Web.UI 2008.1.415.20

Regards
Vairam

vairam
Top achievements
Rank 1
 asked on 08 Jun 2009
1 answer
177 views
protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)  
    {  
 
        GridEditableItem item = e.Item as GridEditableItem;    
        string type = (item.FindControl("priorityComboBox") as RadComboBox).SelectedValue.ToString();  
        string Message = (item.FindControl("TextBox1") as TextBox).Text;  
        string todo_date = (item.EditManager.GetColumnEditor("Todo_date") as GridDateTimeColumnEditor).Text;  
 
        string InsertSQL = "INSERT INTO [ToDo] ([Message], [Todo_Date], [Type],[AdminID]) VALUES ('"+Message+"','"+todo_date+"','"+type+"',1)"  ;  
 
        String ConnString = ConfigurationManager.ConnectionStrings["SchedulerConnectionString"].ConnectionString;  
        SqlConnection conn = new SqlConnection(ConnString);  
        SqlCommand cmd = new SqlCommand(InsertSQL, conn);  
        int flag;  
        try  
        {  
            conn.Open();  
            flag = cmd.ExecuteNonQuery();  
        }  
        finally  
        {  
            conn.Close();  
        }  
         
        
    } 
<telerik:RadGrid runat="server" ID="RadGrid1"  GridLines="None"    
            AutoGenerateColumns="False" Skin="Office2007" style="border: none;" height="100%" 
            AllowAutomaticInserts="True" AllowAutomaticUpdates="true" ShowFooter="true"   
             AllowSorting="true" onitemupdated="RadGrid1_ItemUpdated"   
            onneeddatasource="RadGrid1_NeedDataSource"   
            ondetailtabledatabind="RadGrid1_DetailTableDataBind"   
            oninsertcommand="RadGrid1_InsertCommand"   
            oniteminserted="RadGrid1_ItemInserted">  
               
                             <ClientSettings AllowExpandCollapse="true">  
                    <ClientEvents OnRowDblClick="RowDblClicked" /> 
                </ClientSettings> 
                                                           <%--<ClientSettings AllowRowsDragDrop="false" AllowExpandCollapse="true">  
                                                                <Selecting AllowRowSelect="True" />   
                                                                <ClientEvents OnRowDblClick="RowDblClicked" /> 
                                                            </ClientSettings>--%> 
                                                            <MasterTableView  runat="server" DataKeyNames="Todo_Date" InsertItemDisplay="Bottom"  EditMode="InPlace" AllowMultiColumnSorting="true" Width="100%" HierarchyLoadMode="Client" CommandItemDisplay="Top" AllowAutomaticInserts="true" > 
                                                                <SortExpressions> 
                                                                    <telerik:GridSortExpression FieldName="Todo_Date" SortOrder="Ascending" /> 
                                                                </SortExpressions> 
                                                                 <DetailTables> 
                                                                  
                        <telerik:GridTableView DataKeyNames="Todo_Date" Width="100%"   
                            runat="server" AllowAutomaticUpdates="true" AutoGenerateColumns="false" EditMode="InPlace" 
                            Name="Todo" HierarchyLoadMode="Client" CommandItemDisplay="Bottom" AllowAutomaticInserts="true">  
                             
                            <ParentTableRelation> 
                                <telerik:GridRelationFields DetailKeyField="Todo_Date" MasterKeyField="Todo_Date" /> 
                            </ParentTableRelation> 
                            <Columns> 
                              
                <%--            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" HeaderText="Edit" > 
                            <ItemStyle CssClass="MyImageButton"  /> 
                            </telerik:GridEditCommandColumn>--%> 
                                                                    <telerik:GridTemplateColumn  DataField="Message" HeaderText="Task">  
                                                                        <ItemTemplate> 
                                                                            <asp:Label runat="server" ID="Label1" Text='<%# Bind("Message") %>'></asp:Label> 
                                                                        </ItemTemplate> 
                                                                        <FooterTemplate> 
                                                                            <asp:LinkButton Text="Add new task" CommandName="<%# RadGrid.InitInsertCommandName %>" 
                                                                                runat="server" ID="LinkButton1"></asp:LinkButton> 
                                                                        </FooterTemplate> 
                                                                        <EditItemTemplate> 
                                                                            <asp:TextBox runat="Server" ID="TextBox1" Text='<%# Bind("Message") %>' Width="100%"></asp:TextBox> 
                                                                        </EditItemTemplate> 
                                                                    </telerik:GridTemplateColumn> 
     
                                                                  <telerik:GridDateTimeColumn DataField="Todo_Date" HeaderText="Due Date" DataFormatString="{0:d}" 
                                                                        HeaderStyle-Width="200px">                                                                 
                                                                    </telerik:GridDateTimeColumn> 
                                                                      
                                                                    <telerik:GridTemplateColumn DataField="Type" HeaderText="Type" HeaderStyle-Width="200px">  
                                                                        <ItemTemplate> 
                                                                            <asp:Label runat="Server" ID="Label2" Text='<%#Bind("Type") %>'></asp:Label> 
                                                                        </ItemTemplate> 
                                                                        <EditItemTemplate> 
                                                                            <telerik:RadComboBox runat="server" ID="priorityComboBox" SelectedValue='<%#Bind("Type") %>' 
                                                                                Skin="Office2007" Width="120px">  
                                                                                <Items> 
                                                                                    <telerik:RadComboBoxItem Text="Calls" Value="Calls" /> 
                                                                                    <telerik:RadComboBoxItem Text="Other Things ToDo" Value="Other Things ToDo" /> 
                                                                                     
                                                                                </Items> 
                                                                            </telerik:RadComboBox> 
                                                                            <asp:LinkButton ID="btnUpdate" Text="Save" runat="server" CommandName='<%# (Container is GridDataInsertItem) ? RadGrid.PerformInsertCommandName : RadGrid.UpdateCommandName %>'></asp:LinkButton> 
                                                                            <asp:LinkButton ID="btnCancel" Text="Cancel" runat="server" CommandName='<%# RadGrid.CancelCommandName %>'></asp:LinkButton> 
                                                                        </EditItemTemplate> 
                                                                    </telerik:GridTemplateColumn> 
                                                                </Columns> 
                        </telerik:GridTableView> 
                    </DetailTables> 
                      
                    <ExpandCollapseColumn Visible="True"></ExpandCollapseColumn> 
                          <Columns > 
                                                               
                                                                    <telerik:GridDateTimeColumn DataField="Todo_Date" HeaderText="Todo_Date" DataFormatString="{0:D}" 
                                                                        HeaderStyle-Width="100%" > 
                                                                    </telerik:GridDateTimeColumn> 
                                                                      
                                                                </Columns>                                        
                                                                  
      </MasterTableView> 
       </telerik:radgrid> 

Hello ,

 I am using Hierarchical  grid . On Inserting a new row in detailtable i am not able to exit the insert mode . inserted row is saved in database but it doesnt exit the insert mode .

for masterTable i could have used 
RadGrid1.MasterTableView.IsItemInserted = false;

But how to do this in details table . I only want to insert record in detailtable .

Thank You
Vipin



Daniel
Telerik team
 answered on 08 Jun 2009
4 answers
285 views
Hi,

I have a simple implementation of RadScheduler on a Page and have it set to width=100%, height=100%, OverflowBehaviour=Expand.

The scheduler fills the page area when using the Daily, Weekly or Timeline views, but is smaller than the area when the Month view is selected.  I am particularly using this implementation as a Monthly Calendar, and need to fill the available space.

I have looked through the Forums and found a couple of possible solutions but none seem to work quite as expected.

I am using the latest Q3 2008 release build 2008.3.1210.20

David Penny
Peter
Telerik team
 answered on 08 Jun 2009
3 answers
121 views
Is there a way of changing the layout of the scheduler control so that we have the times vertically and the names horizontally
Peter
Telerik team
 answered on 08 Jun 2009
1 answer
122 views
I've been using this article as a guide to implement mouseover "details" tooltips in my RadGrid.  The result has been great - in general it works beautifully.  There are, however, a couple issues that I could use some help with:

  1. If the user sorts the RadGrid, it should clear the TargetControls property of the RadToolTipManager and re-populate that with the new values for each target control.  That doesn't happen.  I'v implemented the code mentioned in the article in my ItemCommand and ItemDataBound but after a sort the value for each TargetControl is still the old one.
  2. I've tried changing the Skin value of the RadTooltipManager, but it doesn't seem to make any difference.  Any idea what I might be missing?
  3. I'd like to move the "Close" button to the left side of the tooltip, is there a way to control it's position, or anything else about the close button?

Here is the code I'm using:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)  
{  
    if (e.CommandName == "Sort" || e.CommandName == "Page")  
        RadToolTipManager1.TargetControls.Clear();  
}  
 
protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args)  
{  
    UpdateToolTip(args.Value, args.UpdatePanel);  
}  
 
private void UpdateToolTip(string elementID, UpdatePanel panel)  
{  
    var ctrl = Page.LoadControl("~/usercontrols/PersonSummary.ascx");  
    panel.ContentTemplateContainer.Controls.Add(ctrl);  
    var details = (PersonSummary)ctrl;  
    details.xref = elementID;  
}  
 
protected void RadGrid_ItemDataBound(object sender, GridItemEventArgs e)  
{  
    if (e.Item.ItemType != GridItemType.Item && e.Item.ItemType != GridItemType.AlternatingItem) return;  
    var target = e.Item.FindControl("targetControl");  
    if (!Equals(target, null))  
        if (!Equals(RadToolTipManager1, null))  
        {  
            var currentRow = e.Item as GridDataItem;  
            if (currentRow != null)  
                RadToolTipManager1.TargetControls.Add(target.ClientID, currentRow["colXref"].Text, true);  
        }  
}  
 
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadGrid1" EventName="Sort">                  
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="loadingPnl" /> 
                <telerik:AjaxUpdatedControl ControlID="RadToolTipMgr" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
        <telerik:AjaxSetting AjaxControlID="imgBtnExportExcel" EventName="Click">  
        </telerik:AjaxSetting>              
    </AjaxSettings> 
</telerik:RadAjaxManagerProxy> 
 
<telerik:RadToolTipManager ID="RadToolTipManager1" OffsetY="0" ShowCallout="true"   
    OffsetX="-30" HideEvent="LeaveToolTip" ShowEvent="OnMouseOver" 
    Width="560" Height="150" runat="server" OnAjaxUpdate="OnAjaxUpdate" RelativeTo="Element" 
    Position="MiddleRight" ManualClose="true" Modal="false" Sticky="true" Animation="None" 
    ContentScrolling="Auto" Skin="WebBlue" EnableTheming="true">  
</telerik:RadToolTipManager> 
 
<telerik:RadGrid ID="RadGrid1" EnableViewState="true" runat="server" AllowSorting="True"   
    OnItemCommand="RadGrid1_ItemCommand"   
    OnItemDataBound="RadGrid_ItemDataBound"   
    OnNeedDataSource="RadGrid1_NeedDataSource" 
    OnDataBound="rgResults_DataBound">  
    <MasterTableView DataKeyNames="Xref" ClientDataKeyNames="Xref" ShowHeadersWhenNoRecords="false"   
        AllowMultiColumnSorting="true" VirtualItemCount="100">    
            <telerik:GridTemplateColumn HeaderText="NAME" SortExpression="LastName"   
                UniqueName="colName" HeaderStyle-CssClass="gvHeaderName" ItemStyle-CssClass="gvItemName">  
                <ItemTemplate> 
                    <asp:HyperLink ID="targetControl" runat="server"   
                        NavigateUrl="#"   
                        Text='<%# Eval("LastName") + ", " + Eval("FirstName") + " " + Eval("MiddleName") %>'></asp:HyperLink> 
                </ItemTemplate> 
            </telerik:GridTemplateColumn> 
    </MasterTableView> 
</telerik:RadGrid> 
 
Obviously I removed a lot of extraneous code to focus on just the bits that pertain to this question...
Thanks for the help!

Eddie
Svetlina Anati
Telerik team
 answered on 08 Jun 2009
3 answers
81 views

Hi, All
I had seen http://www.telerik.com/support/kb/aspnet-ajax/grid/replacing-the-default-confirm-dialog-for-radgrid-with-radwindow-confirm.aspx  and tried RadConfirmInGridWithAjax.zip . It works.
However, If the aspx page was displayed in RadWindow, radAjaxManagerObject= undefined

/* some code snips */ 
btnEdit.Attributes["onclick"] = "return ShowForm();";  
function ShowForm()  
   {                  
    window.radopen("View.aspx""MyForm");    /* View.aspx doesn't work when opened by window.radopen */
    return false;   
   }    
 
 
function DoParentCallback()  
      {  
        var parentWindow = window.parent;  
        parentWindow.setTimeout( function()  
        {  
         var radAjaxManagerObject = parentWindow["RadAjaxManager1"];  /* Click DELETE button and click OK when popup window, then Exception:  radAjaxManagerObject: undefined */ 
         radAjaxManagerObject.ajaxRequest("Delete");  
        } , 200);  
      }  
 

download codes:  http://www.lamwz.cn/file/codes/RadConfirmInGrid-Eman.rar

Thanks
Eman
Iana Tsolova
Telerik team
 answered on 08 Jun 2009
1 answer
122 views
Hi,

I am trying to export radgrid to excel but I am getting "object reference not set to the istance of the object" error when I am trying to export in ExcelML format. Below is the code I am using:
        

protected

 

void btnExportExcel_Click(object sender, ImageClickEventArgs e)

 

{

 

//ConfigureExport();

 

 

this.radMainGrid.ExportSettings.OpenInNewWindow = true;

 

 

this.radMainGrid.ExportSettings.ExportOnlyData = true;

 

 

this.radMainGrid.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML;

 

 

this.radMainGrid.MasterTableView.ExportToExcel();

 

 

}

I am using a trial version of radgrid, is it bcoz of this that I am getting this error.
This is very urgent, please reply soon.

Pavlina
Telerik team
 answered on 08 Jun 2009
5 answers
102 views
Hi All,

We are preparing an application for parts lookup. We are using telerik rad ASP.NET AJAX Q1 Controls in our application.

Whenever the postback is happening, i am getting the below mentioned error. This is not happening everytime, its coming at times and the whole functionality of application is getting disturbed.

Please help me to solve this error.

Line: 4723
Error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

Details: Error parsing near 'Telerik.Web.UI 2009.'.

Thanks,

Kiran Kumar Bodla.
Pavlina
Telerik team
 answered on 08 Jun 2009
1 answer
124 views

I just upgraded my VS to framework 3.5.  I had an application that I converted w/out any errors and it no longer loads the combobox on demand.  It says it can't find the method being called.  I ran it through debug and it never even goes to the webservice. 

 

 

 

<telerik:RadComboBox ID="cmboDept" runat="server" AutoPostBack="true"  

 

EnableLoadOnDemand="true">  

 

 

<WebServiceSettings Method="loadDepartment"  

 

Path="~/WebServices/srvc_ComboBox.asmx" />  

 

 

</telerik:RadComboBox>

This worked just find in VS 2003.  Any idea what I may be missing?

Thanks!

 

 

Veselin Vasilev
Telerik team
 answered on 08 Jun 2009
1 answer
128 views

I have the following RadTreeView set up like this:

<telerik:RadTreeView ID="radtree" runat="server" Skin="Default">  
    <Nodes> 
        <telerik:RadTreeNode runat="server" Expanded="True" Text="Level_1">  
            <Nodes> 
                <telerik:RadTreeNode runat="server" Expanded="True" Text="Level_2">  
                    <Nodes> 
                        <telerik:RadTreeNode runat="server" Expanded="True" Text="Level_3">  
                            <Nodes> 
                                <telerik:RadTreeNode runat="server" Expanded="True" Text="Level_4">  
                                    <Nodes> 
                                        <telerik:RadTreeNode runat="server" Expanded="True" Text="Level_5">  
                                            <Nodes> 
                                                <telerik:RadTreeNode runat="server" Expanded="True" Text="Level_6">  
                                                    <Nodes> 
                                                        <telerik:RadTreeNode runat="server" Expanded="True" Text="Level_7">  
                                                        </telerik:RadTreeNode> 
                                                    </Nodes> 
                                                </telerik:RadTreeNode> 
                                            </Nodes> 
                                        </telerik:RadTreeNode> 
                                    </Nodes> 
                                </telerik:RadTreeNode> 
                            </Nodes> 
                        </telerik:RadTreeNode> 
                    </Nodes> 
                </telerik:RadTreeNode> 
            </Nodes> 
        </telerik:RadTreeNode> 
    </Nodes> 
    <CollapseAnimation Duration="100" Type="OutQuint" /> 
    <ExpandAnimation Duration="100" /> 
</telerik:RadTreeView> 

I also have the following DataSet set up like this:

DataSet oDS1 = null;  
DbCommand dbCom = db.GetStoredProcCommand("SQL Code");  
oDS1 = db.ExecuteDataSet(dbCom);  
 
oDS1.Relations.Add(new DataRelation("Table0ToTable1", oDS1.Tables[0].Columns[0], oDS1.Tables[1].Columns[3], false));  
oDS1.Relations.Add(new DataRelation("Table1ToTable2", oDS1.Tables[1].Columns[0], oDS1.Tables[2].Columns[3], false));  
oDS1.Relations.Add(new DataRelation("Table2ToTable3", oDS1.Tables[2].Columns[0], oDS1.Tables[3].Columns[3], false));  
               

If I wanna bind oDS1 to a RadTreeView like this:
radTree.DataSource = oDS1;  
radTree.DataBind(); 

What event do I need to access to be able to say something like:
 'all rows in Table[3] need to add nodes at level_7'.

Jason
J
Top achievements
Rank 1
 answered on 08 Jun 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?