Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
277 views
Hi All,

I am facing a wierd issues.

Requirement:
1. On selecting anything in the dropdown list, grid and description panel should be updated. (As of now i am displaying the id in the description panel)
2. On selecting any row in the grid, description panel should be updated.

I have a web part which loads user control as given below.

protected

 

override void CreateChildControls()

 

{

 

base.CreateChildControls();

 

userControl = Page.LoadControl(

@"~\_layouts\UserControls\RadGridDemo.ascx");

 

Controls.Add(userControl);

}

In the user control, I have a drop down list, RadGrid and descriptionPanel controls defined as below.

<%

@ Control Language="C#" ClassName="RadGridDemo" %>

 

<%

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

 

<%

@ Import Namespace="System" %>

 

<%

@ Import Namespace="System.Data" %>

 

<%

@ Import Namespace="Telerik.Web.UI" %>

 

<

 

div>

 

 

<div>

 

 

<asp:PlaceHolder ID="Pl" runat="server">

 

 

<telerik:RadAjaxManager ID="AjaxManager" runat="server">

 

 

<ajaxsettings>

 

 

<telerik:AjaxSetting AjaxControlID="MyTrainingDDList">

 

 

<UpdatedControls>

 

<%

-- <telerik:AjaxUpdatedControl ControlID="Grid1" />--%>

 

 

<telerik:AjaxUpdatedControl ControlID="DescPanel" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

<telerik:AjaxSetting AjaxControlID="Grid1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="DescPanel" />

 

 

<telerik:AjaxUpdatedControl ControlID="Grid1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</ajaxsettings>

 

 

</telerik:RadAjaxManager>

 

 

<asp:DropDownList ID="DDList" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DDList_SelectedIndexChanged">

 

 

<asp:ListItem Text="Customers" Selected="True"></asp:ListItem>

 

 

<asp:ListItem Text="Employees"></asp:ListItem>

 

 

</asp:DropDownList>

 

 

<telerik:RadGrid runat="server" ID="Grid1" OnSelectedIndexChanged="Grid1_SelectedIndexChanged">

 

 

<clientsettings enablerowhoverstyle="true" enablepostbackonrowclick="true" allowexpandcollapse="true">

 

 

<Selecting AllowRowSelect="True"></Selecting>

 

 

</clientsettings>

 

 

</telerik:RadGrid>

 

 

</asp:PlaceHolder>

 

 

</div>

 

 

<div id="DescPanel" runat="server">

 

 

<asp:Label ID="lblName" runat="server">

 

 

</asp:Label>

 

 

</div>

 

</

 

div>

 

<

 

script runat="server">

 

 

 

int trainingId = 0;

 

 

DataSet ds = null;

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

if (!IsPostBack)

 

{

Grid1.MasterTableView.DataKeyNames =

new String[] { "ID" };

 

SetData(0);

}

}

 

private void SetData(int index)

 

{

 

DataTable dt;

 

 

if (index == 0)

 

dt = GetCustomers();

 

else

 

dt = GetEmployees();

Grid1.DataSource = dt;

Grid1.Rebind();

 

if (Grid1.Items.Count > 0)

 

{

Grid1.SelectedIndexes.Add(0);

trainingId =

int.Parse(Grid1.MasterTableView.DataKeyValues[0]["ID"].ToString());

 

lblName.Text = trainingId.ToString();

}

 

else

 

lblName.Text =

"";

 

}

 

private DataTable GetEmployees()

 

{

 

DataTable dt = new DataTable("Employee");

 

dt.Columns.Add(

"Id");

 

dt.Columns.Add(

"FirstName");

 

dt.Columns.Add(

"LastName");

 

 

for (int i = 1; i <= 10; i++)

 

{

 

DataRow dr = dt.NewRow();

 

dr[

"Id"] = i.ToString();

 

dr[

"FirstName"] = "XXX" + i.ToString();

 

dr[

"LastName"] = "YYYY" + i.ToString();

 

dt.Rows.Add(dr);

}

 

return dt;

 

}

 

private DataTable GetCustomers()

 

{

 

DataTable dt = new DataTable("Customers");

 

dt.Columns.Add(

"Id");

 

dt.Columns.Add(

"FirstName");

 

dt.Columns.Add(

"LastName");

 

 

for (int i = 1; i <= 10; i++)

 

{

 

DataRow dr = dt.NewRow();

 

dr[

"Id"] = i.ToString();

 

dr[

"FirstName"] = "CCC" + i.ToString();

 

dr[

"LastName"] = "DDDDD" + i.ToString();

 

dt.Rows.Add(dr);

}

 

return dt;

 

}

 

