Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
136 views
Hello,
After much research I still can't figure out how to set the selected value in a resource list. My Resources appear ok, and the correct value is added to the database, but on update, it always selects the 1st data value in the list no matter what the database value. It does not select the "-" unless my data field is null which is correct.

My appointment population loop below.

for (int i = 0; i < appCol.Count; i++)
            {
  
                Appointment apt = new Appointment();
                apt.Owner = owner;
                apt.ID = appCol[i].Id;
                apt.Start = DateTime.SpecifyKind(Convert.ToDateTime(appCol[i].Start), DateTimeKind.Utc);
                apt.End = DateTime.SpecifyKind(Convert.ToDateTime(appCol[i].End), DateTimeKind.Utc);
                apt.RecurrenceRule = Convert.ToString(appCol[i].RecurrenceRule);
                apt.Description = appCol[i].Description;
                // load Apppointment Type Resources
                apt.Resources.AddRange(GetResourcesByType(owner,"Appointment Types"));
             
                if (appCol[i].RecurrenceParentId != null)
                    apt.RecurrenceParentID = appCol[i].RecurrenceParentId;
  
                int reminderTime = 0;
  
                if (Int32.TryParse(appCol[i].Reminder,out reminderTime))
                {
                    Reminder r = new Reminder(reminderTime);
                    apt.Reminders.Add(r);
                    Tools.SetAppointmentsForApplication();
                }
  
                if (apt.RecurrenceParentID != null)
                {
                    apt.RecurrenceState = RecurrenceState.Exception;
                }
                else if (apt.RecurrenceRule != string.Empty)
                {
                    apt.RecurrenceState = RecurrenceState.Master;
                }
  
  
                apt.Subject += appCol[i].Subject;
                appointments.Add(apt);
            }
Veronica
Telerik team
 answered on 01 Sep 2010
1 answer
105 views
I am creating a line chart programmatically.

The chart has a datetime value for the xaxis and a numerical count for the yaxis.

If the yaxis values are +ve it all works fine but if there is a -ve value in the data, the chart does not plot and i get the error message 'There is no or empty series'

Here is the code used to create the chart:

int gridItem = (int)dataItem.GetDataKeyValue("PlayerCode");
 
RadChart1.Series.Clear();
RadChart1.Clear();
RadChart1.PlotArea.XAxis.Clear();
 
string scoreQuery = "SELECT [ScoreDate], [ScoreValue] FROM [Scores] WHERE ([PlayerCode] = @PlayerCode) AND ([ScoreValue] > 0) ORDER BY [ScoreDate] ASC";
Connections scCon = new Connections(scoreQuery);
scCon.AddParam("PlayerCode", gridItem);
DataTable resTable = new DataTable();
resTable = scCon.ReturnTable();
ChartSeries chSeries = new ChartSeries();
chSeries.Type = ChartSeriesType.Line;
ChartAxisItem xAxis = new ChartAxisItem();
RadChart1.PlotArea.XAxis.IsZeroBased = false;
RadChart1.PlotArea.XAxis.AutoScale = false;
RadChart1.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortDate;
 
foreach (DataRow dr in resTable.Rows)
{
    chSeries.AddItem(Convert.ToDouble(dr["ScoreValue"]));
    DateTime scDate = new DateTime();
    scDate = Convert.ToDateTime(dr["ScoreDate"]);
    ChartAxisItem item = new ChartAxisItem();
    item.Value = (decimal)scDate.ToOADate();
    RadChart1.PlotArea.XAxis.AddItem(item);
}
RadChart1.PlotArea.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Gradient;
RadChart1.PlotArea.Appearance.FillStyle.MainColor = Color.FromArgb(78, 198, 19);
RadChart1.PlotArea.Appearance.FillStyle.SecondColor = Color.FromArgb(123, 230, 108);
RadChart1.Series.Add(chSeries);
Any help is much appreciated.
Ves
Telerik team
 answered on 01 Sep 2010
