Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
205 views
Hi
 I want to disable filter of a particular column. How can I have this done.  I have set filtering to entire radgrid.
thnks
savyo
Princy
Top achievements
Rank 2
 answered on 06 Jun 2013
1 answer
166 views
Hi
I've got a user control that I've added to a RadWindow, it's an edit page that is opened inside a modal when a row in a grid is clicked instead of redirecting to a new page. To accomplish this in the click event on the row a new User Control is instantiated, data from the row applied to public properties and then the user control is added to the RadWindows list of controls

It loads fine and but when I click anything that causes postback in the edit page inside of the RadWindow the window disappears and no breakpoints in my code behind is hit. 

I have confirmed that postback causes the webform to postback and not the user control in the RadWindow.

Is there any way around this? 
Marin Bratanov
Telerik team
 answered on 06 Jun 2013
2 answers
112 views

Hi,

I have a problem when updating RadGrid that contains Bound columns, ItemTemplate and EditItemTemplate columns. Whenever I click update button on a row, the update does not work and no error message I get. Below I provided my code. Please help.

<telerik:RadGrid ID="RadGrid1" runat="server"  OnItemDataBound="OnItemDataBoundHandler"
     AllowPaging="True" 
 
………..
 
    <Columns>
     <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
 
                    <ItemStyle CssClass="MyImageButton"></ItemStyle>
 
                </telerik:GridEditCommandColumn>
 
        <telerik:GridBoundColumn DataField="idCol" DataType="System.Int64"
            FilterControlAltText="Filter idCol column" HeaderText="idCol" ReadOnly="True"
            SortExpression="idCol" UniqueName="idCol">
        </telerik:GridBoundColumn>
 
        <telerik:GridBoundColumn DataField="bondNo"
            FilterControlAltText="Filter bondNo column" HeaderText="bondNo"
            SortExpression="bondNo" UniqueName="bondNo" EditFormColumnIndex="0">
        </telerik:GridBoundColumn>
 
         <telerik:GridTemplateColumn HeaderText="OrderNo" ItemStyle-Width="240px">
                    <ItemTemplate>
                        <%#DataBinder.Eval(Container.DataItem, "OrderNo")%>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadComboBox runat="server" ID="RadComboBox1" DataTextField="OrderNo"
                            DataValueField="OrderNo" AutoPostBack="true" OnSelectedIndexChanged="OnSelectedIndexChangedHandler" >
                          
                        </telerik:RadComboBox>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="OrderItem" ItemStyle-Width="240px">
                    <ItemTemplate>
                        <%#DataBinder.Eval(Container.DataItem, "OrderItem")%>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadComboBox runat="server" ID="RadComboBox2" DataTextField="OrderItem" DataValueField="ItemNo">
                        
                       </telerik:RadComboBox>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
 
    </Columns>
Protected Sub OnItemDataBoundHandler(sender As Object, e As GridItemEventArgs) Handles RadGrid1.ItemDataBound
 
    If e.Item.IsInEditMode Then
        Dim editItem As GridEditFormItem = CType(e.Item, GridEditFormItem)
 
        Dim id3 As String = editItem.GetDataKeyValue("IdCol").ToString()
        Dim ds As New DataSet
        ds = GetOrderNo(id3)
        Dim ordNo, itemNo As String
        ordNo = ds.Tables(0).Rows(0)(0)
        itemNo = ds.Tables(0).Rows(0)(1).ToString().Trim()
 
        Dim OrderCombo As RadComboBox = TryCast(e.Item.FindControl("RadComboBox1"), RadComboBox)
        OrderCombo.DataSource = GetDataTable("SELECT OrderNo FROM Orders")
        OrderCombo.DataBind()
        OrderCombo.SelectedValue = ordNo
 
        Dim ItemCombo As RadComboBox = TryCast(editItem.FindControl("RadComboBox2"), RadComboBox)
        ItemCombo.DataSource = GetDataTable("SELECT ItemNo,ItemNo as OrderItem FROM Order_Items where OrderNo='" & ordNo & "'")
        ItemCombo.DataBind()
        ItemCombo.SelectedValue = itemNo
 
    End If
 
End Sub
Amar
Top achievements
Rank 1
 answered on 06 Jun 2013
