Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
335 views
Hi,

I'm trying to bind a radgrid from client side with a ASMX web service using this markup:

<telerik:RadGrid ID="RadGrid1" AllowSorting="true" AllowPaging="true" AllowFilteringByColumn="true" 
            AutoGenerateColumns="false" runat="server"
            <MasterTableView> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="Id" HeaderText="Id" DataType="System.Guid" Visible="false" /> 
                    <telerik:GridBoundColumn DataField="Title" HeaderText="Title" /> 
                    <telerik:GridBoundColumn DataField="Cause.Name" HeaderText="Cause"/> 
                    <telerik:GridBoundColumn DataField="StartDate" HeaderText="Start Date" DataFormatString="{0:d}" DataType="System.DateTime"/> 
                </Columns> 
            </MasterTableView> 
            <PagerStyle AlwaysVisible="true" /> 
            <ClientSettings> 
                <DataBinding Location="WebService.asmx" 
                    SelectMethod="GetEvents" SelectCountMethod="GetEventCount" />                 
            </ClientSettings> 
        </telerik:RadGrid> 

The JSON being returned by the webservice is like so:

{"d":{"__type":"EventDTO","EntityId":"20669908-bf86-4d72-90b0-38239eb6dfa5", 
"Type":{"Name":"Entertainment","Description":"Test","Id":"1228a7b5-43e1-4cd5-b66d-b4afd43004b7",
"CreateDate":"\/Date(1240385834617)\/","LastUpdatedDate":"\/Date(1240385834617)\/","DeletedDate":null,"TimeStamp":[0,0,0,0,0,0,35,152]}, 
"Cause":{"Name":"Global Warming1","Description":"Test","Id":"399fcb2e-0bdc-4e4b-879f-0ee0e97a5db5", 
"CreateDate":"\/Date(1240384333727)\/","LastUpdatedDate":"\/Date(1248085361140)\/","DeletedDate":null,"TimeStamp":[0,0,0,0,0,0,164,19]},"Title":"97979978978","Sites":null,"Location":"Pakistan","Description":"Testing Description \n",
"StartDate":"\/Date(1240574400000)\/","CompletionDate":"\/Date(1246230000000)\/","RequiresVolunteerApproval":false,"Id":"0da73022-7d8d-4f79-a108-61c916a49fe8","CreateDate":"\/Date(1240389765160)\/","LastUpdatedDate":"\/Date(1240389765160)\/","DeletedDate":null,"TimeStamp":[0,0,0,0,0,0,148,192]}} 

Problem is that the Cause column shows up empty. Cause is a nested object inside the main event object...how can I get the radgrid to display nested object's properties?
Sebastian
Telerik team
 answered on 02 Sep 2009
4 answers
136 views
We have used Rad Calender to pick dates and pass to next page to display details depends on complete date selected. eg 26/08/2009.

This code was working since Apr.2009 on server,  it started giving error form 19/08/2009. On selecting date from calander. calender event not passing  date to next page.

