Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
127 views
Hello,
I have a problem with exporting Radgrid to ExcelML.My Radgrid consist of 6 column,three of these column are Service Hours,Service Mins and PaidAmount.
When

ExcelMLExportStylesCreated event fired I have following code:

 

 

 

if (style.Id == "itemStyle")

 

{

style.NumberFormat.FormatType = Telerik.Web.UI.GridExcelBuilder.

NumberFormatType.Currency;

 

style.AlignmentElement.HorizontalAlignment = Telerik.Web.UI.GridExcelBuilder.

HorizontalAlignmentType.Left;

 

style.InteriorStyle.Color = System.Drawing.

Color.WhiteSmoke;

 

style.InteriorStyle.Pattern = Telerik.Web.UI.GridExcelBuilder.

InteriorPatternType.Solid;

 

}

 

else if (style.Id == "alternatingItemStyle")

 

{

style.NumberFormat.FormatType = Telerik.Web.UI.GridExcelBuilder.

NumberFormatType.Currency;

 

style.AlignmentElement.HorizontalAlignment = Telerik.Web.UI.GridExcelBuilder.

HorizontalAlignmentType.Left;

 

style.InteriorStyle.Color = System.Drawing.

Color.LightGray;

 

style.InteriorStyle.Pattern = Telerik.Web.UI.GridExcelBuilder.

InteriorPatternType.Solid;

 

}
When the currency is set,its applied to every column which contain number including ServiceHours and ServiceMins.I need that curency applied only to PaidAmount column.But if I comment out style currency format,PaidAmount column trailing zero cuts off and no dollar sign appeared.
Please help me.Thanks

Daniel
Telerik team
 answered on 06 May 2010
3 answers
309 views
Hello,

I have a RadDatePicker and two RadTimePickers on a page.  Is there any built-in way to link the selected date of the RadTimePickers to the selected date of the RadDatePicker so when they go to chose the time from the RadTimePicker it doens't change the date back to today's date?

I know that I can get the selected date from the RadDatePicker on autopostback and then set the selected date on the RadTimePickers to that date.  But then when you chose the time from the RadTimePicker it sets the date back to today's date.

Thanks.
Daniel
Telerik team
 answered on 06 May 2010
2 answers
98 views
when im trying to drag the image manager window towards any of the side and it creates space. i like to set a restrictionzone for image manager like radwindow. is this possible?
dick gordon
Top achievements
Rank 1
 answered on 06 May 2010
1 answer
118 views
Hello Sir,

How can Open RadWindow When Our Scheduler is in Update Panel.
Schenerio is,
my Scheduler is inside the update panel. and in scheduler i have context menu and i  fired server side code on click of context menu and open rad window.

its work perfectly when scheduler is out side of update panel but when scheduler is in side update panel then its not working.

Aspx Code is below:-

 

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

 

 

<ContentTemplate>

 


<

 

telerik:RadScheduler AllowInsert="false" HoursPanelTimeFormat="hh:mm tt" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"

 

 

OnAppointmentCreated="RadScheduler1_AppointmentCreated" runat="server" ID="RadScheduler1"

 

 

Skin="Office2007" Height="545px" CustomAttributeNames="StatusId" Width="690px"

 

 

ShowFooter="false" SelectedDate="2010-03-18" DayStartTime="07:00:00" DayEndTime="21:00:00"

 

 

FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" EnableDescriptionField="true"

 

 

ShowNavigationPane="false" OnAppointmentDelete="RadScheduler1_AppointmentDelete"

 

 

DataSubjectField="1" DataStartField="1" DataEndField="1" ShowAllDayRow="false"

 

 

AllowEdit="false" DataKeyField="" DataDescriptionField="Description" OnTimeSlotContextMenuItemClicked="RadScheduler1_TimeSlotContextMenuItemClicked"

 

 

AllowDelete="false" OnAppointmentContextMenuItemClicked="RadScheduler1_AppointmentContextMenuItemClicked"

 

 

OnNavigationCommand="RadScheduler1_NavigationCommand" OnTimeSlotCreated="RadScheduler1_TimeSlotCreated">

 

 

