Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
89 views
I am trying to write a javascript code.  This is code I have right now.

<script type='text/javascript'>
function onCheckBoxClickctl00_Content_ddc1_CB1(){
var combo=$find('ctl00_Content_ddc1_CB1');
 var CountChecked=0;
var text='This is the text message';
var max ='4';
var items = combo.get_items();
for(var i=0;i<items.get_count();i++){
var item=items.getItem(i);
var chk1=$get(combo.get_id()+'_i'+i+'_chk1');
if(chk1.checked){
CountChecked ++;
if(max < CountChecked) {
chk1.checked = false;
}
text+=item.get_text()+',';
 if(CountChecked > 3)
{ text = 'You have ' + CountChecked  + ' items selected :';}
}
}
 text=removeLastDelimiter(text);
if(text.length>0){combo.set_text(text);}else{combo.set_text('');}}
</script>

if(text.length>0){combo.set_text(text);}else{combo.set_text('');}}

I would like to write the text in the first line of the drop down.  Something like items._array[0].set_text(text).  But when I did this I get an error.  Can you please tell me how to do this.

Thank you
Kalyani
Top achievements
Rank 1
 asked on 22 Sep 2014
2 answers
127 views
Does anybody know how to hide all grid items in MastertableView and DetailTableVies after clicking on "Add new item" button?
I wont to Display only the insert form and hide all ofter GridView elements:


​
protected void GrdTicketsItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.InitInsertCommandName)
    {
        // show insert form works fine
        e.Item.OwnerTableView.EditFormSettings.UserControlName = "BackendControls/AddBillingAndTicket.ascx";
        e.Item.OwnerTableView.EditFormSettings.EditFormType = GridEditFormType.WebUserControl;
        e.Item.OwnerTableView.InsertItem();
 
        // How to hide all items in MasterTableView and all DetailsTables?
        // this doesn't work:
        foreach (GridDataItem item in GrdTickets.Items)
            item.Visible = false;
    }
}


Thank you for your help.
Christopher
kzimny
Top achievements
Rank 1
 answered on 22 Sep 2014
1 answer
108 views
I am working on a project that requires complex conditional validation and I want to be able to access the controls in the edit template on the server validate event. I have looked through the object model and I am not seeing anything I can use to access the page values. Any clues?

During an edit I can use the RadGrid1.EditItems but insert there are none there.
Jayesh Goyani
Top achievements
Rank 2
 answered on 22 Sep 2014
1 answer
110 views
Hi,

I have a  radgrid and the the radgrid is set to autogenerated columns =  true. Once the radcombo box is changed the grid should have null data and the columns are added based on listbox source to destination selection. Though i Make the Datasource = null i still see the column names. Do i have the ability to make the total grid empty and with no columns and rows . 

Thanks in advance,

Vamsi
Jayesh Goyani
Top achievements
Rank 2
 answered on 22 Sep 2014
1 answer
104 views
Hi,

I have a radgrid control that has 3 nested gridtableview within it. I'd like to
have button on the client side that expands a particular gridtableview when
clicked. I would expect it to expand all the gridtableview (i.e. 1 per row of
parent grid).

Any suggestions as to how I can set this up?
Pavlina
Telerik team
 answered on 22 Sep 2014
2 answers
312 views

Hi,

Plesae let us know how to achieve the following.

1. Avoid loading the user control in nested view template when outer grid/page loads.
2. Allow loading of user control ONLY for the expanded row of the outer grid.

Find below the source code to work on. Any prompt help on this is really appreciated.
Note: The source code really doesn't have any parent and child relation in the data that it displays because it just a sample.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="NVT._Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="PlayerDetails.ascx" TagName="PlayerDetails" TagPrefix="Player" %>
  
<!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="scriptManager" runat="server"></telerik:RadScriptManager>
        <telerik:RadGrid ID="grdPlayers" runat="server" OnNeedDataSource="GetPlayers" AutoGenerateColumns="true"
         OnItemCommand="grdPlayers_ItemCommand" OnItemCreated="grdPlayers_ItemCreated" >
            <MasterTableView>
                <NestedViewTemplate>
                    <asp:Panel runat="server" ID="InnerContainer" Visible="false">
                        <Player:PlayerDetails id="ucPlayerDetails" runat="server"></Player:PlayerDetails>
                    </asp:Panel>
                </NestedViewTemplate>
            </MasterTableView>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;
  