Same code is working on local PC with same server environment  SQL 2008, VS 2005  Dot net frame work 2.0
 protected void SelectedDateChange(object sender, Telerik.WebControls.Base.Calendar.Events.SelectedDatesEventArgs e)  
        {  
            objDailyReportBL = new DailyReportBL();  
            objDailyReportSchema = new DailyReportSchema();  
            objRoleMasterBL = new RoleMasterBL();  
            objRoleMasterSchema = new RoleMasterSchema();  
 
 
            if (e.SelectedDates.Count > 0)  
            {  
 
                IsHoliday = false;  
 
                if (e.SelectedDates[0].Date.DayOfWeek == DayOfWeek.Sunday)  
                {  
                    IsHoliday = true;  
                }  
                else  
                {  
                    if (dstHolidayList != null)  
                    {  
                        if (dstHolidayList.Tables.Count > 0)  
                        {  
                            if (dstHolidayList.Tables[0].Rows.Count > 0)  
                            {  
                                DataRow[] foundRows = dstHolidayList.Tables[0].Select("HolidayDate='" + e.SelectedDates[0].Date + "'");  
 
                                if (foundRows.Length != 0)  
                                {  
                                    IsHoliday = true;  
                                }  
                            }  
                        }  
                    }  
                }  
 
                  
                if (QueryStringProfileEmployeeID != Guid.Empty)  
                {  
 
                    if (SessionRoleName != MasterDataHelper.USER_BDE && SessionRoleName != MasterDataHelper.USER_ADMIN)  
                    {  
                        if (e.SelectedDates[0].Date > SessionLastSubmittedDate || SessionLastSubmittedDate.IsNull)  
                        {  
                            Response.Write("<script language=javascript>alert(' " + MoleKule.Resources.Molekule.SuperiorCantViewDailyReportUntilSelfSubmits + "');self.location=('DailyReport.aspx?pid=" + GetProfileEmployeeID.ToString() + "');</script>");  
                            return;  
                        }                         
                    }  
 
                    objDailyReportSchema = objDailyReportBL.DailyReportRetrieve(SqlDateTime.Parse(e.SelectedDates[0].Date.ToString()), QueryStringProfileEmployeeID);  
 
                    if ((objDailyReportSchema != null) && (objDailyReportSchema.IsReportSubmitted))  
                    {  
                        Response.Redirect(MasterDataHelper.NAVIGATE_DAILYREPORT + (e.SelectedDates[0]).Date.ToString() + "&pid=" + GetProfileEmployeeID.ToString() + "&holiday=" + IsHoliday);  
                    }  
                    else  
                    {  
                        Response.Write("<script language=javascript>alert(' " + MoleKule.Resources.Molekule.DailyReportNotYetSubmitted + "');self.location=('DailyReport.aspx?pid=" + GetProfileEmployeeID.ToString() + "');</script>");  
                        //Response.Redirect(MasterDataHelper.NAVIGATE_CLIENT_DAILYREPORT + "?pid=" + QueryStringProfileEmployeeID.ToString());  
                    }  
                }  
                else  
                {  
 
                    SqlDateTime WebConfigDT, ReportStartDate, DOJ, DateOfAct, PreDt;  
 
                    DateOfAct = SqlDateTime.Null;  
                    DOJ = SqlDateTime.Null;  
 
 
                    DataSet dstDailyReport;  
                    objDailyReportBL = new DailyReportBL();  
 
                    dstDailyReport = objDailyReportBL.DailyReportGetDOJAndDtOfActivation(SessionProfileEmployeeID);  
 
                    if (dstDailyReport.Tables.Count > 0)  
                        if (dstDailyReport.Tables[0].Rows.Count > 0)  
                        {  
                            DateOfAct = SqlDateTime.Parse(dstDailyReport.Tables[0].Rows[0]["ActivationDate"].ToString());  
                            DOJ = SqlDateTime.Parse(dstDailyReport.Tables[0].Rows[0]["JoiningDate"].ToString());  
                        }  
 
                    try  
                    {  
                        WebConfigDT = SqlDateTime.Parse(ConfigurationManager.AppSettings["DailyReportStartDate"].ToString());  
                    }  
                    catch (Exception)  
                    {  
                        Response.Write("<script language=javascript>alert(' " + "Report can't submit. Contact Admin." + "');self.location=('DailyReport.aspx');</script>");  
                        //WebConfigDT = SqlDateTime.Null;  
                        return;  
                    }  
 
 
                    if (!WebConfigDT.IsNull)  
                    {  
 
                        ReportStartDate = WebConfigDT;  
 
                        if (DOJ > ReportStartDate)  
                            ReportStartDate = DOJ;  
 
                        if (DateOfAct > ReportStartDate)  
                            ReportStartDate = DateOfAct;  
 
 
                        if (e.SelectedDates[0].Date < ReportStartDate)  
                        {  
                            DateTime tmp = Convert.ToDateTime(ReportStartDate.ToString());  
                            Response.Write("<script language=javascript>alert(' " + "Your start date of daily report is " + tmp.ToString("dd/MM/yyyy") + ". You can create report from " + tmp.ToString("dd/MM/yyyy") + " onwards." + "');self.location=('DailyReport.aspx');</script>");  
                            //Response.Redirect("DailyReport.aspx");  
                            return;       
                        }  
                    }  
                    else  
                    {  
                        Response.Write("<script language=javascript>alert(' " + "Report can't submit. Contact Admin." + "');self.location=('DailyReport.aspx');</script>");  
                        return;  
                    }  
 
                    objRoleMasterSchema = objRoleMasterBL.RoleMasterRetrieveByProfileEmployeeID(SessionProfileEmployeeID);  
                      
                    if (objRoleMasterSchema.RoleName != MasterDataHelper.USER_ADMIN)  
                    {  
                        Response.Redirect(MasterDataHelper.NAVIGATE_DAILYREPORT + (e.SelectedDates[0]).Date.ToString() + "&holiday=" + IsHoliday);  
                    }                      
                }  
            }  
        } 
Georgi Krustev
Telerik team
 answered on 02 Sep 2009
2 answers
141 views
I am trying to export a grid on the client by using a context menu.  The grid has an ajax manager on it so when I click the export option it starts an ajax request and never does the export.   When i used a button i would  have this code in place to stop the request.

 

if (args.get_eventTarget().indexOf("DownloadPDF") > 0)

 

args.set_enableAjax(

false);

 



but the export option is part of the context menu the event target is the grid.
I am trying to find a way to detect that the context menu was fired and the value while  canceling the ajax requests on the grid for  those values and fire the ajax on others.


you have to stop the request on the ajax manager  like this

ClientEvents-OnRequestStart

 

="requestStart"

 


I just need to find how to find child controls of the requesting event


