Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
186 views
Hello;

I am trying to use the AjaxLoading Panel when I use a calendar control event which when the date is selected, opens a new window to display the results of the query based on the date selected and leaves the parent window open in the background. I want the loading to be displayed on the parent window until the new window is rendered.

Thanks,
Keith 
Konstantin Petkov
Telerik team
 answered on 16 Sep 2008
1 answer
153 views
Hi,

Just download RADControls , trial version for company evaluation.
I'm following the steps "Integrating RAD Controls in MOSS" and have rechecked everything to be correct.

On the step to show RADMenu in our Sharepoint Site, ie  "Incorporating RadControls for ASP.NET Ajax in MOSS WebSites" the Sharepoint Designer successfully renders the page when I make the changes to default.master

However when i go to the actual sharepoint site I get the infamous Sharepoint message

"An error occurred during the processing of /sites/gordon_rto/_catalogs/masterpage/default.master. The server tag is not well formed.
"

I have rechecked my steps but the result is the same.

Thanks in Advance

Gordon
Atanas Korchev
Telerik team
 answered on 16 Sep 2008
1 answer
117 views
hi
i have masterpaged page ,
in master page i have menu with some items...
when i open one radwindow in my page(default.aspx)
then rad window opens under menu!(men shows over mywindow)
why?
tnx
Atanas Korchev
Telerik team
 answered on 16 Sep 2008
1 answer
165 views
How do I disable a RadDateTimePicker on the client side via java script?

Thanks,
Brian
Daniel
Telerik team
 answered on 16 Sep 2008
1 answer
105 views
Hello please have a look on the same and give a reply on that

am having a heirarchial grid(2 level). am using Object data source for binding data.when we click on the expand button .i need the client side event so that i can get the data key values at client side itself. please tell me the event name for getting that

regards
Mathews Baby
Shinu
Top achievements
Rank 2
 answered on 16 Sep 2008
5 answers
396 views

Hi,

        I am getting  error "Microsoft JScript runtime error: Object expected" when i click on button in ragGrid.Steps are below to reproduce below:

I created radtabstrip and loading user control dynamically.

I am displaying record in radgrid which is present in usercontrol.
User can add/Edit or delete the record from grid.
For that  i place button in Command item template  to Add new record. It will popup radwindow when user click on button.

I am getting java script error "Microsoft JScript runtime error: Object expected" and no clue why it is happening.

Below is my Code for main page, User Control and Rad Window page.

Can you please help me to resolve this issue?

Main Page:

<%

@ Page Language="C#" MasterPageFile="~/DealerFinance.master" AutoEventWireup="true"

CodeFile="DealerDetails.aspx.cs" Inherits="Dealer_DealerDetails" Title="Untitled Page" %>

<%

@ MasterType VirtualPath="~/DealerFinance.master" %>

<%

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

<%

@ Register TagPrefix="uc1" TagName="ucDealer" Src="Dealer.ascx" %>

<%

@ Register TagPrefix="uc2" TagName="ucVehicles" Src="Vehicles.ascx" %>

<%

@ Register TagPrefix="uc3" TagName="ucNotes" Src="Notes.ascx" %>

<%

@ Register TagPrefix="uc4" TagName="ucActivities" Src="Activities.ascx" %>

<%

@ Register TagPrefix="uc5" TagName="ucContacts" Src="Contacts.ascx" %>

<%

@ Register TagPrefix="uc6" TagName="ucCollaterals" Src="Collaterals.ascx" %>

<%

@ Register TagPrefix="uc7" TagName="ucBalance" Src="Balance.ascx" %>

<%

@ Register TagPrefix="uc8" TagName="ucInvoice" Src="Invoice.ascx" %>

<%

@ Register TagPrefix="uc9" TagName="ucAudit" Src="Audit.ascx" %>

<%

@ Register TagPrefix="uc10" TagName="ucPayments" Src="Payments.ascx" %>

<

asp:Content ID="Content2" ContentPlaceHolderID="DealerFinancePlaceHolder" runat="Server">

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

<AjaxSettings>

<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="rtsDealerDetails" />

</UpdatedControls>

</telerik:AjaxSetting>

<telerik:AjaxSetting AjaxControlID="rtsDealerDetails">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="pnlDealerDetails" />

</UpdatedControls>

</telerik:AjaxSetting>

</AjaxSettings>

</telerik:RadAjaxManager>

<table width="100%">

<tr>

<td align="center" class="moduleborder">

<table align="center">

<tr>

<td align="left">

<table width="50%">

<tr>

