Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
237 views
Hi,
    I set initial content while page_loaded. After i change content i can see changes by clicking track changes button.
    But there is a scenerio like this.
    First user writes a content and saves.(xml, sql etc.)
    Second user opens saved content (Page_Load)
    Makes changes and saves again.
    First user opens document. User wants to see changes made by second user. 
    How?

    Thanks.
   
Rumen
Telerik team
 answered on 11 Mar 2013
6 answers
153 views
Hi,
I have aspx page it has usercontrol, radwindow,  and inside radwindow it has radrotator.
User control  has gridview when user click linkbutton inside gridview, I am showing radwindow as a popup.
When loading aspx page I am binding data to radrotator.

When user clicks link current item is not setting properly. 
But when the window is closed and reopened it works fine.
//aspx
<
telerik:RadWindowManager ID="RWM" Height="640px" Width="870px" ShowContentDuringLoad="false" ReloadOnShow="true" runat="server">
       <Windows>
         <telerik:RadWindow ID="RW_Detail" Localization-Restore="none" runat="server" Modal="True"
                    VisibleStatusbar="False" Behaviors="Close" Title="Deck Images" IconUrl="~/images/SmallLogo.jpg">
                    <ContentTemplate>
                        <div style="background-repeat: no-repeat; box-sizing: border-box; -moz-box-sizing: border-box;">
                            <div style="margin: 0 auto;">
                                <telerik:RadRotator ID="RadRotatorDetail" Height="525px" Width="850px" BorderColor="Transparent"
                                    ItemWidth="836px" BorderWidth="0" WrapFrames="false" RotatorType="Buttons" runat="server"
                                    ControlButtons-LeftButtonID="img_left" ControlButtons-RightButtonID="img_right" Skin="MetroTouch">
                                    <ItemTemplate>
                                        <div style="overflow-y: auto; height: 510px; width: 836px">
                                            <asp:Image ID="imgDetails" ImageUrl='<%# Eval("ID")+"\\"+Eval("ImageName")%>'
                                                SlideID='<%#Eval("ID") %>' runat="server" ImageAlign="Middle" />
                                            <br />
                                        </div>
                                    </ItemTemplate>
                                </telerik:RadRotator>
                            </div>
                            <div>
                                <div style="float: right;">
                                    <asp:Image ImageUrl="~/images/ticks/arrow_right.png" ID="img_right" AlternateText="right" runat="server"
                                        Style="margin: -10px 0px; cursor: pointer;" />
                                </div>
                                <div style="float: left">
                                    <asp:Image ImageUrl="~/images/ticks/arrow_left.png" ID="img_left" AlternateText="left" runat="server"
                                        Style="margin: -10px 0px; cursor: pointer;" />
                                </div>
                            </div>
                        </div>
                        <br />
                    </ContentTemplate>
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
//Inside Aspx.cs
MainDetails mDetails = new MainDetails();
DataSet ds = mDetails.Get_Details(m_ID, false) as DataSet;
RWM.Shortcuts.Add("Close", "Esc");
RadRotatorDetail.DataSource = ds;
RadRotatorDetail.DataBind();
<asp:TemplateField HeaderText="More Detail">
<ItemTemplate>
<asp:LinkButton ID="LB" runat="server" OnClientClick=<%# "Show_Window('" + Eval("ID") +"'); return false;" %>
                     Text='<%# Eval("Pro_Name") %>'></asp:LinkButton>
</ItemTemplate>
<ControlStyle Font-Bold="False" ForeColor="#003399" />
     <ItemStyle HorizontalAlign="Justify" />
</asp:TemplateField>
//javascript inside usercontrol.
<
script type="text/javascript">
    function Show_Window(ID) {
        var oManager = GetRadWindowManager();
        var oWnd = oManager.GetWindowByName("RW_S");
        var radRotator = GetRadRotator();
        var RadImgItems = radRotator.get_items();
   
ID = firstItem(ID);
        for (var name in RadImgItems) {
            if (ID == GetAttributeValue(RadImgItems[name], "SlideID")) {
                radRotator.set_currentItemIndex(RadImgItems[name].get_index(), false);
                radRotator.repaint();
            }
        }         
        oWnd.Show();
    }
    function firstItem(ID) {
        if (ID.indexOf(",") !== -1) {
            var firstItemName = ID.substring(0, ID.indexOf(","));
        }
        else
            firstItemName = ID;
        return firstItemName.trim();
    }
    function GetAttributeValue(item, name) {
        return $telerik.$(item.get_element()).find("img").attr(name);
    }