<AppointmentContextMenuSettings EnableDefault="false" />

 

 

<TimelineView UserSelectable="false" />

 

 

<AppointmentTemplate>

 

<%

# Eval("Subject")%>

 

 

<br />

 

 

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

 

 

<br />

 

 

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

 

 

</AppointmentTemplate>

 

 

 

<AppointmentContextMenus>

 

 

 

<telerik:RadSchedulerContextMenu runat="server" DataTextField="Status" DataValueField="StatusId"

 

 

ID="SchedulerAppointmentContextMenu" AppendDataBoundItems="true">

 

 

 

<Items>

 

 

 

<telerik:RadMenuItem Text="Copy" Value="Copy" />

 

 

<telerik:RadMenuItem IsSeparator="True" />

 

 

<telerik:RadMenuItem Text="Edit" Value="Edit" />

 

 

<telerik:RadMenuItem IsSeparator="True" />

 

 

</Items>

 

 

</telerik:RadSchedulerContextMenu>

 

 

</AppointmentContextMenus>

 

 

<TimeSlotContextMenus>

 

 

<telerik:RadSchedulerContextMenu runat="server" ID="SchedulerTimeSlotContextMenu">

 

 

<Items>

 

 

<telerik:RadMenuItem Text="New Appointment" Value="New" />

 

 

<telerik:RadMenuItem IsSeparator="true" />

 

 

<telerik:RadMenuItem Text="Paste" Value="Paste" />

 

 

</Items>

 

 

</telerik:RadSchedulerContextMenu>

 

 

</TimeSlotContextMenus>

 

 

<TimeSlotContextMenuSettings EnableDefault="False" />

 

 

</telerik:RadScheduler>

 

</

 

ContentTemplate>

 

 

 

 

 

<Triggers>

 

 

 

 

 

</Triggers>

 

 

 

 

 

</asp:UpdatePanel>

 

 

 



CS Page Code is Below.:-

 

protected

 

void RadScheduler1_TimeSlotContextMenuItemClicked(object sender, TimeSlotContextMenuItemClickedEventArgs e)

 

{

 

if (e.MenuItem.Value == "New")

 

{

 

//RadWindowManager1.Windows[0].Op

 

 

 

 

 

//Alert.Show("Chandan Kumar");

 

 

 

 

 

RadWindowManager windowManager = new RadWindowManager();

 

 

RadWindow widnow1 = new RadWindow();

 

 

// Set the window properties

 

 

 

 

 

//e.TimeSlot.Duration.

 

 

 

 

widnow1.NavigateUrl =

"~/Appointment/AppointmentDetails.aspx?FacilityId=" + ddlFacility.SelectedValue + "&StTime=" + e.TimeSlot.Start.Hour.ToString() + "&EndTime=" + RadScheduler1.DayEndTime.Hours.ToString() + "&appDate=" + RadScheduler1.SelectedDate.Date.ToString("dd/MM/yyyy") + "&appid=0&doctorId=" + ddlDoctor.SelectedValue + "&TimeInterval=" + RadScheduler1.MinutesPerRow.ToString() + "&FromTimeHour=" + e.TimeSlot.Start.Hour.ToString() + "&FromTimeMin=" + e.TimeSlot.Start.Minute.ToString() + "&Provider=" + ddlDoctor.SelectedItem.Text; ;

 

widnow1.Height = 500;

widnow1.Width = 700;

widnow1.Top = 40;

widnow1.Left = 100;

widnow1.ID =

"RadWindow1";

 

widnow1.OnClientClose =

"OnClientClose";

 

widnow1.VisibleOnPageLoad =

true; // Set this property to True for showing window from code

 

 

 

 

widnow1.Modal =

true;

 

widnow1.VisibleStatusbar =

false;

 

widnow1.Behavior =

WindowBehaviors.Close | WindowBehaviors.Move;

 

windowManager.Windows.Add(widnow1);

 

 

this.Form.Controls.Add(widnow1);

 

}

 

else if (e.MenuItem.Value == "Paste")

 

{

 

if (Convert.ToString(ViewState["CopyAppId"]) != "")

 

{

DAL.

DAL dl = new DAL.DAL(DAL.DAL.DBType.SqlServer, sConString);

 

 

Hashtable hshtableout = new Hashtable();

 

 

Hashtable hshtablein = new Hashtable();

 

hshtablein.Add(

"inyHospitalLocationId", Session["HospitalLocationID"]);

 

hshtablein.Add(

"intCopyAppointmentID", Convert.ToInt64(ViewState["CopyAppId"]));

 

hshtablein.Add(

"chrAppFromTime", e.TimeSlot.Start.Hour.ToString()+ ":" + e.TimeSlot.Start.Minute.ToString() );

 

hshtablein.Add(

"chrAppointmentDate", RadScheduler1.SelectedDate.ToString("dd/MM/yyyy"));

 

hshtablein.Add(

"intDoctorId", ddlDoctor.SelectedValue);

 

hshtablein.Add(

"intEncodedBy", Session["UserID"].ToString());

 

hshtableout.Add(

"intAppointmentNo", SqlDbType.Int);

 

hshtableout.Add(

"chvErrorStatus", SqlDbType.VarChar);

 

hshtableout = dl.getOutputParametersValues(

CommandType.StoredProcedure, "UspCopyDoctorAppointment", hshtablein, hshtableout);

 

 

//Cache.Remove("copyappointmentId");

 

 

 

 

 

//Alert.ShowAjaxMsg("Appointment Updated - " + hshtableout["intAppointmentNo"].ToString(), Page);

 

 

 

 

btnRefresh_OnClick(sender, e);

}

}

 

}