7 answers
391 views
I'm doing some testing with the RadGrid CalculatedColumn.  It's a timesheet application so I'd like to use the GridCalculatedColumn to total the hours for the week (row) and sum aggregate to total the hours for the day (column).  Some days won't have hours so the datafield will pull in NULL.  The sum aggregates are working fine but the GridCalculatedColumn is not displaying a value. 

Here is the code for my columns:
<rad:GridNumericColumn Aggregate="Sum" FooterAggregateFormatString="{0:F}" DataFormatString="{0:F}" DataField="Hours_Sun" DataType="System.Decimal" HeaderText="SUN" /> 
<rad:GridNumericColumn Aggregate="Sum" FooterAggregateFormatString="{0:F}" DataFormatString="{0:F}" DataField="Hours_Mon" DataType="System.Decimal" HeaderText="MON" /> 
<rad:GridNumericColumn Aggregate="Sum" FooterAggregateFormatString="{0:F}" DataFormatString="{0:F}" DataField="Hours_Tue" DataType="System.Decimal" HeaderText="TUE" /> 
<rad:GridNumericColumn Aggregate="Sum" FooterAggregateFormatString="{0:F}" DataFormatString="{0:F}" DataField="Hours_Wed" DataType="System.Decimal" HeaderText="WED" /> 
<rad:GridNumericColumn Aggregate="Sum" FooterAggregateFormatString="{0:F}" DataFormatString="{0:F}" DataField="Hours_Thu" DataType="System.Decimal" HeaderText="THU" /> 
<rad:GridNumericColumn Aggregate="Sum" FooterAggregateFormatString="{0:F}" DataFormatString="{0:F}" DataField="Hours_Fri" DataType="System.Decimal" HeaderText="FRI" /> 
<rad:GridNumericColumn Aggregate="Sum" FooterAggregateFormatString="{0:F}" DataFormatString="{0:F}" DataField="Hours_Sat" DataType="System.Decimal" HeaderText="SAT" /> 
<rad:GridCalculatedColumn Aggregate="Sum" FooterAggregateFormatString="{0:F}" DataFormatString="{0:F}" DataFields="Hours_Sun, Hours_Mon, Hours_Tue, Hours_Wed, Hours_Thu, Hours_Fri, Hours_Sat" Expression="{0}+{1}+{2}+{3}+{4}+{5}+{6}" DataType="System.Decimal" HeaderText="WEEK TOTAL" /> 

In one row example, there are hours in only Monday and Tuesday.  If I changed the DataFields to "Hours_Mon, Hours_Tue" and the Expression to "{0}+{1}" then the CalculatedColumn works correctly.  Am I only allowed to do a calculation on 2 data fields or is it running into a problem with the null values for the rest of the days? Am I missing a property in my columns?
Radoslav
Telerik team
 answered on 01 Sep 2010
1 answer
71 views
Dear fellows,

i just start with AJAX, because since the last weeks i was more involved in the RadControl for ASP.Net and Winforms.

i've noticed that most on my classic asp.net controls (in .ascx controls) don't fire the server side event code on first click, but on 2nd.

So what i am doing is, that i have one contentPlaceHolder in a master page and i drop my user controls on it.

I have added a ScriptManager to the master page.

Where to place AjaxManager and/or AJAX Panel to make sure that defined classic ASP.NET controls are behaving like before?

Specially my asp:Buttons are not working as expected and i need to execute server side code on first click.

So what is the best pratice for this.

2nd: in my apllication some buttons should appear only, if some steps was done before, means the user has to follow a defined way, and first when she/he has finished Step 2 - the BVutton for Step 3 becomes visible.

Because there is not databinding for buttons i currently use session variables for this taks. Any better way to do it ?

Thanks for helping.

Kind Regards

Martin Gartmann
Martin Gartmann
Top achievements
Rank 2
 answered on 01 Sep 2010