<td align="right" nowrap="nowrap" class="labelDisp">

<%

# Resources.DealerFinance.DealerNumber %>

</td>

<td align="left" nowrap="nowrap">

<asp:Label ID="lblDealerNumber" runat="server" SkinID="DisplayNormal">1005</asp:Label>

</td>

</tr>

<tr>

<td align="right" nowrap="nowrap" class="labelDisp">

<%

# Resources.DealerFinance.LegalName%>

</td>

<td nowrap="nowrap" align="left">

<asp:Label ID="lblLegalName" runat="server" SkinID="DisplayNormal">Kawasaki Legal Name </asp:Label>

</td>

</tr>

<tr>

<td align="right" nowrap="nowrap" class="labelDisp">

<%

# Resources.DealerFinance.Address%>

</td>

<td nowrap="nowrap" align="left">

<asp:Label ID="lblAddress" runat="server" SkinID="DisplayNormal">900 Irvine Blvd dkgjsjfd sfdjl </asp:Label>

</td>

</tr>

<tr>

<td align="right" nowrap="nowrap" class="labelDisp">

<%

# Resources.DealerFinance.Address%>

</td>

<td nowrap="nowrap" align="left">

<asp:Label ID="Label1" runat="server" SkinID="DisplayNormal">Righr Place Holder</asp:Label>

</td>

</tr>

<tr>

<td align="right" nowrap="nowrap" class="labelDisp">

<%

#Resources.DealerFinance.Address%>

</td>

<td nowrap="nowrap" align="left">

<asp:Label ID="Label2" runat="server" SkinID="DisplayNormal">Right Place Holder</asp:Label>

</td>

</tr>

</table>

</td>

<td align="left">

<table width="50%">

<tr>

<td align="right" nowrap="nowrap" class="labelDisp">

<%

# Resources.DealerFinance.DealerName %>

</td>

<td nowrap="nowrap" align="left">

<asp:Label ID="lblDealerName" runat="server" SkinID="DisplayNormal">Kawasaki Dealer Name</asp:Label>

</td>

</tr>

<tr>

<td align="right" nowrap="nowrap" class="labelDisp">

<%

# Resources.DealerFinance.KawasakiName %>

</td>

<td nowrap="nowrap" align="left">

<asp:Label ID="lblKawasakiName" runat="server" SkinID="DisplayNormal">Kawasaki</asp:Label>

</td>

</tr>

<tr>

<td align="right" nowrap="nowrap" class="labelDisp">

<%

# Resources.DealerFinance.StateCityZip %>

</td>

<td nowrap="nowrap" align="left">

<asp:Label ID="lblStateCityZip" runat="server" SkinID="DisplayNormal">Irvine, CA 92602</asp:Label>

</td>

</tr>

<tr>

<td align="right" nowrap="nowrap" class="labelDisp">

<%

# Resources.DealerFinance.Address%>

</td>

<td nowrap="nowrap" align="left">

<asp:Label ID="Label3" runat="server" SkinID="DisplayNormal">Left Place Holder</asp:Label>

</td>

</tr>

<tr>

<td align="right" nowrap="nowrap" class="labelDisp">

<%

# Resources.DealerFinance.Address%>

</td>

<td nowrap="nowrap" align="left">

<asp:Label ID="Label4" runat="server" SkinID="DisplayNormal">Left Place Holder</asp:Label>

</td>

</tr>

</table>

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td align="center">

<telerik:RadTabStrip ID="rtsDealerDetails" runat="server"

Skin="Web20" AutoPostBack="True" SelectedIndex="9" >

<Tabs>

<telerik:RadTab Text="Details" />

<telerik:RadTab Text="Vehicles" />

<telerik:RadTab Text="Notes" >

<Tabs>

<telerik:RadTab Text="KMFC" />

<telerik:RadTab Text="KMC" />

<telerik:RadTab Text="Special" />

<telerik:RadTab Text="Flash" />

</Tabs>

</telerik:RadTab>

<telerik:RadTab Text="Activities" />

<telerik:RadTab Text="Contacts" />

<telerik:RadTab Text="Collaterals" />

<telerik:RadTab Text="Balance" />

<telerik:RadTab Text="Invoice" />

<telerik:RadTab Text="Audit" />

<telerik:RadTab Text="Payments" Selected="True" />

</Tabs>

</telerik:RadTabStrip>

</td>

</tr>

<tr>

<td>

<telerik:RadAjaxPanel ID="pnlDealerDetails" runat="server"></telerik:RadAjaxPanel>

</td>