Sebastian
Telerik team
 answered on 02 Sep 2009
1 answer
66 views
Sorry for this post in this forum (no other forum subject for this question ...)

Does the R.A.D. controls MCMS still supported ?
I see in this post http://www.telerik.com/community/forums/aspnet/editor/rad-editor-mcms-placeholder.aspx  that:
"RadEditorPlaceholderControl's  ....  was supported until the end of 2008"



No information are available in the telerik web site about this specifique question ...

Thx,
Nicolas.



Ivo
Telerik team
 answered on 02 Sep 2009
1 answer
79 views
Hi, I'm trying to add some spacing in a list element (linebreaks).

Try to add some linebreaks in the editor here: http://demos.telerik.com/aspnet-ajax/editor/examples/saveindatabase/defaultcs.aspx and then push the "Submit to database"-button. You'll se that the linebreaks gets removed.

So to the question: how can I add spacingin a list element?
Rumen
Telerik team
 answered on 02 Sep 2009
1 answer
403 views
Hi,
   I have GridTemplateColumn with dropdownlist and text box in a Rad Grid and I have set ExportOnlyData="False".

 

<telerik:GridTemplateColumn HeaderText="Answer" UniqueName="AnswerOptions">

 

 

<HeaderStyle HorizontalAlign="Left" Width="150px"/>

 

 

<ItemTemplate>

 

 

<asp:dropdownlist id="ddloptions" runat="server" >

 

 

</asp:dropdownlist>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 
When I do "ExporttoExcel", it opens up a excel file, with dropdown and textbox.  I select some values from dropdown and enter values for textbox and then save as ExcelWorkbook. Till that no problem.
   Now I am trying to import the entered values into database. I tried different possible ways. I tried to save the file as csv/tab delimited, but the value selected in dropdown or entered in textbox doesn't get copied to the csv/text. I tried to just copy the cells and paste it into a notepad. But the selected dropdown value doesn't get copied. I could not figure out how this dropdownlist/textbox is stored in the excel workbook. Can you please let me know how I can retrieve the dropdown/textbox values ?
Appreciate your help.
Thanks
Meena
Prangadj
Top achievements
Rank 1
 answered on 02 Sep 2009
3 answers
70 views
Hi All,
I want to display the year data by month (Jan-Dec) Based on the Timeperiod selection.
Suppose if i select jul month the grid should display from jan-Jul.


I am binding 12 columns ,based on the time period selection remaining columns i am hiding.
the Grid header is not displaying properly for the first time binding the grid.


Can anyone help on this.
Thank You
Martin
Telerik team
 answered on 02 Sep 2009
3 answers
136 views
Dear all,

In original asp.net ajax updatepnael, We can use a Trigger tag to determine which control and event name to fire ajax's update. It's really useful when using lots of use control in a page.

For example, I have 3 user control on a page:
Control_A has two events : event_1 and event_2
event_1 will trigger Control_B's ajax updating but not Control_C
event_2 will trigger Control_C's ajax updating but not Control_B

How can I do it when using RadAjaxManager?
Pavlina
Telerik team
 answered on 02 Sep 2009
1 answer
70 views

I have searched the forum for this issue without success and your online example is too simiplistic to adapt.

I have 4 grids on a page, each representing a separate db table, and the schema for each table is different.  I need to drag rows from 3 of the grids to the 4th to form new records aggregating the data from the 3 source tables.  I know how to capture the contents of the 4th grid and to update the db.  My problem is getting the rows from each of the 3 source grids to stick to the 4th grid.

RadGrid_1 -----------

                               |

RadGrid_2 -------------------> RadGrid_4

                               |

RadGrid_3 -----------

Can this even be done?  If so, is there a reference implementation somewhere?

Sebastian
Telerik team
 answered on 02 Sep 2009
1 answer
119 views
I am using radeditor for ajax with asp.net validator control using the code below. when user click on the button, validation works in IE and pages get scrolled to the editor. But it does not work in firefox. I have a long page and submit page is at the bottom. In all non IE browsers when I click submit, nothing happens and if i scroll up to the box i can see the valiation text there. How can I scroll the page to make sure that it shows the valiation msg. thanks.

 

<tk:RadEditor ID="txt" runat="server" Width="80%" Height="290px" ToolsFile="~/Editor/BasicEditTools.xml"

 

 

EditModes="Design">

 

</tk:RadEditor>

 

 

<cc1:ValidatorCalloutExtender ID="VCRequiredText" runat="server" TargetControlID="RequiredText">

 

 

</cc1:ValidatorCalloutExtender>

 

<

 

asp:RequiredFieldValidator ID="RequiredText" runat="server" ControlToValidate="txt"

 

 

 

 

 

SetFocusOnError="True" Display="None" ErrorMessage="Please enter text...."></asp:RequiredFieldValidator>

 

Rumen
Telerik team
 answered on 02 Sep 2009
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?