1 answer
113 views

RadRotator Using onitemclick and OnClientItemClicked together
I check for condition and get an alert box with OnClientItemClicked, then do postback with onitemclick. Works fine in IE7. In Firefox3 I get  __doPostBack is not defined. What is the work around for Firefox?
Thanks
Fred

Shinu
Top achievements
Rank 2
 answered on 01 Sep 2010
5 answers
151 views
Hi,

I was unable to find default config and tools file for latest rad editor. In previous versions, it was always present in RadControls folder and we need some default files to start configuration with. I made some search but with no avail.

Moreover, in documentation is mention about "ConfigFile" property but lately downloaded RadEditor does not expose such property - what's wrong?

Thanks for help.
Rumen
Telerik team
 answered on 01 Sep 2010
3 answers
396 views

Hello,

I am using Telerik grid. I have some GridTemplateColumn. Inside those columns there are EditItemTemplate column. Inside that I have <asp:checkbox>. I have intotal 5 checkboxes defined the same way. The condition I want is that out of 5 checkboxes if I click on one of the checkbox it will uncheck other 4 checkboxes. I got the object of the gridtemplatecolumn but I dont know what to do further. Any help will be appreciated

Code:

 

 

 

 

 

<telerik:GridTemplateColumn HeaderText="Activity - Fit/Exam" SortExpression="q9a_bit" UniqueName="q9a_bit" EditFormColumnIndex="0" DataField="q9a_bit" Display="false">
   <ItemTemplate>
   </ItemTemplate>
   <EditItemTemplate>
       <asp:CheckBox ID="id1" runat="server" Checked="<%#Bind('q9a_bit') %>"/>
   </EditItemTemplate>
</telerik:GridTemplateColumn>
                          
<telerik:GridTemplateColumn HeaderText="Activity - Refraction" SortExpression="q9b_bit" UniqueName="q9b_bit" EditFormColumnIndex="0" DataField="q9b_bit" Display="false">
    <ItemTemplate>
    </ItemTemplate>
    <EditItemTemplate>
        <asp:CheckBox ID="id2" runat="server" Checked="<%#Bind('q9b_bit') %>"/>
    </EditItemTemplate>
</telerik:GridTemplateColumn>
                          
<telerik:GridTemplateColumn HeaderText="Activity - Rx Change" SortExpression="q9c_bit" UniqueName="q9c_bit" EditFormColumnIndex="0" DataField="q9c_bit" Display="false">
   <ItemTemplate>
   </ItemTemplate>
   <EditItemTemplate>
       <asp:CheckBox ID="id3" runat="server" Checked="<%#Bind('q9c_bit') %>"/>
   </EditItemTemplate>
</telerik:GridTemplateColumn>
                          
<telerik:GridTemplateColumn HeaderText="Activity - Purchase Only" SortExpression="q9d_bit" UniqueName="q9d_bit" EditFormColumnIndex="0" DataField="q9d_bit" Display="false">
    <ItemTemplate>
    </ItemTemplate>
    <EditItemTemplate>
        <asp:CheckBox ID="id4" runat="server" Checked="<%#Bind('q9d_bit') %>"/>
    </EditItemTemplate>
</telerik:GridTemplateColumn>
                          
<telerik:GridTemplateColumn HeaderText="Activity - Purchase Only" SortExpression="q9e_bit" UniqueName="q9e_bit" EditFormColumnIndex="0" DataField="q9e_bit" Display="false">
    <ItemTemplate>
    </ItemTemplate>
    <EditItemTemplate>
        <asp:CheckBox ID="id5" runat="server" onclick="return check_uncheck ();" Checked="<%#Bind('q9e_bit') %>"/>
    </EditItemTemplate>
</telerik:GridTemplateColumn>

 

Javascript:

 

<script type="text/javascript">
      