Am I missing something? How to force it to load correct index? In first popup it does goes through
 radRotator.set_currentItemIndex(RadImgItems[name].get_index(), false);

Best Regards,
Damdoar
Slav
Telerik team
 answered on 11 Mar 2013
3 answers
147 views
Hello,

We are doing an html export of a page that has a Radgrid placed inside. We have some problem with telerik skin and with scripts. 
The grid html export  is made by the overriden render function of the page, we do that in this way because we need other parts of the page on a html and pdf export.

How can I export with embeded styles?


thanks in advance,
Emanuele
MgfProject s.r.l.
Alessandro
Top achievements
Rank 1
 answered on 11 Mar 2013
5 answers
364 views
Hi!

I have a RadDatePicker that I want to reset its value on the server-side during a postback when the input is invalid. But it seems that once the property InvalidTextBoxValue is set, there is no way to clear that.

My test code looks something like this:

If Page.IsPostBack AndAlso Not String.IsNullOrEmpty(Me.RadDatePicker1.InvalidTextBoxValue) Then
    ' None of the following will help to show a new selected date in the date input -- the date input will fail to show anything
    Me.RadDatePicker1.Clear()
    Me.RadDatePicker1.SelectedDate = Now.Date
    Me.RadDatePicker1.DateInput.Clear()
    Me.RadDatePicker1.DateInput.SelectedDate = Now.Date
End If

I studied the source code in RadDateInput.cs and there are two variables used by InvalidTextBoxValue:

protected bool invalidDateStringFlag = false;
protected string invalidDateString;

It seems that those variables are never cleared anywhere, and once they are set there is no way to reset them, and those variables are affecting the logic of several properties and functions.

Shouldn't these variables be cleared when calling RadDatePicker.Clear or when setting RadDatePicker.SelectedDate, so that the RadDatePicker starts to behave "normally" again? Otherwise the RadDatePicker remains locked in its "invalid state" no matter what.

As an example, the following property of RadDateInput will never work properly again once the invalidDateStringFlag was set, since that flag is never cleared:

public virtual DateTime? SelectedDate
{
    get
    {
        if (String.IsNullOrEmpty(Text) || invalidDateStringFlag)
        {
            return null;
        }
        else
        {
            return DateTime.ParseExact(Text, hiddenFormat, DateTimeFormatInfo.InvariantInfo);
        }
    }
    set
    {
        if (value.HasValue)
        {
            if ((value > MaxDate) || (value < MinDate))
            {
                throw new ArgumentOutOfRangeException("SelectedDate", String.Format("Value of '{0}' is not valid for 'SelectedDate'. 'SelectedDate' should be between 'MinDate' and 'MaxDate'.", value));
            }
            Text = value.Value.ToString(hiddenFormat, DateTimeFormatInfo.InvariantInfo);
        }
        else
        {
            Text = null;
        }
    }
}

Setting a new value for the SelectedDate will not change anything -- the returned value will always be Null in that state, no matter what it is changed server-side on the RadDatePicker!

I am using version Telerik.Web.UI.dll 2010.3.1109.35

So, the final question is how to put a new valid value into a RadDatePicker after the user has entered an invalid value? This should preferably be done server-side, since there are some other actions too that need to be taken following an invalid date input (not just resetting the date picker).
Vasil
Telerik team
 answered on 11 Mar 2013
0 answers
60 views
I want to take fromDate, toDate and working days from user and display it. I am new to telerik controls so i couldnt figure out how.

ex: fromDate: 3/10/2013
     toDate: 5/15/2013
     working days: monday, tuesday (in check box)