Peter
Telerik team
 answered on 06 May 2010
4 answers
123 views
Is it possible to capture the start and end date when the user clicks on one date (in month view) and drags across, maybe, the next three days(for example)?  I need the event to be triggered when the user releases the mouse click
Peter
Telerik team
 answered on 06 May 2010
1 answer
130 views
I am struggling with the following problem:
I want to create a chart with months on the X-axis like

1/2010 2/2010 3/2010 4/2010 5/2010 6/2010 7/2010 etcetera

On the Y-axis [Level] is displayed, but not every month has a [Level] value.
It can come from the DB like:

Date    | Level
-------------------
1/2010 | 50
2/2010 | 50
4/2010 | 52
7/2010 | 53

I want to display the months without a [Level] value in the chart to create a realistic time picture.

What is the best way to do this? I have tried several examples but no succes.

Best Regards,
Marc
Ves
Telerik team
 answered on 06 May 2010
1 answer
80 views
When we use allowautomaticinserts, the edit form opens up between the grid header and the grid rows. Is there any way to change this layout. Either make it appear below or above the grid?
Pavlina
Telerik team
 answered on 06 May 2010
1 answer
87 views
Hello,

In  RadTabStrip component can we load data to first tab only while opening page, and when pressing on the other tab it well load it's data and so on.
We want to avoid lazy loading  on our website.
Yana
Telerik team
 answered on 06 May 2010
6 answers
82 views

I am defining several columns through the RadGrid definition in the aspx file and several columns programatically in the page load event handler. The problem is that the programatically added columns don't work with sorting or filtering. The grid reloads, but the results are not sorted/filtered. If I define the column in the RadGrid definition instead of adding them programatically, they sort and filter correctly.

Columns defined in RadGrid definition:

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="LeadDistributionId" ReadOnly="true" UniqueName="LeadDistributionId" Visible="true" />

 

 

<telerik:GridBoundColumn SortExpression="LeadDistributionType" HeaderText="Lead Distribution Type" DataField="LeadDistributionType" HeaderButtonType="TextButton" HeaderStyle-Width="150" ItemStyle-Width="150" FooterStyle-Width="150" />

 

 

<telerik:GridBoundColumn SortExpression="ProgramName" HeaderText="Program" DataField="ProgramName" HeaderButtonType="TextButton" />

 

 