</tr>

</table>

</

asp:Content>

Code behind :

using

System;

using

System.Collections;

using

System.Configuration;

using

System.Data;

using

System.Linq;

using

System.Web;

using

System.Web.Security;

using

System.Web.UI;

using

System.Web.UI.HtmlControls;

using

System.Web.UI.WebControls;

using

System.Web.UI.WebControls.WebParts;

using

System.Xml.Linq;

using

Telerik.Web.UI;

public

partial class Dealer_DealerDetails : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

// rtsDealerDetails.MultiPageID = dealerDetailpages.UniqueID;

Master.SelectedDealerTab = 1;

if (!IsPostBack)

{

rtsDealerDetails.SelectedIndex = 0;

//Response.Write(rtsDealerDetails.SelectedTab.Text);

}

switch (rtsDealerDetails.SelectedIndex)

{

case 0:

//LoadUserControl("Dealer.ascx");

LoadUserControl(

"Dealer.ascx");

break;

case 1:

LoadUserControl(

"Vehicles.ascx");

break;

case 2:

LoadUserControl(

"Notes.ascx");

//LoadControl

break;

}

}

protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)

{

 

if (e.Argument == "Rebind")

{

//if (rtsDealerDetails.SelectedTab.Text.Equals("Notes"))

//{

// rtsDealerDetails.SelectedTab.Tabs.se

//}

//grdDealerList.MasterTableView.SortExpressions.Clear();

//grdDealerList.MasterTableView.GroupByExpressions.Clear();

//grdDealerList.DataSource = BindGrid();

//grdDealerList.Rebind();

}

}

public RadTabStrip DealerDetailsTab

{

get

{

return rtsDealerDetails;

}

set

{

}

}

 

public void LoadUserControl(string controlName)

{

if (LatestLoadedControlName != null)

{

Control previousControl = pnlDealerDetails.FindControl(LatestLoadedControlName.Split('.')[0]);

if (previousControl != null)

{

this.pnlDealerDetails.Controls.Remove(previousControl);

}

pnlDealerDetails.Controls.Clear();

}

string userControlID = controlName.Split('.')[0];

Control targetControl = pnlDealerDetails.FindControl(userControlID);

if (targetControl == null)

{

UserControl userControl = (UserControl)this.LoadControl(controlName);

//slashes and tildes are forbidden

userControl.ID = userControlID.Replace(

"/", "").Replace("~", "");

this.pnlDealerDetails.Controls.Add(userControl);

LatestLoadedControlName = controlName;

}

}

 

private string LatestLoadedControlName

{

get

{

return (string)Session["LatestLoadedControlName"];

}

set

{

Session[

"LatestLoadedControlName"] = value;

}

}

}

User Control :

<%

@ Control Language="C#" AutoEventWireup="true" CodeFile="Notes.ascx.cs" Inherits="Dealer_Notes" %>

<%

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

<

telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

<script type="text/javascript">

function ShowEditForm(id, rowIndex)

{

var grid = $find("<%= grdNotes.ClientID %>");

var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();

grid.get_masterTableView().selectItem(rowControl,

true);

window.radopen(

"AddEditNotes.aspx", "Add/Edit Notes");

return false;

}

function ShowInsertForm(searchType)

{

window.radopen(

"AddEditNotes.aspx", "Add/Edit Notes");

return false;

}

function refreshGrid(arg)

