Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
166 views
I have a problem about checkbox and Web user control. I want tick checkbox when choose row in RadGrid. I use web page, I cant tick with this code:
var chbox = document.getElementById("checkbox1");
chbox.checked = true;

But when I use Web User Control, I have error. This code is not excute. Have you any idea? Thanks you very much!
Pham
Top achievements
Rank 1
 answered on 18 Sep 2011
4 answers
193 views
Hello,

I'm not sure if this is intended behavior, but it appears the pop-up modal edit form isn't so modal.  When in modal mode, you can actually tab through all the page controls.  If the control is a link and you press the enter key and it will post to the link.

You can try it out on the demo site:

http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/popupeditform/defaultcs.aspx

I've attached an image of two modal windows open at the same time.

Al
alo
Top achievements
Rank 1
 answered on 18 Sep 2011
2 answers
80 views
Hello everyone. I apologize for my English but I am Italian. I have this need. In a page I have included a 
TabStrip that draws a grid (made in C #) that contains a button that when clicked load in 
a UserControl the same page. 
I wish that when the page loads, the part relating to the UserControl is 
immediately loaded down with a downward effect, with no need to click on the button. You can 
help me? Thanks to all.
Peter
Telerik team
 answered on 17 Sep 2011
1 answer
197 views
I have used the NestedView several times but this is the first time I see this error.
I have a RadChar and a RadGrid in the nested and when I click on any row at first time, then the nested doesn't open, but after, I can open all nested.
  • I tried  change de databind of radchart on OnItemCommand and but not work
  • If  I remove de ajax it works prefectly
  • The subRadGrid created in the nested work, and do databind in the OnItemDataBound correctly
Why I lost first click?

ASPX
<telerik:RadGrid ID="RadGridInfoRecharges"
            OnItemCommand="RadGridInfoRecharges_ItemCommand"
            OnItemDataBound="RadGrid1_ItemDataBound"
            Skin="Default"
            runat="server"
            AutoGenerateColumns="False"
            AllowPaging="True"
            GridLines="Horizontal"
            CssClass="groupBox">
        <ExportSettings ExportOnlyData="false" FileName="Recharges" 
            IgnorePaging="true" OpenInNewWindow="True">
            <Csv ColumnDelimiter="Semicolon" />
        </ExportSettings>
            <MasterTableView DataSourceID="ObjectDataSourceGetRecharges" PageSize="50" DataKeyNames="OwnerId">
                <NestedViewTemplate>
                        <asp:Panel ID="NestedViewPanel" CssClass="InfoRechargesDetails" runat="server" >
                            <telerik:RadGrid ID="RadGridInfoRechargesNested"
                                    Skin="Default"
                                    runat="server"
                                    AutoGenerateColumns="False"
                                    AllowPaging="False"
                                    GridLines="Horizontal">
                                <MasterTableView>
                                    <Columns>
                                        <telerik:GridBoundColumn HeaderText="Credit"  DataFormatString="{0:N0}" DataField="Credit" UniqueName="Credit"></telerik:GridBoundColumn>
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
                            <telerik:RadChart ID="rcRechargesStatisticsRecharges" Width="900" Height="300" runat="server"
                            DefaultType="Line" Legend-Appearance-Visible="false" 
                            Legend-Visible="false" BorderWidth="0">
                            </telerik:RadChart>
                        </asp:Panel>
                </NestedViewTemplate>
                <ExpandCollapseColumn Visible="True"></ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn HeaderText="OwnerId"  ItemStyle-HorizontalAlign="Right" DataField="OwnerId" UniqueName="OwnerId"></telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
    </telerik:RadGrid>


CS ItemDataBound
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
       {
           if (e.Item is GridNestedViewItem)
           {
               int OwnerId = ((RechargeItemByContract)e.Item.DataItem).OwnerId;
               RadChart rcRechargesStatisticsRecharges = (RadChart)e.Item.FindControl("rcRechargesStatisticsRecharges");
               RadChart rcRechargesStatisticsPrices = (RadChart)e.Item.FindControl("rcRechargesStatisticsPrices");
 
               // DATA
               List<RechargeItemLite> Data = RechargesBLL.GetRechargeItemLite(OwnerId);
 
               if (Data.Count > 1)
               {
                   rcRechargesStatisticsRecharges.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortDate;
                   rcRechargesStatisticsRecharges.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 45;
                   rcRechargesStatisticsRecharges.PlotArea.XAxis.AutoScale = false;
                   rcRechargesStatisticsRecharges.PlotArea.XAxis.IsZeroBased = false;
                   rcRechargesStatisticsRecharges.Legend.Visible = false;
                   rcRechargesStatisticsRecharges.ChartTitle.TextBlock.Text = "Creditos por recarga";
                   rcRechargesStatisticsRecharges.DataSource = Data;
                   double steps = (Data[0].OADate - Data[Data.Count - 1].OADate) / Data.Count;
                   rcRechargesStatisticsRecharges.PlotArea.XAxis.AddRange(Data[Data.Count - 1].OADate, Data[0].OADate, steps);
                   rcRechargesStatisticsRecharges.DataBind();
 
                   rcRechargesStatisticsRecharges.Series[0].DataXColumn = "OADate";
                   rcRechargesStatisticsRecharges.Series[1].Visible = false;
                   rcRechargesStatisticsRecharges.Series[2].Visible = false;
 
                   rcRechargesStatisticsRecharges.Visible = true;
               }
               else
                   rcRechargesStatisticsRecharges.Visible = false;

Or try
CS ItemComman
        protected void RadGridInfoRecharges_ItemCommand(object source, GridCommandEventArgs e)
        {
            // cazar el evento del expand/collapse
            if (e.CommandName == RadGrid.ExpandCollapseCommandName)
            {
                // Si el nestview no esta expandido significa que ahora es se expandera
                if (!e.Item.Expanded)
                {
                    #region declaraciones controles
                    RadGrid RadGridInfoRechargesNested = (RadGrid)((GridDataItem)e.Item).ChildItem.FindControl("RadGridInfoRechargesNested");
                    RadChart rcRechargesStatisticsRecharges = (RadChart)((GridDataItem)e.Item).ChildItem.FindControl("rcRechargesStatisticsRecharges");
                    RadChart rcRechargesStatisticsPrices = (RadChart)((GridDataItem)e.Item).ChildItem.FindControl("rcRechargesStatisticsPrices");
                    #endregion
                    // Extraemos la información de DataKeyValue desde la grid principal
                    int OwnerId = (int)((GridDataItem)e.Item).GetDataKeyValue("OwnerId");
 
                    // DATA
                    List<RechargeItemLite> Data = RechargesBLL.GetRechargeItemLite(OwnerId);
 
                    RadGridInfoRechargesNested.DataSource = Data;
                    RadGridInfoRechargesNested.DataBind();
 
                    if (Data.Count > 1)
                    {
                        rcRechargesStatisticsRecharges.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortDate;
                        rcRechargesStatisticsRecharges.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 45;
                        rcRechargesStatisticsRecharges.PlotArea.XAxis.AutoScale = false;
                        rcRechargesStatisticsRecharges.PlotArea.XAxis.IsZeroBased = false;
                        rcRechargesStatisticsRecharges.Legend.Visible = false;
                        rcRechargesStatisticsRecharges.ChartTitle.TextBlock.Text = "Creditos por recarga";
                        rcRechargesStatisticsRecharges.DataSource = Data;
                        double steps = (Data[0].OADate - Data[Data.Count - 1].OADate) / Data.Count;
                        rcRechargesStatisticsRecharges.PlotArea.XAxis.AddRange(Data[Data.Count - 1].OADate, Data[0].OADate, steps);
                        rcRechargesStatisticsRecharges.DataBind();
 
                        rcRechargesStatisticsRecharges.Series[0].DataXColumn = "OADate";
                        rcRechargesStatisticsRecharges.Series[1].Visible = false;
                        rcRechargesStatisticsRecharges.Series[2].Visible = false;
 
                        rcRechargesStatisticsRecharges.Visible = true;
                    }
                    else
                        rcRechargesStatisticsRecharges.Visible = false;
Pavlina
Telerik team
 answered on 17 Sep 2011
3 answers
198 views
Hi,

We are using Radscheduler in our project. We need to show the dropdown calendar near the Header "Today" with 2 months column in a row. so we made the following changes.
 
RadCalendar popupCalendar = RadScheduler1.FindControl("SelectedDateCalendar") as RadCalendar;
 popupCalendar.AutoPostBack = true;
 popupCalendar.MultiViewColumns = 2;

This code shows 2 months but the problem now is, we are not able to navigate to next, previous, fast next and fast previous navigation.
When we click the next button  nothing happens. It seems the Autopost back is not working even we gave that in our code.

Please help us to resolve this issue.

Gopakumar
Plamen
Telerik team
 answered on 17 Sep 2011
2 answers
179 views
Hello,

I was wondering teh following:
In search of SEO friendly url's Implemented "Routing" in my ASP.NET webform application. This gives us nice url's like:
 www.portal.com/products/Show/UX-7624
for example.
Now, working on a different application with AJAX and one page that loads usercontrols (modules) I was wondering how to combine the two of them. Is that even possible? Because the first application I mentioned does a URL click for a product view, while the second does it internal and keeps www.portal.com/default.aspx in the address bar...

Any ideas of experiance about this anyone?

Thanks,

Erik

Erik
Top achievements
Rank 2
 answered on 17 Sep 2011
2 answers
152 views
Hi,

I am having one issue with radGrid. I have nested radgrids and while exporting them to word, I get one extra inputbox in document, which is not visible in grid while pressing the export button.

Please check the attached images.

Here is the aspx page code for inner grid:
<telerik:RadGrid ID="radComments" AllowPaging="True" runat="server" PageSize="15" Skin="" GridLines="None" BorderStyle="None" BorderColor="Transparent" ShowHeader="false"                                                      OnItemCommand="radComments_ItemCommand" OnItemDataBound="radComments_ItemDataBound"                                          OnItemCreated="radComments_ItemCreated" Width="100%" EnableTheming="false" Style="padding-left: 16px;"               OnPageIndexChanged="radComments_PageIndexChanged">                                                                             <PagerStyle Mode="NumericPages" />                                                                                              <ExportSettings ExportOnlyData="true">                                                                                  </ExportSettings>
<MasterTableView TableLayout="Fixed" Width="100%" Height="100%" BorderStyle="None"                                          DataKeyNames="BookID,commentid,CommentAttachment,userid,Commenttype">                                                    <ItemTemplate>
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td valign="top" align="left" style="text-align: center; width: 5%; border: 1px;border-style: solid; padding-bottom: 5px;" class="box-border">                                                                                                                            <asp:Image ImageAlign="AbsMiddle" ID="imgWriterImage" runat="server" />
</td>
<td width="20%" align="left">
<strong><%# Eval("UserName") + ":" %></strong>
</td>
<td class="altbg" width="45%" align="left"><%# Eval("Commenttext") %></td>
<td width="20%" align="left">
<asp:Label ID="lblType" runat="server" Text='<%# Eval("Commenttype") %>'></asp:Label>
</td>
<td id="tdEditDelete" runat="server" align="center" width="20%">
<asp:HiddenField ID="hdnCommentID" runat="server" Value='<%# Eval("commentid") %>' />
<asp:HiddenField ID="hdnBookID" runat="server" Value='<%# Eval("bookid") %>' />
<asp:ImageButton ID="btnImgEdit" runat="server" ImageUrl="~/Forum/ForumImages2/edit.gif" OnClientClick="Edit(this);return false;" ToolTip="Edit" />
<asp:ImageButton ID="btnImgDelete" runat="server" ImageUrl="~/Forum/ForumImages2/delete.gif"class="DelComment" ToolTip="Delete" /></td></tr></table>
</ItemTemplate>
</MasterTableView>
</telerik:RadGrid>

Why I am getting extra inputbox in word after export?
Daniel
Telerik team
 answered on 17 Sep 2011
1 answer
122 views
Hi
I have a rad menu and I want to handle Item Clicked event. So I set NavigateUrl="" and  write a handler for the event and it works ok. However if the current form has required field validators and the form has empty fields the validation failure causes ItemClick not to be fired. Is there any way to work around this/fix this ?
Thanks
Jayesh Goyani
Top achievements
Rank 2
 answered on 17 Sep 2011
4 answers
92 views
Guys,

I previously had my scheduler set up to be the regular way, server side w/ postbacks, and I had a lot of custom functionality built into the AppointmentDataBound function that now doesn't work because I'm running web services binding.

How can I build this functionality with web services binding? It's key to my project working.

Even my Category resource list is managed via the database, so I can't use the static resource coloring feature.

Thoughts?

protected void radAppointments_AppointmentDataBound(object sender, SchedulerEventArgs e) {
        if (e.Appointment.Resources.GetResourceByType("Category") != null) {
            bvAppointmentCategory c = new bvAppointmentCategory(int.Parse(e.Appointment.Resources.GetResourceByType("Category").Key.ToString()));
            e.Appointment.CssClass = c.CssClass;
        }

        if (e.Appointment.ID != null) {
            bvAppointmentDoctor a;

            if (e.Appointment.RecurrenceParentID == null) {
                a = new bvAppointmentDoctor(int.Parse(e.Appointment.ID.ToString()));
            } else {
                a = new bvAppointmentDoctor(int.Parse(e.Appointment.RecurrenceParentID.ToString()));
            }

            String subject = e.Appointment.Subject;
            String client_name = "";
            String pet_name = "";
            String confirmed = "";

            if (a.ClientID != null) {
                bvClient client = new bvClient(a.ClientID.Value);
                client_name = " w/ " + client.PrimaryFirstName + " " + client.PrimaryLastName + " @ " + client.PrimaryPhoneHome;
            }

            if (a.PetID != null) {
                bvPet p = new bvPet(a.PetID.Value);
                pet_name = " (" + p.Name + ")";
            }

            if (e.Appointment.RecurrenceState == 0) {
                if (a.Confirmed) {
                    confirmed = " Confirmed? - [X]";
                } else {
                    confirmed = " Confirmed? - [ ]";
                }
            }

            e.Appointment.Subject = subject + client_name + pet_name + confirmed;
        }

        if (c_security_level < 2) {
            e.Appointment.AllowDelete = false;
        }
    }
Peter
Telerik team
 answered on 17 Sep 2011
3 answers
190 views
Hi all,
I have one problem with RadTimePicker. Here my code:
<telerik:RadTimePicker ID="RadTimePicker1" runat="server" MinDate="2011-09-11 10:00:01">
</telerik:RadTimePicker>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="RadTimePicker1"
    ErrorMessage="AAA!"></asp:RequiredFieldValidator>
<asp:Button runat="server" ID="btnSubmit" OnClick="btnSubmit_Click" Text="Submit" />

If I will click on submit button then I will see "AAA!" - it is ok.
If I will choose 11:00 and then on 9:00 then I will have 11:00 in time picker with warning icon. but if I will click on submit then I will get real submit and null in RadTimePicker1.SelectedDate, of course Page.IsValid will be false, but I will get post back.
I think this behavior is wrong. May be page should be valid and time picker should have 11:00 because user see that he has 11:00 in time picker and warning only means that he can't choose 9:00? 

Can anybody suggest a workaround?
P.S. I don't want change RequiredFieldValidator to CustomValidator.
Marin
Telerik team
 answered on 17 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?