protected void Grid1_SelectedIndexChanged(object source, System.EventArgs e)

 

{

 

int itemIndex = Grid1.SelectedItems[0].ItemIndex;

 

trainingId =

int.Parse(Grid1.MasterTableView.DataKeyValues[itemIndex]["ID"].ToString());

 

lblName.Text = trainingId.ToString();

}

 

protected void DDList_SelectedIndexChanged(object sender, EventArgs e)

 

{

 

int index = DDList.SelectedIndex;

 

SetData(index);

}

</

 

script>

 


When i deployed the user control and web part in SharePoint 2010, I am able to view the data but i face 2 issues in this.
1. First time, when i select anything in the dropdownlist or select any row in the grid, its not ajaxified but full post back is happening. Second time on wards it works perfectly fine.
2. I want ajax on ddl and grid but when i uncomment the line that is commented above, I am able to select a row in the grid only for the first time. From second time onwards, i am unable to select.

Please do help me resolving this. I am using the trial version of Telerik.Web.UI.dll 2010.2.713.20

Please do send me a sample which does the similar functionality.

Thanks in advance.



Tsvetoslav
Telerik team
 answered on 22 Nov 2010
3 answers
43 views
I am working with the latest telerik editor (Q3 release). so far every control in my project is upgraded successfully. but in image manage in the editor, the delete button is not visible. I was able to add create directory button from the provider (DBContentProvider) by returning true from CanCreateDirectory property and overloading  the CreateDirectory() method. is there any similar property for adding delete button?

Thanks.
nyad
Top achievements
Rank 1
 answered on 22 Nov 2010
5 answers
298 views
I have downloaded trial version of TELERIK controls for ASP.Net AJAX few days back.
My application uses Callback to load content inside the RadSplitter control.(Please note not AJAX callbacks, simple callbacks)
I have set the RegisterWithScriptManager property of RadSplitter =false, to allow rendering the RadSplitter's  HTML output after  callback.

The RadSplitter gets rendered successfully, but none of the RadSplitter functionality like (resize etc) works  after the callback.
Your forums suggest to manually register the RadSplitter scripts into the RadScriptManager, to get the functionality back.
I have 2 queries-

Query 1-
Do I use the below code snippet ?
Telerik.Web.UI.RadScriptManager.RegisterClientScriptBlock(RadSplitter1 , this.GetType(), "", "", true);
 Query 2. If so what will I pass to the 4th argument ?- "script".

PLEASE TREAT THIS AS URGENT.

I need to take a business decision for using Telerik controls based on this.  Have already posted similar query earlier, but have received no response so far.
Thanks, Tanima


Dobromir
Telerik team
 answered on 22 Nov 2010
1 answer
109 views
How to check which columns are grouped ?
Princy
Top achievements
Rank 2
 answered on 22 Nov 2010
1 answer
170 views
Hello,

I was testing out the demo for the GridAttachmentColumn directly from the demo page - http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/gridattachmentcolumn/defaultcs.aspx and while I tried uploading a file from both a Local and Network Drives, I keep getting a 'Sorry couldn't find a page' error.  I have tried in both Internet Explorer 7 and FireFox 3.6.12 browsers. 

Also, I have developed a page using the most current RadControls for ASP.NET AJAX Q3 2010. Although uploading and viewing the file (.XLSX) from a local drive did not have any errors, however viewing the file after uploading from a Network drive produced this error:

Unterminated string passed in. (61): {"ID":30,"ColumnUniqueName":"AttachmentColumn","FileName":"G:

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Unterminated string passed in. (61): {"ID":30,"ColumnUniqueName":"AttachmentColumn","FileName":"G:

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentException: Unterminated string passed in. (61): {"ID":30,"ColumnUniqueName":"AttachmentColumn","FileName":"G:]
   System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeString() +543643
   System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) +233
   System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeDictionary(Int32 depth) +422
   System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) +147
   System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer) +51
   System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit) +37
   System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(String input) +70
   Telerik.Web.UI.GridCommandEventArgsFactory.CreateGridCommandEventArgs(GridItem item, Object commandSource, CommandEventArgs originalArgs) +676
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +105
   Telerik.Web.UI.GridItem.FireCommandEvent(String commandName, Object commandArgument) +46
   Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) +8614
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Do you know how I can fix this problem?