{

if(!arg)

{

$find(

"<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("Rebind");

}

else

{

$find(

"<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("RebindAndNavigate");

}

}

</script>

</telerik:RadCodeBlock>

<telerik:RadAjaxManagerProxy ID="radAjaxProxy" runat="server" >

<AjaxSettings>

<telerik:AjaxSetting AjaxControlID="radAjaxProxy">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="rtsDealerDetails" />

</UpdatedControls>

</telerik:AjaxSetting>

</AjaxSettings>

</telerik:RadAjaxManagerProxy>

<table>

<tr>

<td align="left">

<!-- <asp:Button ID="tempbtnSearch" runat="server" CausesValidation="false" OnClientClick="LookupParameter()" SkinID="DisplayButton"

Text="Search" /> -->

<!-- <asp:Button ID="btnSearch" runat="server" CausesValidation="false" SkinID="DisplayButton"

OnClientClick = "return ShowInsertForm();" Text="Search" /> -->

&nbsp;

</td>

</tr>

<tr>

<td>

<asp:Button ID="btnAddaa" runat="server" CausesValidation="false" SkinID="DisplayButton"

OnClientClick="return ShowInsertForm('DealersSearch');"

Text=" Add " onclick="btnAddaa_Click" /> &nbsp;

<telerik:RadGrid

ID="grdNotes"

runat="server"

AllowPaging="True"

AllowSorting="True"

PageSize="10"

GridLines="None"

OnItemCommand="RadGrid1_ItemCommand"

OnNeedDataSource="RadGrid1_NeedDataSource"

EnableAJAX="true"

Skin="Vista"

ShowFooter="false"

ShowStatusBar = "false"

>

<PagerStyle Mode="NumericPages" />

<MasterTableView

AutoGenerateColumns="False"

DataKeyNames="ROW_ID,DEALER_NUM"

Width="100%"

CommandItemDisplay="Top"

PageSize="15">

<Columns>

<telerik:GridButtonColumn

DataTextField="DEALER_ID"

CommandArgument="DEALER_ID"

HeaderText="Edit/Delete"

CommandName="Select"

DataTextFormatString = "<nobr>{0}</nobr>"

SortExpression="ROW_ID,DEALER_ID"

ItemStyle-CssClass= "RadGridItemTemplate"

HeaderStyle-Wrap = "false" >

</telerik:GridButtonColumn>

<telerik:GridBoundColumn

DataField="NOTES"

HeaderText="Notes"

ReadOnly="True"

SortExpression="NOTES"

UniqueName="NOTES"

DataFormatString = "<nobr>{0}</nobr>">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn

DataField="START_DT"

HeaderText="Start Date"

SortExpression="START_DT"

UniqueName="START_DT"

DataFormatString = "<nobr>{0}</nobr>">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn

DataField="END_DT"

HeaderText="End Date"

SortExpression="END_DT"

UniqueName="END_DT"

DataFormatString = "<nobr>{0}</nobr>">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn

DataField="DURATION"

HeaderText="Duration"

SortExpression="DURATION"

UniqueName="DURATION"

DataFormatString = "<nobr>{0}</nobr>">

</telerik:GridBoundColumn>

</Columns>

<CommandItemTemplate>

<asp:Button ID="btnAdd" runat="server" CausesValidation="false" SkinID="DisplayButton"

OnClientClick="return ShowInsertForm('DealersSearch');" Text=" Add " /> &nbsp;

</CommandItemTemplate>

</MasterTableView>

</telerik:RadGrid>

</td>

</tr>

</table>

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Width="625px" Skin="Mac" Height="400px" Left="550px" >

<Windows >

<telerik:RadWindow ID="windowDealerSearch" runat="server" Title="Dealer Search"

ReloadOnShow="true" visiblestatusbar="false"

></telerik:RadWindow>

</Windows>

</telerik:RadWindowManager>


Code Bebind:



using

System;

using

System.Collections;

using

System.Configuration;

using

System.Data;

using

System.Linq;

using

System.Web;

using

System.Web.Security;

using

System.Web.UI;

using

System.Web.UI.HtmlControls;

using

System.Web.UI.WebControls;

using

System.Web.UI.WebControls.WebParts;

using

System.Xml.Linq;

using

Telerik.Web.UI;

using

System.Data.SqlClient;

public

partial class Dealer_Notes : System.Web.UI.UserControl

{

protected void Page_Load(object sender, EventArgs e)

{

if (!IsPostBack)

{

}

}

protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

{

grdNotes.DataSource = BindGrid();

}

protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)

{

if (e.Argument == "Rebind")

{

grdNotes.MasterTableView.SortExpressions.Clear();

grdNotes.MasterTableView.GroupByExpressions.Clear();

grdNotes.DataSource = BindGrid();

grdNotes.Rebind();

}

}

protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)

{

if (e.CommandName == "Select")

{

GridDataItem dataItem = (GridDataItem)e.Item;

string strTxt = dataItem.GetDataKeyValue("ROW_ID").ToString();

string rowID = dataItem.GetDataKeyValue("DEALER_NUM").ToString();

}

}

private DataTable BindGrid()

{

string searchCondition = "";

string sql = "";

//grdDealerList.DataSource = null;

DealSearchFields dealerSeachFieldsObj = (DealSearchFields)Session["DealerSearchFields"];

if (dealerSeachFieldsObj != null)

{

searchCondition = dealerSeachFieldsObj.DealerNumber;

}

else

{

searchCondition =

"";

}

if (searchCondition.Length > 0)

{

sql =

"SELECT ROW_ID ,DEALER_ID ,AREA, TYPE, STATUS, NOTES,START_DT,END_DT,DURATION FROM KF_NOTES_DL where DEALER_ID = '" + searchCondition + "%' order by START_DT";

}

else

{

sql =

"SELECT ROW_ID ,DEALER_ID ,AREA, TYPE, STATUS, NOTES,START_DT,END_DT,DURATION FROM KF_NOTES_DL order by START_DT";

}

SqlDataAdapter adapter = new SqlDataAdapter(sql,

ConfigurationManager.ConnectionStrings["KC_DealerFinanceConnectionString"].ConnectionString);

DataTable dt = new DataTable();

adapter.Fill(dt);

return dt;

}

public DataTable NotesTable

{

get

{

return BindGrid();

}

set { }

}

public RadGrid NotesGrid

{

get

{

return grdNotes;

}

set

{

grdNotes =

value;

}

}

protected void btnAddaa_Click(object sender, EventArgs e)

{

}

}



