Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
93 views
Hi,

Is it possible to export two radgrid in 1 pdf /excel file?


Thanks,
Bermo
Princy
Top achievements
Rank 2
 answered on 18 Jul 2011
1 answer
193 views
Hello All,

I have a RadFileExplorer in our application which is created dynamically. The grid has two bound columns for which we have to enable column sorting. I have registered the GridSortCommandEventHandler while creating the Grid but the grid is not triggering the Sort event.

radFileExplorer.Grid.ID = radGridViewName;

radFileExplorer.Grid.AllowSorting = true;  
radFileExplorer.Grid.ItemDataBound += new GridItemEventHandler(radFileExplorer_ItemDataBound);  
radFileExplorer.Grid.SortCommand += new GridSortCommandEventHandler(radFileExplorer_SortCommand);  
radFileExplorer.TreeView.NodeClick += new RadTreeViewEventHandler(treeView_NodeClick);

Below is the code written for radFileExplorer_SortCommand event. The below event is not getting invoked on click of the column header.

void

radFileExplorer_SortCommand(object sender, GridSortCommandEventArgs e)  

{

string sortDir = "ASC";  
DataView dv = new DataView(Documents);  
string viewStateKey = "sortDirection" + e.SortExpression;  
if (ViewState[viewStateKey] != null)  

{
sortDir = ((string)ViewState[viewStateKey] == "ASC") ? "DESC" : "ASC";  
}

ViewState[viewStateKey] = sortDir;
dv.Sort = e.SortExpression + 

" " + sortDir;  
SortExpression = dv.Sort; 
GridView docListGrid = (GridView)this.FindControl(radGridViewName);  
if (docListGrid != null)  
{

docListGrid.DataSource = dv;

docListGrid.DataBind();

}

}

This is quite urgent and any help would be appriciated.

Many thanks in advance.

Regards
Rajeev



Dobromir
Telerik team
 answered on 18 Jul 2011
1 answer
65 views
Hi


how to create the rad combo box dynamically in java script coding
and also date picker  control

Please let me know the information and steps regarding this

Thank you for your help!
Shinu
Top achievements
Rank 2
 answered on 18 Jul 2011
1 answer
105 views
Hi,

I'm currently having the problem, that my "add new record" button isn't showing in my detailgrid..
Even so, my grid does not show the expandbutton, to open the detailgrid.
I'm currently aware that there are no records to retrieve from the database, but however it must show the text "No items to display"

I included a screenshot for more information.