Thank you
Veli
Telerik team
 answered on 22 Nov 2010
3 answers
138 views
I'm having a problem with using the exchange provider with rad scheduler. The load time for data is excessive on calendars, esp when they have many recurring events. I think the reason boils down to 2 things (please let me know if there's more...):

1. the size of the XML returned by EWS
2. the fact that the exchange provider requests all recurring events, regardless if they will actually have an instance within the date range or not.

1. the size of the XML returned by EWS:

In the GetCalendarItems() method in ExchangeSchedulerProvider, I changed BaseShape from AllProperties to Default, and added the following additional properties:
UnindexedFieldURIType.itemBody
UnindexedFieldURIType.calendarTimeZone
UnindexedFieldURIType.calendarRecurrence
UnindexedFieldURIType.calendarFirstOccurrence
UnindexedFieldURIType.calendarLastOccurrence

this *seems* to give radscheduler all that it needs, and the returned xml doc from EWS shrank from 2.6MB (!) to about 200K, for 124 records. This actually still seems kind of big to me, and I'm worried about scalability.

2. Exchange Provider requests all recurring events

It also looks like in the GetAppointments() method, the provider gets all "regular" events within the given timespan, as well as all recurring events:

if ((item.Start < owner.VisibleRangeEnd && item.End > owner.VisibleRangeStart) ||
                  item.CalendarItemType1 == CalendarItemTypeType.RecurringMaster)
                {
                    itemIds.Add(item.ItemId);
                }

Thinking about it, this kind of makes sense. How would we know if any given recurring event has a recurrence within a given timespan if we don't get all recurring masters, and then parse their recurrence rule, checking to see if there's an actual instance in the time we're looking at. However, this is hugely inefficient, and there must be a better way. In that example above, I'm getting 124 event records. But in that same example, I'm actually only displaying 2 of them (!). All the rest are recurring events that were set up way in the past (years sometimes), and whose recurrence has completed. And we use outlook web access here at work, where my calendars display correctly, and don't take seconds (or minutes) to load.

Could anyone offer assistance about how to improve the responsiveness of radscheduler with EWS, esp in the case of a calendar with many recurring events.

Thanks in advance

Jonathan
Hans Santens
Top achievements
Rank 1
 answered on 22 Nov 2010
1 answer
57 views
Hi,

I have developed a custom control which is placed inside the <FilterTemplate> of a GridBoundColumn. I am hoping to be able to get a reference to that GridBoundColumn from the control, in order to read certain properties (UniqueName, DataField, and CurrentFilterValue), but looking through the Parent hierarchy, I wasn't able to spot it.

Can you recommend a way of getting the column object reference?

Thanks,
Veli
Telerik team
 answered on 22 Nov 2010
1 answer
111 views
Dear Sir ,

I am using following code for open Appointment Context Menu using left menu Click this code is provided by your team now Context Menu is Opening but when i click on any menu item then its shows error  java script error _internalId is null or not and object.


function OnClientAppointmentClick(sender, args) {
            sender.get_appointmentContextMenus()[0].show(args.get_domEvent());

        }


I have attached error screen shots please give me solution.


Thanks
Chandan Kumar
Veronica
Telerik team
 answered on 22 Nov 2010
1 answer
131 views

Hi,

My application loads external links in a radwindow and I would like to show a custom error message rather than the standard page based on error messages. I was wondering how this could be accomplished using Radwindows. I dont see any obvious events i could use.

The error messages could possibly be based on HTTP standard response codes.

TIA 
Georgi Tunev
Telerik team
 answered on 22 Nov 2010
1 answer
98 views
I found in some other thread an answer to my question about stopping the Rotator to continue scrolling past the last item (WrapFrames)...
And I found a thread that shows how to preserve the selectedIndex in the rotator as well... however, when combining WrapFrames="False" and setting the InitialItemIndex to the correct index the RotatorScrolling seems to get messed up.

For example, if you have 10 elements in the rotator and only 5 items are shown at the time, you can scroll to the next 5 elements without problems. If you then select item #6, it correctly shows me element 6 (index=5), the index is preserved correctly but I'm suddenly able to scroll NEXT, but not back. If I click the Next (show the next 5 elements), I see the first 5 elements...

Know issue? Or have I done something wrong ?
Fiko
Telerik team
 answered on 22 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?