Rad Window Page :


<%

@ Page Language="C#" AutoEventWireup="true" CodeFile="AddEditNotes.aspx.cs" Inherits="Dealer_AddEditNotes" %>

<!

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<

html xmlns="http://www.w3.org/1999/xhtml">

<

head runat="server">

<title>Untitled Page</title>

<script language="javascript" type="text/javascript">

function CloseAndRebind(args)

{

GetRadWindow().Close();

GetRadWindow().BrowserWindow.refreshGrid(args);

}

function GetRadWindow()

{

var oWindow = null;

if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog

else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz as well)

return oWindow;

}

function CancelEdit()

{

GetRadWindow().Close();

}

function SelectAgency(code, name)

{

window.close();

window.opener.ParentFormPostBack(

'','');

window.opener.focus();

}

</script>

</

head>

<

body>

<form id="form1" runat="server">

<asp:Label ID="InjectScript" runat="server"></asp:Label>

<br />

<table >

<tr align="center" >

<td align="center" nowrap="nowrap" colspan="3" >

<div class="TitleTextNormal" > <%=Resources.DealerFinance.NotesAddEdit%> </div>

</td>

</tr>

<tr>

<td height="10px" align="center" nowrap="nowrap" colspan="3" >

</td>

</tr>

<tr>

<td align="right" nowrap="nowrap" class="labelDisp">

<%

=Resources.DealerFinance.DealerNumber%>

</td>

<td align="left">

<asp:Label ID = "lblLegalName" runat="server" SkinID="DisplayNormal">Kawasaki Legal Name </asp:Label>

</td>

<td align="right" width="10px">

</td>

</tr>

<tr>

<td align="right" nowrap="nowrap" class="labelDisp">

<%

=Resources.DealerFinance.Employee%>

</td>

<td align="left">

<asp:Label ID = "Label1" runat="server" SkinID="DisplayNormal">Kawasaki Legal Name </asp:Label>

</td>

<td align="right" width="10px">

</td>

</tr>

<tr>

<td align="right" nowrap="nowrap" class="labelDisp">

<%

=Resources.DealerFinance.StartDate%>

</td>

<td align="left">

<asp:Label ID = "Label2" runat="server" SkinID="DisplayNormal">11/8/2007 </asp:Label>

</td>

<td align="right" width="10px">

</td>

</tr>

<tr>

<td align="right" nowrap="nowrap" class="labelDisp">

<%

=Resources.DealerFinance.EndDate %>

</td>

<td align="left">

<asp:Label ID = "Label3" runat="server" SkinID="DisplayNormal">12/8/2007 </asp:Label>

</td>

<td align="right" width="10px">

</td>

</tr>

<tr>

<td align="right" nowrap="nowrap">

<%

=Resources.DealerFinance.Notes%>

</td>

<td align="left">

<asp:TextBox ID="txtNotes" runat="server" MaxLength="600" TextMode="MultiLine" Columns="45" Rows="10" Wrap="true"></asp:TextBox>

</td>

<td align="right" width="10px">

</td>

</tr>

<tr>

<td align="center" colspan="2">

<br />

<asp:Button ID="btnSave" runat="server" CausesValidation="false" OnClick="btnSave_Click"

SkinID="DisplayButton" Text=" Save " />

<asp:Button ID="btnDelete" runat="server" CausesValidation="false" OnClick="btnDelete_Click"

SkinID="DisplayButton" Text=" Delete " />

<asp:Button ID="btnCancel" runat="server" CausesValidation="false" OnClick="btnCancel_Click"

SkinID="DisplayButton" Text="Cancel" />

</td>

<td align="right" width="10px">

</td>

</tr>

</table>