function check_uncheck() {
  var grid = $find("<%=RadGrid1.ClientID%>");
  var tableView = grid.get_masterTableView();
  alert(tableView.getCellByColumnUniqueName(tableView.get_dataItems()[0],"q9a_bit"));
}
  
</script>

Regards,
Parth

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Shinu
Top achievements
Rank 2
 answered on 01 Sep 2010
5 answers
235 views
Hello, guys.
In my application I added loading panel on client PageLoad event as it was described on this forum.
            function pageLoad(sender, eventArgs) {
                if (!eventArgs.get_isPartialLoad()) {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("PAGE_LOAD");
                }
            }

But after I added some ajax requests to my code I found that the panel used as updated control gets redrawn each time (to be exact not, each but starting from second time and I think thi is a kind of bug) I perform ajax request.
I tryed to remove the ajax setting made to AjaxManager in a design time using the following code
        bool Stop = false;
        foreach (AjaxSetting Setting in RadAjaxManager1.AjaxSettings)
        {
            if (Setting.AjaxControlID == RadAjaxManager1.ID)
                foreach (AjaxUpdatedControl Ctrl in Setting.UpdatedControls)
                    if (Ctrl.ControlID == pnlSplash.ID)
                    {
                        Setting.UpdatedControls.Remove(Ctrl);
                        Stop = true;
                        break;
                    }
            if (Stop)
                break;
        }

but it didn't help. It still appears during ajax requests made from client code.
What have I done wrong?

With respect, Sergey.
Maria Ilieva
Telerik team
 answered on 01 Sep 2010
1 answer
390 views
Hi all,

I have a CSV file that is selected and read using the RadUpload control. I read each line and populate a DataTable on a C# ASP.NET webpage. Once that is done, I used a RadGrid to populate those values into the grid with AutoGenerateColumns="True"

The rows that don't comply are highlighted in red on RadGrid1_ItemDataBound event, so that user know that they need to be changed.

Now I want the user to go and edit each invalid row and update the changes. Currently with AllowAutomaticUpdates="True" is it not letting me save anything, it just displays the same information when Update is clicked. I am not using an SQL Data Souce so the first question is whether AllowAutomaticUpdates does actually work with just a DataTable or not? If not any suggestion on how I can make the row update-able with minimum coding.

Many thanks

Mark up code is below:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager>
 
<telerik:RadFormDecorator ID="RadFormDecorator1" Runat="server" Skin="Forest" DecoratedControls="All" />
 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
 
<telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True"
    AllowAutomaticUpdates="True" GridLines="None"
    AutoGenerateColumns="True" Skin="Forest"  Width="90%" Height="300px"
    onitemdatabound="RadGrid1_ItemDataBound"
    onneeddatasource="RadGrid1_NeedDataSource"
    onitemupdated="RadGrid1_ItemUpdated" VirtualItemCount="1">
     
    <MasterTableView EditMode="InPlace" EnableNoRecordsTemplate="False"
        InsertItemPageIndexAction="ShowItemOnFirstPage" DataKeyNames="LineNo" CommandItemDisplay="None">
        <Columns>
            <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn UniqueName="EditCommandColumn1">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
 
        <ClientSettings>
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>
</telerik:RadGrid>
Princy
Top achievements
Rank 2
 answered on 01 Sep 2010
5 answers
134 views
Hello,

I have the following mark-up/code for the RadScheduler. (See Attached SchedulerMarkup.gif).
But the RadScheduler seems to only resize the Time row, but not across all the columns.  (See Attached RadSchedular.jpg).

Am I doing something wrong or is there any other property I need to set?

And, I believe, because of this, the display seems to be off.  The time line blocks should be from 9 AM ~ 6 PM on Monday, then 9 AM ~ 5 PM from Tuesday to Friday. 

My telerik control version is :2009.02.0920.35.

Thanks,
Annie

Peter
Telerik team
 answered on 01 Sep 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?