Now i want the others users to be able to select year(combobox autopostback) and then select months(combobox autopostback) and days (combobox, but only mondays and tuesdays)..

thank you...
SKM
Top achievements
Rank 1
 asked on 11 Mar 2013
1 answer
88 views
Hi there.

I'm using a Rotator set in CoverFlowButtons mode and on the whole it works fine. However, I have a situation whereby the current index of the rotator gets changed by some javascript code based on an external condition. When the index changes from the first item to any other item in the collection the previous button doesn't get enabled. If my code changes the index to the last item in the list I also find that the next button doesn't get disabled. However, if I interact directly with the rotator by clicking on one of the items or by clicking the next button while there is a next item to go to the enabling and disabling of the buttons then happens correctly. It's just the initial entry to the form and manipulation of the rotator via the javascript prior to actually doing something manual with it where the issue manifests itself. Is there something I can or should do to ensure that the buttons disable and enable correctly or is this a fault that you can fix?

The actual code I use to change the relevant item is as follows:
if (itemIndex != -1) {
    var coverFlow = $find('<%= CoverFlow.ClientID %>');
    $(coverFlow.set_currentItemIndex(itemIndex, false));
}
The "itemIndex" is a value that is calculated initially based on certain conditions.


Thanks and regards
Slav
Telerik team
 answered on 11 Mar 2013
1 answer
225 views
Hi,

The situation is as follows - in my RadGrid, in GridTemplateColumn, I've got a RadButton that is supposed to fire OnClick button. I also have SelectedIndexChanged assigned for the same RadGrid. When the button type was set to StandardButton, everything worked just fine - onClick event was triggered every time I clicked the button. I had to change button type to LinkButton, though (for styling reasons), and from that moment on, clicking the button fires SelectedIndexChanged event, instead (in 90% of cases). How can I force it to raise (or prioritise) OnClick event again?

Regards,
Radek
Danail Vasilev
Telerik team
 answered on 11 Mar 2013
3 answers
159 views
Hi,

Probably a strange request this one, but..
How do i get a radwindow to have the same appearance as a radtooltip ?
ie; no border and background colour etc,

Many Thanks
Mark
Marin Bratanov
Telerik team
 answered on 11 Mar 2013
1 answer
122 views
Hi,

I am using RadAsyncUpload in our application.  I want to allow user to type full file path in textbox of RadAsyncUpload control.

Note : it allows me to paste any data but not allow to type in textbox.

 How to achieve this?

Thanks,
Dipal
Hristo Valyavicharski
Telerik team
 answered on 11 Mar 2013
1 answer
143 views

If you are using the window as a 3 page wizard is it possible to set the window arguments on a button click on page 2 that will be used in the OnClientClose event when the window is closed using the x or another close button on page 3?

Here is how I am trying to set the arguments on page 2

function GetRadWindow() {
         var oWindow = null;
            if (window.radWindow)
            {
            oWindow = window.radWindow;
            }
            else if (window.frameElement != null && window.frameElement.radWindow)
            {
            oWindow = window.frameElement.radWindow;
            }
            return oWindow;
      }
 
function OnClientClose(oWnd, args) {
          var arg = args.get_argument();
          if (arg) {
              if (arg.functionName) {
                  if (arg.functionName == "ajaxRequest") {
                      var eventArg = arg.functionArg;
                      ajaxMngrRequest(eventArg);
                  }
              }
          }
          else {
              alert('No Arg');
          }
          oWnd.remove_close(OnClientClose);     
      }
 
function SetReturnArgs(varFunction, varArg) {
    var oWnd = GetRadWindow();
    var oArg = new Object();
 
        oArg.functionName = varFunction;
        oArg.functionArg = varArg;
        oWnd.argument = oArg;
}
 
 protected void btnSetArgs_Click(object sender, System.EventArgs e)
        {
            ScriptManager.RegisterClientScriptBlock(
                  this.Page,
                  this.GetType(),
                  "WebUserControlScript",
                  "SetReturnArgs('ajaxRequest', 'eventArg')",
                  true);
        }


Thanks in advance!!!

Regards,
Dave

Marin Bratanov
Telerik team
 answered on 11 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?