namespace NVT
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
  
        }
  
        protected void GetPlayers(object source, GridNeedDataSourceEventArgs e)
        {
            DataSet dsPlayers = new DataSet();
            DataTable tblPlayers = new DataTable();
            tblPlayers.Columns.Add("Name");
            tblPlayers.Columns.Add("Age");
  
            tblPlayers.Rows.Add("Sachin", "36");
            tblPlayers.Rows.Add("Virender", "30");
  
            dsPlayers.Tables.Add(tblPlayers);
  
            grdPlayers.DataSource = dsPlayers;
        }
  
        protected void grdPlayers_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName == RadGrid.ExpandCollapseCommandName && e.Item is GridDataItem)
            {
                ((GridDataItem)e.Item).ChildItem.FindControl("InnerContainer").Visible =
                    !e.Item.Expanded;
            }
        }
  
        protected void grdPlayers_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridNestedViewItem)
            {
                e.Item.FindControl("InnerContainer").Visible = ((GridNestedViewItem)e.Item).ParentItem.Expanded;
            }
        }
    }
}
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PlayerDetails.ascx.cs" Inherits="NVT.PlayerDetails" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  
<telerik:RadGrid ID="grdPlayerDetails" runat="server" AutoGenerateColumns="true">
</telerik:RadGrid>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Telerik.Web.UI;
  
namespace NVT
{
    public partial class PlayerDetails : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            GetPlayerDetails();
            grdPlayerDetails.DataBind();
        }
  
        protected void GetPlayerDetails()
        {
            DataSet dsPlayerDetails = new DataSet();
            DataTable tblPlayerDetails = new DataTable();
            tblPlayerDetails.Columns.Add("Name");
            tblPlayerDetails.Columns.Add("Age");
  
            tblPlayerDetails.Rows.Add("Sachin", "36");
            tblPlayerDetails.Rows.Add("Virender", "30");
  
            dsPlayerDetails.Tables.Add(tblPlayerDetails);
  
            grdPlayerDetails.DataSource = dsPlayerDetails;
        }
    }
}

Thanks,
Kishore

Ángel
Top achievements
Rank 1
 answered on 22 Sep 2014
3 answers
209 views
I have a RadProgressArea on the page to track a specific operation.  I find, however, when the page is posted back for an unrelated operation that it starts polling.  How would you stop it from polling on all postbacks and focus just on the specific operation I want it to?
Hristo Valyavicharski
Telerik team
 answered on 22 Sep 2014
2 answers
110 views
For Custom filtering it is only working for "No filter" option. and for any other option e.g. "EqualTo" it is not even postbacking sometime.

I am attaching my sorted list (which is according to filter options) to grid.But it is still showing  except "No filter".i.e. all over inconsistant behaviour is there. 

I am using "ItemCommand" Event. and binding all data in "needDatasource" event.
Kostadin
Telerik team
 answered on 22 Sep 2014
1 answer
344 views
I have this grid with auto generated columns and Edit/Delete buttons. Both buttons are appearing on the left of the data columns.
How can I get them one on the left and one on the right of the auto generated columns?

Thanks,
Felice

<telerik:RadGrid ID="RadGrid1" runat="server" Culture="it-IT" AllowPaging="True" AllowSorting="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True">
                <ExportSettings ExportOnlyData="True">
                    <Pdf PageWidth="">
                    </Pdf>
                </ExportSettings>
                <ClientSettings>
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                </ClientSettings>
                <MasterTableView CommandItemDisplay="Top" DataKeyNames="Code" InsertItemPageIndexAction="ShowItemOnCurrentPage">
                    <CommandItemSettings ShowExportToExcelButton="True" />
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton">
                            <HeaderStyle Width="30px" />
                        </telerik:GridEditCommandColumn>
                        <telerik:GridButtonColumn ButtonType="ImageButton" Text="Delete" CommandName="Delete" FilterControlAltText="Filter column1 column" ConfirmDialogType="RadWindow" ConfirmText="Do you really want to delete this project and all its content?" UniqueName="Cancel">
                            <HeaderStyle Width="30px" />
                        </telerik:GridButtonColumn>
                    </Columns>


                    <EditFormSettings>
                        <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn>
                    </EditFormSettings>
                    <PagerStyle AlwaysVisible="True" />
                </MasterTableView>
                <PagerStyle AlwaysVisible="True" />
            </telerik:RadGrid>
Pavlina
Telerik team
 answered on 22 Sep 2014
3 answers
177 views
With respect to the attached image, I would like to adjust toolbar button formatting to match the panel bar.

For each I have applied CSS to adjust the default Metro Touch background colors. The toolbar includes additional borders or effects that I would like to go away, or at least be the same color as the background. Border color is obviously not the correct answer.

.rpExpanded {
    background-color:#3586CE  !important;
}
 
.rpSelected {
    background-color:#3586CE  !important;
}
 
.wwgToolbar {
      background-color:#3586CE  !important;
border-color:#3586CE  !important;
}


Dimitar
Telerik team
 answered on 22 Sep 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?