2 answers
134 views
I'm using v2011.3.1305.40, VS2010, & IE8.  I'm attempting to export a custom header above the grid.  Everything is working fine except cell A1 had a border around it by default.  Please see attatchment.  I was able to reproduce the issue at the simplest level.  How can I make this not happen?

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="TestGrid.aspx.vb" Inherits="Pages_Business_TestGrid" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadGrid ID="dg" runat="server" AutoGenerateColumns="false">            
            <MasterTableView>
                <Columns>
                    <telerik:GridBoundColumn HeaderText="ID" DataField="ID"></telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
        <asp:Button ID="btnExport" runat="server" Text="Export" />
    </div>
    </form>
</body>
</html>
Partial Class Pages_Business_TestGrid
    Inherits System.Web.UI.Page
  
    Protected Sub dg_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles dg.NeedDataSource
        Dim dt As New DataTable
        Dim r As DataRow
        Dim col As New DataColumn("ID", GetType(Integer))
        dt.Columns.Add(col)
        For i As Integer = 1 To 10
            r = dt.NewRow
            r("ID") = i
            dt.Rows.Add(r)
        Next
        dg.DataSource = dt
    End Sub
  
    Protected Sub btnExport_Click(sender As Object, e As System.EventArgs) Handles btnExport.Click
        Dim sb As New StringBuilder
        sb.Append("<table>")
        sb.Append("<tr>")
        sb.Append("<table >")
        sb.Append("<tr>")
        sb.Append("<td>Date : </td>")
        sb.Append("<td>")
        sb.Append(Now.ToShortDateString)
        sb.Append("</td>")
        sb.Append("</tr>")
        sb.Append("<tr>")
        sb.Append("<td>Time : </td>")
        sb.Append("<td>")
        sb.Append(Now.ToShortTimeString)
        sb.Append("</td>")
        sb.Append("</tr>")
        sb.Append("<tr>")
        sb.Append("<td> </td>")
        sb.Append("<td></td>")
        sb.Append("</tr>")
  
        dg.MasterTableView.Caption = sb.ToString
        dg.ExportSettings.OpenInNewWindow = True
        dg.ExportSettings.ExportOnlyData = True
        dg.ExportSettings.IgnorePaging = True
        dg.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.Html
  
        dg.MasterTableView.ExportToExcel()
  
        sb.Append("</table>")
        sb.Append("</tr>")
        sb.Append("</table>")
    End Sub
  
End Class
Rob
Top achievements
Rank 1
 answered on 06 Jun 2013
1 answer
111 views
Hello,

     We have a requirement to allow the user to enter values on a RadWindow (modal type). Based on those values we need to execute business logic on the server and then set a drop down on the next RadWindow. The problem I am facing is that currently we have these set up as one window with separate panels. The first panel is toggled to the next when the first submit is clicked on the window. The second panel should then contain a constrained dropdown of email addresses. I would like this logic to remain on the server as it hits Active Directory and several other business classes in our code. The window is running on client side so even if I call a server side method (onprerender or onpreinit on the window) the next panel is toggled simultaneously and I am unable to set the dropdown contents on the second panel. I thought about just calling another radwindow from code behind. Is there any other way or is this the preferred method to achieve our goals?

Grid - Button click which opens....

Window1 - User answers values that drive drop down on..

Window2 - Contains dropdown that is based on Window1 answers.

-Thanks
Marin Bratanov
Telerik team
 answered on 06 Jun 2013
1 answer
173 views
Hello

I am new to Rad grid. as per the client requirement i have to create one level Hierarchy grid with Insert/Update/Delete. I want to bind the grid using NeedDataSource event i don't want to use SqlDataSource. My main grid will get populated using one Data Table Customer and Child Grid Will get Populate using different Data table order e.g.
                   DTCustomer                  DTOrder
CustomerID Name ContactNumber CustomerID  OrderNumber  OrderAmount
1 ABC 12345   1       1    100
2 PQR 345   2       2    200
3 XYZ 1456   3       3    300

Please Let me know that how can I bind the grid on NeedDataSource Event so that it will display Customer Data as Parent and Order Data as a Child.
Also please let me know that how can i implement the server side  logic to Insert/Update/Delete data to respective tables.
i have refer the example given on  http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/threelevel/defaultcs.aspx
URL but i don't  want to use Automatic Insert/Update/Delete.


Jayesh Goyani
Top achievements
Rank 2
 answered on 06 Jun 2013
8 answers
258 views

Telerik team,


I have radtreeview in radsplitter.[Telerik DLL V2012.1.411.40]

