//Resource site = apt.Owner.Resources.GetResource("Site", ????);
Here is my code if anybody can help I could move n with my 2 day hang up.
Default.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
RadScheduler1.GroupBy = "Site";
}
Provived Code
public override IEnumerable<Appointment> GetAppointments(RadScheduler owner)
{
List<Appointment> appointments = new List<Appointment>();
//Code removed for security, This is how I get my dataset
DB.m_da = das;
DataSet ds = new DataSet("Patients");
DB.m_da.SetRead("[pWebApptsDay]", 0);
SqlParameter pday = new SqlParameter("@day", System.Data.SqlDbType.VarChar);
pday.Value = DateTime.Today;
DateTime dt = DateTime.Today;
DB.m_da.AddParam(pday);
DB.m_da.Run(ref ds);
System.Data.DataRow[] rows = ds.Tables[0].Select(null, null, System.Data.DataViewRowState.CurrentRows);
foreach (DataRow row in rows)
{
Appointment apt = new Appointment();
apt.Owner = owner;
DateTime st = new DateTime();
DateTime et = new DateTime();
st = (DateTime)(row.ItemArray.GetValue(2));
et = st.AddMinutes((int)row.ItemArray.GetValue(3));
System.Drawing.Color color = ColorTranslator.FromWin32((int)row.ItemArray.GetValue(4));
//trap for bad data IE Nulls
if (String.IsNullOrEmpty(row.ItemArray.GetValue(5).ToString()))
apt.Subject = "Bad Appointment Data Contact Tims Support Appointment id =" + row.ItemArray.GetValue(0).ToString();
else
apt.ID = row.ItemArray.GetValue(0).ToString();
apt.Subject = (String)row.ItemArray.GetValue(5);
apt.Start = Convert.ToDateTime(((DateTime)row.ItemArray.GetValue(2)).ToShortDateString() +
" " + ((DateTime)row.ItemArray.GetValue(2)).ToShortTimeString());
apt.End = (apt.Start.AddMinutes((int)row.ItemArray.GetValue(3)));
apt.BorderColor = color;
LoadResources(apt);
//Resource site = apt.Owner.Resources.GetResource("Site", ????);
apt.Resources.Add(site);
appointments.Add(apt);
}
return appointments;
}
public override void Insert(RadScheduler owner, Appointment appointmentToInsert)
{
}
public override void Update(RadScheduler owner, Appointment appointmentToUpdate)
{
}
public override void Delete(RadScheduler owner, Appointment appointmentToDelete)
{
}
public override IEnumerable<ResourceType> GetResourceTypes(RadScheduler owner)
{
ResourceType[] resourceTypes = new ResourceType[3];
resourceTypes[0] = new ResourceType("Site", true);
resourceTypes[1] = new ResourceType("Provider", true);
resourceTypes[2] = new ResourceType("Resource", true);
return resourceTypes;
}
public override IEnumerable<Resource> GetResourcesByType(RadScheduler owner, string resourceType)
{
switch (resourceType)
{
case "Site":
return GetSite();
case "Provider":
return GetProvider();
case "Resource":
return GetResource();
default:
throw new InvalidOperationException("Unknown resource type: " + resourceType);
}
}
private IEnumerable<Resource> GetSite()
{
List<Resource> resources = new List<Resource>();
//Code removed for security, This is how I get my dataset
DB.m_da = das;
DataSet ds = new DataSet("Resources");
DB.m_da.SetRead("[pWebApptResourceFetch]", 0);
SqlParameter type = new SqlParameter("@ResourceType", System.Data.SqlDbType.VarChar);
type.Value = "Site";
DB.m_da.AddParam(type);
DB.m_da.Run(ref ds);
System.Data.DataRow[] rows = ds.Tables[0].Select(null, null, System.Data.DataViewRowState.CurrentRows);
foreach (DataRow row in rows)
{
Resource res = new Resource();
res.Type = "Site";
res.Key = row.ItemArray.GetValue(0).ToString();
res.Text = row.ItemArray.GetValue(1).ToString(); ;
//res.Attributes["Phone"] = Convert.ToString(reader["Phone"]);
resources.Add(res);
}
return resources;
}
Thanks for any help :)
| protected void RadGrid_Subs_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e) |
| { |
| if (e.Item is GridPagerItem) |
| { |
| Label changePageLabel = (Label)e.Item.FindControl("GoToPageLabel"); |
| changePageLabel.Visible = false; |
| } |
| } |
<
script type="text/javascript">
loadCalendar();
</
script>
<
asp:textbox id="txt_Date" Columns="6" Width=66 runat="server" CssClass="Textbox"></asp:textbox>
<asp:hyperlink id="imgCalendar" runat="server" ImageUrl="../images/smallcalendar.gif" NavigateUrl="javascript:;"></asp:hyperlink>
Private
Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim scriptStr As String = _
"javascript:return popUpCalendar(this," & getClientID() & ", 'mm/dd/yyyy', '__doPostBack(\'" & getClientID() & "\')')"
imgCalendar.Attributes.Add(
"onclick", scriptStr)
End Sub
When btnSearch is clicked on my .aspx page, the popUpCalendar javascript function is not found. Can you help me figure out what I am missing or doing wrong?
Thanks
Jill
Hi All,
I am using RadControl asp.net ajax Q1 2008 and asp.net 3.5
In my application ,i am using radajaxmanager,radajaxloadingpanel,radtabstrip.
I used 4 tab and on each tab grid is there.
on each tab grid loads.
To have loading panel on grid load i used the following code
On aspx file
I added code as
<script>
window.onload = function()
{
if ('<%= Session("TabClick") %>'=="true")
{
setTimeout( function(){
$find("<%= rdAjaxManagerHistoryGrid.ClientID %>").ajaxRequest("InitialPageLoad");
}, 200);
}
}
</script>
Here Session("TabClick") variable set on tab click and on initial page load.
The code behind file code are
Protected Sub rdAjaxManagerHistoryGrid_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles rdAjaxManagerHistoryGrid.AjaxRequest
if e.Argument = "InitialPageLoad" Then
If rtabCall.SelectedIndex = 0 Then
rdAjaxManagerHistoryGrid.AjaxSettings.AddAjaxSetting(rdAjaxManagerHistoryGrid, rGridAccounts, LoadingPnlCustom)
rGridAccounts.DataSource = Me.AccountsData
rGridAccounts.Rebind()
end if
end if
end sub
rdAjaxManagerHistoryGrid.AjaxSettings.AddAjaxSetting(rdAjaxManagerHistoryGrid, rGridAccounts, LoadingPnlCustom) line is also added on pageload and tab click event.
Query
It shows the loading panel on alternate times.
When i am on tab 1 it shows the loading panel and when go to second tab it also shows the loading panel.
But when i came back to first tab it is not showing the loading panel. And then again go to next tab and come to first tab it showing the loading panel
I want to show loading panel on each tab click.
Thanking you.