</form>

</

body>

</

html>


Code Behind:

using

System;

using

System.Collections;

using

System.Configuration;

using

System.Data;

using

System.Linq;

using

System.Web;

using

System.Web.Security;

using

System.Web.UI;

using

System.Web.UI.HtmlControls;

using

System.Web.UI.WebControls;

using

System.Web.UI.WebControls.WebParts;

using

System.Xml.Linq;

public

partial class Dealer_AddEditNotes : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

}

 

protected void btnCancel_Click(object sender, EventArgs e)

{

ClientScript.RegisterStartupScript(Page.GetType(),

"mykey", "CancelEdit();", true);

}

protected void btnDelete_Click(object sender, EventArgs e)

{

ClientScript.RegisterStartupScript(Page.GetType(),

"mykey", "CloseAndRebind();", true);

}

protected void btnSave_Click(object sender, EventArgs e)

{

ClientScript.RegisterStartupScript(Page.GetType(),

"mykey", "CloseAndRebind();", true);

}

}

Paul
Telerik team
 answered on 16 Sep 2008
3 answers
265 views
I'm having a problem with RadGrid column filtering.  I have a grid that I have set AutoGenerateColumns = False, and I am dynamically building the bound columns in the code-behind... an example of one of the columns follows:
                    case "Numeric"
                        GridNumericColumn numericCol = new GridNumericColumn(); 
                        RadGrid1.MasterTableView.Columns.Add(numericCol); 
                        numericCol.HeaderText = GridSchema.ColumnHeadersSplit[i].ToString(); 
                        numericCol.DataField = GridSchema.ColumnNamesSplit[i].ToString(); 
                        numericCol.UniqueName = GridSchema.ColumnNamesSplit[i].ToString(); 
                        numericCol.Reorderable = true
                        numericCol.ConvertEmptyStringToNull = true
                        numericCol.DataFormatString = GridSchema.ColumnFormatsSplit[i].ToString(); 
                        numericCol.FooterAggregateFormatString = GridSchema.ColumnFormatsSplit[i].ToString(); 
                        if (GridSchema.ColumnAggregateFormatSplit[i].ToString() == string.Empty) 
                        { numericCol.Aggregate = (GridAggregateFunction)Enum.Parse(typeof(GridAggregateFunction), "None"); } 
                        else 
                        { numericCol.Aggregate = (GridAggregateFunction)Enum.Parse(typeof(GridAggregateFunction), GridSchema.ColumnAggregateFormatSplit[i].ToString()); } 
                        numericCol.AllowFiltering = (Boolean)Convert.ToBoolean(Convert.ToInt32(GridSchema.ColumnAllowFilteringSplit[i].ToString())); 
                        numericCol.Groupable = (Boolean)Convert.ToBoolean(Convert.ToInt32(GridSchema.ColumnAllowGroupingSplit[i].ToString())); 
                        numericCol.AllowSorting = (Boolean)Convert.ToBoolean(Convert.ToInt32(GridSchema.ColumnAllowSortingSplit[i].ToString())); 
                        numericCol.Visible = (Boolean)Convert.ToBoolean(Convert.ToInt32(GridSchema.ColumnVisibleSplit[i].ToString())); 
                        break

My RadGrid is bound to an ObjectDataSource which exposes a DataTable as follows:
        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="ObjectDataSource1" GridLines="None" 
            AllowFilteringByColumn="True" AutoGenerateColumns="False"
            <MasterTableView DataSourceID="ObjectDataSource1"
                <RowIndicatorColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </RowIndicatorColumn> 
                <ExpandCollapseColumn> 
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </ExpandCollapseColumn> 
            </MasterTableView> 
            <ClientSettings AllowColumnsReorder="True" ColumnsReorderMethod="Reorder"
            </ClientSettings> 
            <FilterMenu EnableTheming="True"
                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
            </FilterMenu> 
        </telerik:RadGrid> 
 

The problem occurs when I try to do client-side drag-and-drop reordering of the columns, with AJAX and filtering enabled.  I end up getting a Javascript error: "Error: Sys.ArgumentException: Value must not be null for Controls and Behaviors. Parameter name: element"

However, if I set AutoGenerateColumns = True and bypass my dynamic column generation code, everything works OK.

My question is... what am I missing when I create my own columns dynamically?  What properties are being set when AutoGenerateColumns = True that I need to reproduce dynamically in order to allow this to work?

Thanks in advance.

Pavel
Telerik team
 answered on 16 Sep 2008