I have a requirement where on a selected index change of RadCombobox a radtree control should be generated. Now if I have selected a value say A from Combobox, the Tree will be generated. Now I select a Node say Node1 from the Tree and then select a different value from Picklist to regenerate the Tree. Now I want that if Node1 is again present as a Node in the new Tree generated, it should be selected and have focus on the respected Node i.e. Node1.

Following is my code

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" MaintainScrollPositionOnPostback="true"
    CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<script type="text/javascript">
 
    function OnClientClicking_RadButton(splitter, arg) {
        var RadTreeView1 = $find("<%=RadTreeView1.ClientID %>");
        var Selectednode = RadTreeView1.get_selectedNode();
        if (Selectednode != null) {
            Selectednode.scrollIntoView();
            alert(Selectednode.get_text());
        }
    }
 
    function splitter(splitter, arg) {
        var RadTreeView1 = $find("<%=RadTreeView1.ClientID %>");
        var Selectednode = RadTreeView1.get_selectedNode();
        if (Selectednode != null) {
            Selectednode.scrollIntoView();
            alert(Selectednode.get_text());
        }
    }
 
</script>
 
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
           <telerik:AjaxSetting AjaxControlID="RadComboBox">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radsplitter" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
           </telerik:AjaxSetting>
 
           </AjaxSettings>
           </telerik:RadAjaxManager>
 
            <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1">
    </telerik:RadAjaxLoadingPanel>
 
   <telerik:RadSplitter ID ="radsplitter" runat="Server" Width="100%" >
    <telerik:RadPane ID="Radpane" runat="server" Width="30%">
    <telerik:RadTreeView ID="RadTreeView1" runat="server" CheckBoxes="false" AllowNodeEditing="True" Skin="Vista"
                 EnableDragAndDrop="true" >
            </telerik:RadTreeView>
    </telerik:RadPane>
    <telerik:RadSplitBar ID="Splitbar" runat="server" CollapseMode="Forward" ></telerik:RadSplitBar>
      <telerik:RadPane ID="Radpane1" runat="server">
      <telerik:RadComboBox ID="RadComboBox" runat="server" AutoPostBack="true"  OnSelectedIndexChanged="RadComboBox_SelectedIndexChanged" >
      <Items>
      <telerik:RadComboBoxItem Text ="Tree1" Value="1" />
      <telerik:RadComboBoxItem Text ="Tree2" Value="2" />
      </Items>
      </telerik:RadComboBox>
      </telerik:RadPane>
     
   </telerik:RadSplitter>
 
</asp:Content>

using System;
using Microsoft.VisualBasic;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using Telerik.Web.UI;
using System.Web.UI;
using System.Xml.Linq;
using System.ComponentModel;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
using System.Text;
using System.Linq;
using System.Configuration;
using System.Security.Cryptography;
using System.IO;
using System.Drawing;
using System.Text.RegularExpressions;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
 
    protected void RadComboBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        DataTable dt = new DataTable();
        DataRow dr ;
        String selectednode = "";
        if (RadTreeView1.SelectedNode != null)
            selectednode = RadTreeView1.SelectedNode.Value;
 
        if (RadComboBox.SelectedValue == "1")
        {
            dt.Columns.Add("NODE_ID", typeof(int));
            dt.Columns.Add("PARENT_NODE_ID", typeof(int));
            dt.Columns.Add("NODE_NAME", typeof(String));
 
            for (int i = 1; i < 100; i++)
            {
                dr = dt.NewRow();
                dr["NODE_ID"] = i;
                if (i != 1)
                    dr["PARENT_NODE_ID"] = 1;
                dr["NODE_NAME"] = i.ToString() + " Operating costs";
                dt.Rows.Add(dr);
            }
 
            RadTreeView1.DataFieldID = "NODE_ID";
            RadTreeView1.DataFieldParentID = "PARENT_NODE_ID";
            RadTreeView1.DataTextField = "NODE_NAME";
            RadTreeView1.DataValueField = "NODE_ID";
            RadTreeView1.DataSource = dt;
            RadTreeView1.DataBind();
            RadTreeView1.ExpandAllNodes();
            RadTreeView1.EnableViewState = true;
            
        }
 
        if (RadComboBox.SelectedValue == "2")
        {
            dt.Columns.Add("NODE_ID", typeof(int));
            dt.Columns.Add("PARENT_NODE_ID", typeof(int));
            dt.Columns.Add("NODE_NAME", typeof(String));
 
            for (int i = 1; i < 100; i++)
            {
                dr = dt.NewRow();
                dr["NODE_ID"] = i;
                if (i != 1)
                    dr["PARENT_NODE_ID"] = 1;
                dr["NODE_NAME"] = i.ToString() + " Report whether management has quantitatively estimated the financial implications (e.g., cost of insurance and carbon credits) of climate change for the organization. Where possible, quantification would be beneficial. If quantified, disclose financial implications and the tools used to quantify";
                dt.Rows.Add(dr);
            }
 
            RadTreeView1.DataFieldID = "NODE_ID";
            RadTreeView1.DataFieldParentID = "PARENT_NODE_ID";
            RadTreeView1.DataTextField = "NODE_NAME";
            RadTreeView1.DataValueField = "NODE_ID";
            RadTreeView1.DataSource = dt;
            RadTreeView1.DataBind();
            RadTreeView1.ExpandAllNodes();
            RadTreeView1.EnableViewState = true;
 
        }
 
        if (selectednode != "")
        {
            RadTreeNode node = RadTreeView1.FindNodeByValue(selectednode);
            node.Selected = true;
        }
    }
 
}