<telerik:GridBoundColumn DataField="ProgramID" Visible="false" />

 

 

<telerik:GridBoundColumn SortExpression="SupplierName" HeaderText="Supplier" DataField="SupplierName" HeaderButtonType="TextButton" />

 

 

<telerik:GridBoundColumn DataField="SupplierID" Visible="false" />

 

 

<telerik:GridBoundColumn SortExpression="State" HeaderText="State" DataField="State" HeaderButtonType="TextButton" HeaderStyle-Width="150" ItemStyle-Width="150" FooterStyle-Width="150" />

 

 

<telerik:GridBoundColumn DataField="StateID" Visible="false" />

 

 

</Columns>

Columns defined programatically:

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

// if this is the initial page request

 

 

if (!this.IsPostBack)

 

{

 

DataTable dtLeadDistributionSummary =

 

((

DataView)this.sdsLeadDistributionSummary.Select(new DataSourceSelectArguments())).ToTable();

 

 

Regex reCallCenterColumn = new Regex(LeadDistributionSummary.CallCenterColumnRegEx);

 

 

foreach (DataColumn dataColumn in dtLeadDistributionSummary.Columns)

 

{

 

// if this colummn is a call center column

 

 

if (reCallCenterColumn.IsMatch(dataColumn.ColumnName))

 

{

 

GridBoundColumn gridBoundColumn = new GridBoundColumn();

 

 

// when adding columns programatically in Page_Load event, column

 

 

// must be added to the columns collection before setting properties

 

 

this.RadGrid1.MasterTableView.Columns.Add(gridBoundColumn);

 

gridBoundColumn.UniqueName = dataColumn.ColumnName;

gridBoundColumn.DataField = dataColumn.ColumnName;

gridBoundColumn.HeaderButtonType =

GridHeaderButtonType.TextButton;

 

gridBoundColumn.HeaderStyle.Width = 150;

gridBoundColumn.ItemStyle.Width = 150;

gridBoundColumn.FooterStyle.Width = 150;

gridBoundColumn.Groupable =

true;

 

gridBoundColumn.AllowFiltering =

true;

 

 

// remove "CC-" prefix from column name for header text

 

gridBoundColumn.HeaderText = reCallCenterColumn.Replace(dataColumn.ColumnName,

"$2");

 

}

}

 

// hide grouped columns

 

 

foreach (GridGroupByExpression gridGroupByExpression in this.RadGrid1.MasterTableView.GroupByExpressions)

 

{

 

foreach (GridGroupByField gridGroupByField in gridGroupByExpression.GroupByFields)

 

{

 

this.RadGrid1.MasterTableView.GetColumnSafe(gridGroupByField.FieldName).Visible = false;

 

}

}

#region

 

expand first level

 

 

//// bind grid so items may be expanded below

 

 

//this.RadGrid1.Rebind();

 

 

//// loop through group headers

 

 

//foreach (GridGroupHeaderItem gridGroupHeaderItem in RadGrid1.MasterTableView.GetItems(GridItemType.GroupHeader))

 

 

//{

 

 

// if (gridGroupHeaderItem.GroupIndex.Length == 1)

 

 

// {

 

 

// // expand the group

 

 

// gridGroupHeaderItem.Expanded = true;

 

 

// }

 

 

// else

 

 

// {

 

 

// gridGroupHeaderItem.Expanded = false;

 

 

// }

 

 

// Groups[gridGroupHeaderItem.GroupIndex] = gridGroupHeaderItem.Expanded;

 

 

//}

 

#endregion

 

expand first level

 

}

}

Pavlina
Telerik team
 answered on 06 May 2010
1 answer
123 views
Hi,


In my application i have the functionality to freeze first three columns of grid. But in my grid i have first two columns of "RowIndicator" & "Checkbox" column. I want o freeze three coulmns (i.e ProductID,ProductName,SupplierID) next to "RowIndicator" & "Checkbox" columns. Can you please help me to achieve this functionality.



Thanks,
Ankesh Bharti
Pavlina
Telerik team
 answered on 06 May 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?