1 answer
180 views
hello All
Am using the below style sheet for my menu control.i want my menu not to be scrolled when my size of the page increases.tell me where should i make change in the style sheet for not scolling when size of the page increases.

/* RadMenu Vista skin */

.RadMenu_Vista

{

/*

border: 1px solid #d1d5e0;

border-top-width: 0;

border-bottom-color: #b6bccc;

background: #d7def0 url("Img/rootBackground.gif") repeat-x top left; */

background: url("Img/groupBg.gif") repeat-x top left;

border-top:1px solid #032941;

}

.RadMenu_Vista_rtl

{

text-align: right;

}

.RadMenu_Vista

.group

{

border: 1px solid #979797;

background: #4b92aa url("Img/submenuBackground.gif") repeat-y 27px 0;

padding: 3px 0;

}

.RadMenu_Vista_rtl

.group

{

/* background: #f0f0f0 url("Img/submenuBackgroundRtl.gif") repeat-y top right;*/

background: #d7def0 url("Img/groupBg.gif") repeat-x top left;

}

.RadMenu_Vista

.group .horizontal

{

background: #f0f0f0;

}

.RadMenu_Vista

.group .item

{

padding-left: 1px;

}

.RadMenu_Vista_rtl

.group .item

{

padding-right: 1px;

}

.RadMenu_Vista

.link

{

color: #fff;

text-decoration: none;

font:11px/14px "segoe ui",arial,sans-serif;

height: 18px;

position: relative;

display: inline-block !important;

}

.RadMenu_Vista

.link:focused,

.RadMenu_Vista

.focused

{

outline: 0;

}

.RadMenu_Vista

.rootGroup .text

{

margin: 0 0 0 6px;

padding: 0 6px 0 0;

}

.RadMenu_Vista

.vertical .text

{

margin: 0 0 0 6px;

padding: 0 48px 0 0;

}

.RadMenu_Vista

.horizontal .text

{

padding: 0 6px 0 0;

}

.RadMenu_Vista

.horizontal .vertical .text

{

padding: 0 48px 0 0;

}

.RadMenu_Vista_rtl

.rootGroup .text

{

margin: 0 6px 0 0;

padding: 0 0 0 6px;

}

.RadMenu_Vista_rtl

.vertical .text

{

margin: 0 6px 0 0;

padding: 0 0 0 48px;

}

.RadMenu_Vista_rtl

.horizontal .text

{

padding: 0 0 0 6px;

}

.RadMenu_Vista_rtl

.horizontal .group .text

{

padding: 0 0 0 48px;

}

.RadMenu_Vista

.rootGroup .expanded

{

background: transparent url("Img/rootSelected.gif") no-repeat 2px 0;

}

.RadMenu_Vista

.rootGroup .expanded .text

{

background: transparent url("Img/rootSelected.gif") no-repeat top right;

}

.RadMenu_Vista_rtl

.rootGroup .expanded

{

background: transparent url("Img/rootSelected.gif") no-repeat right top;

}

.RadMenu_Vista_rtl

.rootGroup .expanded .text

{

background: transparent url("Img/rootSelected.gif") no-repeat top left;

}

.RadMenu_Vista

.rootGroup .link:hover,

.RadMenu_Vista

.rootGroup .link:focus

{

background: transparent url("Img/rootHovered.gif") no-repeat 2px 0;

}

.RadMenu_Vista

.rootGroup .link:hover .text,

.RadMenu_Vista

.rootGroup .link:focus .text

{

background: transparent url("Img/rootHovered.gif") no-repeat top right;

}

.RadMenu_Vista_rtl

.rootGroup .link:hover,

.RadMenu_Vista_rtl

.rootGroup .link:focus

{

background: transparent url("Img/rootHovered.gif") no-repeat right top;

}

.RadMenu_Vista_rtl

.rootGroup .link:hover .text,

.RadMenu_Vista_rtl

.rootGroup .link:focus .text

{

background: transparent url("Img/groupBg.gif") no-repeat top left;

}

.RadMenu_Vista

.group .slide

{

margin: -1px 0 0 -5px;

}

.RadMenu_Vista_rtl

.group .slide

{

margin: -1px -5px 0 0;

}

.RadMenu_Vista

.group .link

{

padding: 0 0 0 31px;

margin: 0 2px 0 0;

height: 22px;

line-height: 22px;

}

.RadMenu_Vista

.group .horizontal .link

{

padding-left: 2px;

}

.RadMenu_Vista_rtl

.group .link

{

padding: 0 31px 0 0;

margin: 0;

}

.RadMenu_Vista_rtl