This is the code:
public void Page_Load(object sender, EventArgs e)
{
    // Get Total ProcessTemplates
    SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MSCBE.DashboardConnectionString"].ConnectionString);
    SqlCommand cmd = new SqlCommand("SELECT COUNT(ProcessTemplate_id) AS total FROM ProcessTemplate", conn);
    conn.Open();
    int intTotalProcessTemplates = Convert.ToInt32(cmd.ExecuteScalar());
    conn.Close();
    // Create grids
    RadGrid[] GridName = new RadGrid[intTotalProcessTemplates];
     
    for (int i = 0; i < intTotalProcessTemplates; ++i)
    {
        // Create mastertable
        GridName[i] = new RadGrid();
        GridName[i].DataSource = GetDataTables.GetDataTable("SELECT * FROM ProcessTemplate WHERE ProcessTemplate_id = " + (i + 1));
        GridName[i].MasterTableView.DataKeyNames = new string[] { "ProcessTemplate_id" };
        GridName[i].Skin = "Black";
        GridName[i].AutoGenerateColumns = false;
        GridName[i].AllowPaging = true;
        GridName[i].ShowStatusBar = true;
        // Columns create
        GridName[i].MasterTableView.Columns.Add(CreateGridColumn("Process name", "Name", 10.0));
        GridName[i].MasterTableView.Columns.Add(CreateGridColumn("Process description", "Description", 80.0));
        GridName[i].MasterTableView.Columns.Add(CreateGridColumn("Parent", "Parent", 10.0));
        // Create detail table
        GridTableView tableViewStartProcesses = new GridTableView(GridName[i]);
        tableViewStartProcesses.Name = "DetailTable_" + i;
        tableViewStartProcesses.DataKeyNames = new string[] { "Process_id" };
        tableViewStartProcesses.AutoGenerateColumns = false;
        tableViewStartProcesses.AllowPaging = true;
        tableViewStartProcesses.ShowFooter = true;
        tableViewStartProcesses.ShowHeadersWhenNoRecords = true;
        tableViewStartProcesses.CommandItemDisplay = GridCommandItemDisplay.Top;
        
        // Reset Counter
        //Count[i] = new int();
        int counter = 0;
        CountItems countitem = new CountItems();
        countitem.id = i;
        // Fix result from stored proc: GetAllProcessesAndSteps_SP
        DataSet _dataset = BLProcessesAndSteps.GetAllProcessesAndSteps((i + 1));
        if (_dataset.Tables.Count > 0)
        {
            var query = from r in _dataset.Tables[0].AsEnumerable()
                        where r.Field<decimal>("templateid") == (i + 1) // DO NOT REMOVE FROM STORED PROC                            
                        select r;
            // Get total columns
            int TotalColumns = query.AsDataView().Table.Columns.Count;
              
            GridBoundColumn[] gbcColumnName = new GridBoundColumn[TotalColumns];
              
            // Loop trough header items
            for (int j = 0; j < TotalColumns; ++j)
            {
                // Create detailcolumns
                gbcColumnName[j] = new GridBoundColumn();
                gbcColumnName[j].ReadOnly = true;
                string strData = query.AsDataView().Table.Columns[j].ToString();
                if (strData == "Process_id" || strData == "templateId" || strData == "ProcessName")
                {
                    gbcColumnName[j].Visible = false;
                    gbcColumnName[j].ReadOnly = true;
                }
                string strQuery = "SELECT DISTINCT(CriteriaType.Name), CriteriaType.CriteriaType_id, Process.ProcessTemplate_id FROM CriteriaType INNER JOIN CriteriaValue ON CriteriaType.CriteriaType_id = CriteriaValue.CriteriaType_id INNER JOIN Process ON CriteriaValue.Process_id = Process.Process_id WHERE Process.ProcessTemplate_id = " + (i + 1);
                DataTable dtCriteriaTypes = GetDataTables.GetDataTable(strQuery);
                string[] strValues = new string[dtCriteriaTypes.AsDataView().Table.Rows.Count];
                  
                 
                for (int k = 0; k < dtCriteriaTypes.AsDataView().Table.Rows.Count; ++k)
                {
                    strValues[k] = dtCriteriaTypes.AsDataView().Table.Rows[k]["Name"].ToString();
                    if (strData == strValues[k])
                    {
                        gbcColumnName[j].ReadOnly = false ;
                        counter++;
                    }
                }
                countitem.count=counter;
                  
                gbcColumnName[j].HeaderText = strData;
                gbcColumnName[j].DataField = strData;
                // Add detailcolumns
                tableViewStartProcesses.Columns.Add(gbcColumnName[j]);
            }
            Count.Add(countitem);
            // Add Details to table
            GridName[i].MasterTableView.DetailTables.Add(tableViewStartProcesses);
            // Rebind
            tableViewStartProcesses.DataSource = query.AsDataView();
        }
        // Add to placeholder
        this.StartProcessPlaceHolder.Controls.Add(GridName[i]);
        // Events
        GridName[i].InsertCommand += new GridCommandEventHandler(OverviewProcess_InsertCommand);
    }
Shinu
Top achievements
Rank 2
 answered on 18 Jul 2011
3 answers
397 views
Hi All,

I have taken a telerik:RadDateTimePicker control.
how to get or set its values in "dd MMM yyyy hh:mm:ss" format using javascript.
DOes anybody know then please tell me.

I will be highly greatful to yours!!!!!!!!!!!!


Regards
Brijendra Pandey
Daniel
Telerik team
 answered on 18 Jul 2011
1 answer
158 views
I have a grid where the columns are created via code, not the markup. When I sort on this grid, the column header text goes blank!
I've isolated this bug into a test project, here's the complete code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RadGridDynamicColumns._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title>Sample Rad Grid Example</title>
</head>
<body>
    <form id="form1" runat="server">
<telerik:RadScriptManager runat="server" />
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="gvwPlayers" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
     
    <telerik:RadGrid
        id="_radGrid"
        runat="server"
        OnNeedDataSource="radGrid_NeedDataSource"
        AllowSorting="true"
        AutoGenerateColumns="false"
        Width="100mm">
    </telerik:RadGrid>
    </form>
</body>
</html>

And the Code-Behind:

using System;
using Telerik.Web.UI;
 
namespace RadGridDynamicColumns
{
    // A test data class
    public class Widget
    {
        public string Name { get; set; }
        public string Description { get; set; }
    }
 
 
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this._radGrid.Columns.Add(new GridBoundColumn { HeaderText = "Name", DataField = "Name" });
                this._radGrid.Columns.Add(new GridBoundColumn { HeaderText = "Description", DataField = "Description" });
            }
        }
 
        public Widget[] TestData = new[]
                                    {
                                        new Widget { Name = "FooBar", Description = "WidgetFooBar" },
                                        new Widget { Name = "Harold", Description = "Biggles" }
                                    };
        protected void radGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            this._radGrid.DataSource = this.TestData;
        }
    }
}

Princy
Top achievements
Rank 2
 answered on 18 Jul 2011
1 answer
154 views
Hello Support

My onclientclose event is not firing please suggest me where I made mistake

var wnd = radopen("url", "RadWindow" );
            wnd.set_modal(false);
            
            var oManager = GetRadWindowManager();
            var oWindow = oManager.GetWindowByName("RadWindow" + i.toString());
            oWindow.SetModal(false);
            oWindow.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move);
            oWindow.setSize(440, 260);
            oWindow.moveTo(parseInt(x), 320);
            oWindow.OnClientClose = function() {
                alert('hi');
            }
Shinu
Top achievements
Rank 2
 answered on 18 Jul 2011
1 answer
74 views
I want manual row reorder like in this example: http://demos.telerik.com/aspnet-ajax/grid/examples/programming/draganddrop/defaultcs.aspx

The problem is that this is the example for RadGrid, but I need the same functionality for "GridTableView" control, since I'm using hierarchy, and cannot replace gridtableview with radgrid (or can I?)
Genti
Telerik team
 answered on 18 Jul 2011
1 answer
164 views
Hello,

Looking for input on FlowDirection for a RadTreeView. My limitation is that I have to stay at 3.5 framework and Telerik version 2010.1.519.35 (existing project). My RadTreeView works nicely but of course has a vertical flow and the UX person wants it to flow horizontal..so forgive the lame ASCII art something like this:

WRONG:
+ Node1
- Node2
    Sub2
    Sub2a
    Sub2b
+Node3

Right:
+Node1                -Node2                    +Node3
                                Sub2
                                Sub2a
                                Sub2b

The only solution I have been able to think of is to implement 3 trees on different panels and split the data up so it binds to the tree I want it to.....this seems lame so I am hoping someone can enlighten me on a better way.

Thanks
JB
Plamen
Telerik team
 answered on 18 Jul 2011
1 answer
112 views
Hi

how to create radcombobox and datepicker from clientside


thanks & Regards
Rashmi
Shinu
Top achievements
Rank 2
 answered on 18 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?