Thanks

Sampada


Plamen
Telerik team
 answered on 06 Jun 2013
2 answers
83 views
Hello,

i am using fulltextsqlquery to get result in share point search and binding results into a grid.

The query returns "ID" and "StaffID".I would like to format those 2 values as mentioned below in gridtemplatecolumn.

and i would like to use that formatted values which is say for ex - (1-33333) as my clientdatakeynames.

Please suggest how could i achieve this?

 <telerik:GridTemplateColumn HeaderText="UniqueID" UniqueName="UniqueID" ItemStyle-CssClass="grid_column"
                                                    Visible="true" ItemStyle-Width="10%" >
                                                    <ItemTemplate>
                                                    <%# String.Format("{0}-{1}", Eval("ID"), Eval("StaffID"))%>    
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>

Thanks in advance.
Sreenivas
Top achievements
Rank 1
 answered on 06 Jun 2013
0 answers
69 views
Hi,
I am working with an application using ASP.NET. In my application i want to concurrently accessing and modifying the documents(files) in an application similar to googledocs. 
In the same way i want to implementing in my application. All files are stored in company server and I am not intreseted to store the files in Google docs. I will access those files from company sever not google server. 

can any one knows the code plz tell me asap. If any tools are available plz tell me. 
Harikrishna
Top achievements
Rank 1
 asked on 06 Jun 2013
3 answers
239 views

I have broken down the site I am developing into multiple files developed as user controls. It makes more sense to simply add a single usercontrol than to add half a dozen or more other controls to multiple pages, plus when I need to edit the item it gets applied site-wide. However, there seems to be an issue that I am not sure how to handle.

I have a user control "header.ascx" that is included on several webpages.

<%@ Register Src="menu.ascx" TagName="menu" TagPrefix="uc1" %>
<div id="header">

    <div id="orgname" class="headerinfo" style="position: relative; z-index: 1500; text-align: right">
        <asp:Label ID="lblOrganizationName" runat="server" Font-Names="Arial Black" ForeColor="Gray" Text="Organization Name"
            Font-Size="Large"></asp:Label>
    </div>
    <div id="logindetails" class="headerinfo" style="text-align: right; position: relative;
        z-index: 1500; top: 0px; left: 0px;">
        <asp:Label ID="lblUser" runat="server" Font-Names="Arial" ForeColor="Gray" Text="User Name"
            Font-Size="Small"></asp:Label
        <asp:LoginStatus ID="LoginStatus1" runat="server" Font-Names="Tahoma,Arial" ForeColor="#FF6600" />
           
        <asp:Label ID="lblPage" runat="server" Font-Names="Arial Black" ForeColor="Gray"
            Text="" Font-Size="Small"></asp:Label>   
        <uc1:menu ID="menu1" runat="server" />
    </div>
</div>

As you can see, I have also included a user control "menu.ascx" that is part of the header as well as part of other pages that don't include the full header.

When I view menu.ascx in the IDE, the menu is rendered correctly. If I view header.ascx in the IDE the menu is rendered correctly, however, whenever I view any page in the IDE that has a header user control, I get an error "Unknown server tag 'telerik:RadMenu'" and the menu isn't rendered.

When the menu isn't nested in another user control, it displays correctly. However, when it is included as part of a larger user control, it does not.

I can build the site and it renders correctly in the browser, however, I cannot see how it interacts with the design when it will not show on the main page.

Am I missing a directive or something so this will display?

Boyan Dimitrov
Telerik team
 answered on 06 Jun 2013
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?