.group .horizontal .link

{

padding: 0 2px 0 0;

}

.RadMenu_Vista

.group .link .text

{

padding-top: 2px;

padding-bottom: 2px;

line-height: 18px;

}

.RadMenu_Vista

.group .link:hover,

.RadMenu_Vista

.group .expanded

{

background: transparent url("Img/rootHovered.gif") no-repeat top left;

}

.RadMenu_Vista

.group .link:hover .text,

.RadMenu_Vista

.group .expanded .text

{

background: transparent url("Img/rootHovered.gif") no-repeat top right;

}

.RadMenu_Vista_rtl

.group .link:hover,

.RadMenu_Vista_rtl

.group .expanded

{

background-position: top right;

}

.RadMenu_Vista_rtl

.group .link:hover .text,

.RadMenu_Vista_rtl

.group .expanded .text

{

background-position: top left;

}

.RadMenu_Vista

.group .expandLeft

{

background: transparent url("Img/submenuExpandable.gif") no-repeat top right;

}

.RadMenu_Vista

.group .link:hover .expandLeft,

.RadMenu_Vista

.group .expanded .expandLeft,

.RadMenu_Vista

.group .link:hover .expandRight,

.RadMenu_Vista

.group .expanded .expandRight

{

background-image: url("Img/rootHovered.gif");

}

.RadMenu_Vista

.group .expandRight

{

background: transparent url("Img/submenuExpandableRtl.gif") no-repeat top left;

}

.RadMenu_Vista

.group .disabled,

.RadMenu_Vista

.rootGroup .disabled

{

color: #999;

}

.RadMenu_Vista

.group .disabled:hover,

.RadMenu_Vista

.rootGroup .disabled:hover,

.RadMenu_Vista

.group .disabled:hover .text,

.RadMenu_Vista

.rootGroup .disabled:hover .text

{

background-image: none;

}

.RadMenu_Vista

.topArrowDisabled,

.RadMenu_Vista

.bottomArrowDisabled,

.RadMenu_Vista

.leftArrowDisabled,

.RadMenu_Vista

.rightArrowDisabled

{

display: none;

}

.RadMenu_Vista

.topArrow,

.RadMenu_Vista

.bottomArrow,

.RadMenu_Vista

.leftArrow,

.RadMenu_Vista

.rightArrow

{

font-size: 0;

color: #979797;

line-height: 0;

}

.RadMenu_Vista

.topArrow,

.RadMenu_Vista

.bottomArrow

{

height: 10px;

width: 100%;

background: #fff url("Img/scrollArrowUpDown.gif") no-repeat top center;

}

.RadMenu_Vista

.bottomArrow

{

background-position: center -1px;

}

.RadMenu_Vista

.leftArrow,

.RadMenu_Vista

.rightArrow

{

width: 10px;

height: 100%;

background: #fff url("Img/scrollArrowLeftRight.gif") no-repeat left center;

}

.RadMenu_Vista

.rightArrow

{

background-position: -18px center;

}

Reply Expecting soon
Thanks & Regards
Mathews
Rumana
Top achievements
Rank 1
 answered on 16 Sep 2008
0 answers
83 views
Hello,
Iwant to use RadUpload like this link
http://demos.telerik.com/ASPNET/Prometheus/Upload/Examples/AdditionalFields/DefaultCS.aspx
but i want only one text box that should appear after the radUpload File Choose in the same row.
It will be the sequence
RadUpload File choose > additional textBox > Remove botton
it should be in one row.
i have tried so much to do that but failed.
how can i do that.
Thanks.
altaf
Top achievements
Rank 1
 asked on 16 Sep 2008
0 answers
152 views

Just a quick note to let everyone know of a possible problem when using a web service to populate the tree-view.

We had the case where we were trying to populate one level of the tree view (from a web service), and we recieved the error message "Maximum length exceeded" from Internet Explorer - no code source or break-point was able to catch where it happened.  Turns out it is just a common problem with web services - they return the data as XML, and if it is larger than the default limit, then this error is returned.

The solution is to extend the maxJsonLength, by adding the following section to your web.config file, at the configuration level, after the system.web node.  (This is assuming you already have the jsonSerialization section in the configSections part of the web.config file)

<

system.web.extensions>
    <
scripting>
        <
webServices>
            <
jsonSerialization maxJsonLength="5000000" />
        </
webServices>
    </
scripting>
</
system.web.extensions>

Hope this helps someone else who has the same issue.

Luan
Top achievements
Rank 1
 asked on 16 Sep 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?