Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
143 views
Hi,

I'm using single click buttons.  What do I need to do for the client-side validators to fire before the button gets disabled?  The problem I'm having is my button is becoming disabled in the OnClientClicked, but my asp:RequiredFieldValidators are preventing the form from being submitted.  I only want the single click feature to kick in if all the client-side validation passes.

Thanks,
Mike
Slav
Telerik team
 answered on 31 Aug 2011
6 answers
234 views
Hi,

This is my code ,

<telerik:RadEditor runat="server" OnClientSubmit="OnClientSubmit" ID="RadEditor1" 
ContentFilters="None">
<Content>
<table width="100%" cellspacing="0" cellpadding="0" border="0" align="left" style="background-color: #ffffff; margin: 0px;"><tbody><tr><td valign="top" align="right"> <img alt=""  src="/editorQ2SP12008/Images/Deisy.jpg"  align="left" /></td></tr></tbody></table>
</Content>
</telerik:RadEditor>
------------------------------------------------------------------------------------------------------------------
Facing Issue  :
1 ] When i change ContentFilters="None"  ---- > in browser Firefox Changing the Hex colour(style="COLOR: #000000") to RGB(style="color: rgb(0, 0, 0)).
2 ] When i change ContentFilters="ConvertToXhtml" ---- >  align="left"  (inside Img Tag name) converting to style="float: left;".


Please help me out as soon as possible.

Thanks 
Anand
Rumen
Telerik team
 answered on 31 Aug 2011
0 answers
175 views
Sorry this is for a listbox not a combobox but the answer should be the same.

========================================================================

I am using two Comboboxes in an asp.net form that also uses EOWeb's progressbar. Everything seems to work internally. The file is called from the first box processed and moved to the second box. Unfortunately when calling it from within this function the boxes never display the new information.

How can I trigger this change or display the changes once completed? here is the code I am using

protected void ProgressBar2_RunTask(object sender, EO.Web.ProgressTaskEventArgs e)
{
    int tcount = UploadListBox.Items.Count;
    if (tcount < 1)
    {
        e.UpdateProgress(0, "You must have files to process.");
        return;
    }
    int increment = 100 / tcount;
    int completed = 0;
    string pfile;
    string[] fileparts;
    //var item = new Telerik.Web.UI.RadListBoxItem();
    for (int i = 0; i < (tcount); i++)
    {
        string filetype;
        InitMstrVariables();
        InitFGVariables();
        InitTransactionSet();
        pfile = UploadListBox.Items[0].Value.ToString();
        e.UpdateProgress(completed, "Processing: " + pfile);
        fileparts = pfile.Split('_');
        MstrType = Right(fileparts[1], 1).ToUpper();
        Batch = Convert.ToInt32(fileparts[0]);
        MstrYearMonth = Convert.ToInt32(Left(fileparts[3], 6));
        DateCreated = StrToDate(fileparts[3]);
        filetype = Left(fileparts[1], 3);
        if (filetype == "834")
        {
            DeleteBatch834();
            ProcessFile834(pfile);
        }
        else if (filetype == "820")
        {
            DeleteBatch820();
            ProcessFile820(pfile);
        }
        var item = new Telerik.Web.UI.RadListBoxItem();
        item.Value = pfile;
        item.Text = pfile;
        ProcessedListBox.Items.Add(item);
        UploadListBox.Items[0].Remove();
        File.Delete(filepath + pfile);
        completed = completed + increment;
    }
    e.UpdateProgress(100, "Completed...");
}

 The progressbar does call this javascript routine as well.

function OnProgress(progressBar)
{
    var extraData = progressBar.getExtraData();
    if (extraData)
    {
        //The following code demonstrates how to update
        //client side DHTML element based on the value
        //RunTask passed to us with e.UpdateProgress
        var div = document.getElementById("divStatus");
        div.innerHTML = extraData;      
    }
}

Help is always greatly appreciated.


David
Top achievements
Rank 1
 asked on 31 Aug 2011
1 answer
99 views
In the RadScheduler live demo code I found an exchange provider created for Exchange 2007 (also mentioned here http://www.telerik.com/help/aspnet-ajax/scheduler-exchange-provider.html).

But Microsoft Exchange Server 2010 SP1 provides new and improved Web services interfaces that you can use to implement client applications that access and manage Exchange store items (http://msdn.microsoft.com/en-us/library/dd877059(v=exchg.140).aspx).

I wonder would the current provider be compatible with Microsoft Exchange Server 2010 SP1 Web services? Do you plan to update the provider code?
Kalina
Telerik team
 answered on 31 Aug 2011
0 answers
72 views
Hi there,

I have a question about Scheduler. I have a working scheduler now with timeslots. But every time when I opening a Advanced form the color /timeslots disappear ont he background. My Advanced form is a modal form. Does someone else have this problem to?

Thanks

Nvm: I don't need this anymore. Sorry for the inconvenience. 
Sander
Top achievements
Rank 1
 asked on 31 Aug 2011
3 answers
99 views
hi.
thank you for your help.
 i wonder to ask about a way to read data from an XML file and insert them to a rad list box.
my xml structure is like this:
<Title>
    <Images>
        <Image> 1.jpg</Image>
        <text>something</text>
     <Images>
    .
     .
       .
<Title>
i want to load value of <image> tag into image url propertie and value of <text> tag to text propertie of each item in radlistbox.

Dimitar Terziev
Telerik team
 answered on 31 Aug 2011
2 answers
534 views
I have a chart that is displaying 365 days of data and I want the X axis labeled only by month. Seems like a simple request but after spending considerable time looking at documentation and numerous forum posts, it looks like it is not as easy as it seems. I have also included an image of how my chart renders. I can get the range on the x axis to display fine however the plotted line does not extend to the end of the graph. Even if the monthly labels are impossible to achieve, I need to AT LEAST get that plotted line to scale to the end of the graph. Of course when I turn the auto scaling on the X axis range does not work.

Here is my chart and code behind.

<telerik:RadChart ID="rc1" runat="server" DataSourceID="SqlDataSource1" DefaultType="Line"
    Width="600px">
    <Series>
        <telerik:ChartSeries DataYColumn="ClosePrice" Name="ClosePrice" Type="Line">
            <Appearance ShowLabels="false">
                <FillStyle MainColor="213, 247, 255">
                </FillStyle>
            </Appearance>
        </telerik:ChartSeries>
    </Series>
    <Legend Visible="False">
        <Appearance Visible="False">
        </Appearance>
    </Legend>
    <PlotArea XAxis-AutoScale="False">
        <Appearance Dimensions-Margins="18%, 5%, 22%, 10%">
        </Appearance>
        <XAxis LayoutMode="Inside" AutoScale="false" LabelStep="45">
            <Appearance ValueFormat="ShortDate" MajorGridLines-Visible="false">
                <LabelAppearance RotationAngle="45" Position-AlignedPosition="Top">
                </LabelAppearance>
            </Appearance>
        </XAxis>
        <YAxis IsZeroBased="false" AxisMode="Extended">
        </YAxis>
    </PlotArea>
    <ChartTitle>
        <TextBlock Text="Title Here" />
    </ChartTitle>
</telerik:RadChart>

SqlDataSource1.SelectCommand = "select * from BofIHistoricalData where datadate between '" + 
            DateTime.Now.Date.AddMonths(-12).ToString() + "' and '" + DateTime.Now.Date.AddDays(-1) + "'" +
            "order by datadate";
               
            double today = DateTime.Now.Date.ToOADate();
            double lastYear = DateTime.Now.Date.AddMonths(-12).ToOADate();
            rc1.PlotArea.XAxis.AddRange(lastYear, today, 1);
Tony
Top achievements
Rank 1
 answered on 31 Aug 2011
5 answers
409 views
 

Hi

I am using RadGrid With Paging(Mode:NextPrevAndNumeric).

Issue:-

The Problem is when i change the Page Size From the dropdown Let's say 2 to 10. then there is no record Display even the Grid has 5 records.

This Problems has Come after I implemented the "expand/collapse images when no records" in the grid followed your tetelrik article.

If I do the, Hieararchy Load Mode="Server" or remove "expand/collapse images when no records" behaviour then it's works fine.

But I need Both feature..

I also Attached the Code and Images

 

<

 

telerik:RadGrid AutoGenerateColumns="False" ID="rgSurvey" AllowPaging="True" AllowSorting="True"

 

                AllowCustomPaging="True" AllowAutomaticInserts="false" AllowAutomaticUpdates="false"
                AllowAutomaticDeletes="true" OnItemCommand="rgSurvey_ItemCommand" OnSortCommand="rgSurvey_SortCommand"
                OnNeedDataSource="rgSurvey_NeedDataSource" runat="server" Skin="Office2007" PageSize="20"
                ShowGroupPanel="false" ClientSettings-AllowDragToGroup="true" ClientSettings-AlowExpandCollapse="true"
                OnDetailTableDataBind="rgSurvey_DetailTableDataBind" DataMember="SurveyTemplateID"
                OnItemDataBound="rgSurvey_ItemDataBound"  OnPreRender="rgSurvey_PreRender"
                <PagerStyle Mode="NextPrevAndNumeric" />
                <MasterTableView TableLayout="Fixed" DataKeyNames="SurveyTemplateID" HierarchyDefaultExpanded="false"
                    CommandItemDisplay="None" CommandItemSettings-AddNewRecordText="Add New User" HierarchyLoadMode="Client">
                    <DetailTables>
                        <telerik:GridTableView AllowPaging="false" AllowSorting="false" >
                            <Columns>
<telerik:GridTemplateColumn UniqueName="LockUnlock" HeaderText="" HeaderStyle-Width="70"
                                        ItemStyle-HorizontalAlign="Center" ItemStyle-Width="70">
                                        <itemtemplate
                                         <asp:ImageButton ID="Image1" runat="server" OnClientClick="return checkuserlock(this);" CommandName="UnlockSurvey" /> <br />
                                         <asp:Label ID="lblLockUserName" runat="server" Text='<%# Eval("LockUserName") %>' />
                                         <asp:Label ID="lblInnerLockUserId" runat="server" Text='<%# Eval("LockUserID") %>' style="display:none;"></asp:Label>
                                       </itemtemplate>
                                       </telerik:GridTemplateColumn>                                
                                <telerik:GridBoundColumn HeaderText="Version" DataField="SurveyVersion" HeaderStyle-Width="40">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn HeaderText="ID" DataField="SurveyTemplateID" UniqueName="SurveyTemplateID"
                                    SortExpression="SurveyTemplateID" HeaderStyle-Width="40" />
                                <telerik:GridButtonColumn HeaderText="Title" DataTextField="SurveyName" UniqueName="SurveyName"
                                    ItemStyle-Font-Bold="false" SortExpression="SurveyName" CommandName="editcontent" />
                                <telerik:GridBoundColumn HeaderText="Created By" DataField="UserNAME">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn HeaderText="Last Updated By" DataField="LastUpdatedUser">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn HeaderText="Approved By" DataField="ApprovedBy">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn HeaderText="Active Date" DataField="ActiveDate">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn HeaderText="Termination Date" DataField="TerminationDate">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn HeaderText="Approval Status" DataField="ApprovalStatus">
                                </telerik:GridBoundColumn>
                                 <telerik:GridBoundColumn HeaderText="" DataField="LockUserID" Visible="false">
                            </telerik:GridBoundColumn>
                            </Columns>
                        </telerik:GridTableView>
                    </DetailTables>
                    <Columns>
<telerik:GridTemplateColumn UniqueName="LockUnlock" HeaderText="" HeaderStyle-Width="70"
                            ItemStyle-HorizontalAlign="Center" ItemStyle-Width="70">
                            <ItemTemplate>
                                <asp:ImageButton ID="Image1" runat="server" OnClientClick="return checkuserlock(this);" CommandName="UnlockSurvey"/><br />
                                <asp:Label ID="lblLockUserName" runat="server" Text='<%# Eval("LockUserName") %>' />
                                <asp:Label ID="lblLockUserId" runat="server" Text='<%# Eval("LockUserID") %>' style="display:none;"></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn HeaderText="Version" DataField="SurveyVersion" HeaderStyle-Width="40">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="ID" DataField="SurveyTemplateID" UniqueName="SurveyTemplateID"
                            SortExpression="SurveyTemplateID" HeaderStyle-Width="40" />
                        <telerik:GridButtonColumn HeaderText="Title" DataTextField="SurveyName" UniqueName="SurveyName"
                            ItemStyle-Font-Bold="true" ItemStyle-ForeColor="Red" SortExpression="SurveyName"
                            CommandName="editcontent" />
                        <telerik:GridBoundColumn HeaderText="Created By" DataField="UserNAME" SortExpression="UserNAME">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Last Updated By" DataField="LastUpdatedUser"
                            SortExpression="LastUpdatedUser">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Approved By" DataField="ApprovedBy" SortExpression="ApprovedBy">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Active Date" DataField="ActiveDate" SortExpression="ActiveDate">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Termination Date" DataField="TerminationDate"
                            SortExpression="TerminationDate">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Approval Status" DataField="ApprovalStatus"
                            SortExpression="ApprovalStatus">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="" DataField="LockUserID" Visible="false">
                        </telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
  
protected override void OnLoad(EventArgs e)
        {
  
            base.OnLoad(e);
  
            if (!Page.IsPostBack)
            {
 this.rgSurvey.PageSize = 2;
  }
        }
  
 protected void rgSurvey_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            if (!e.IsFromDetailTable)
            {
                                SetSurveyContentGridDataSource();
               
                            }
        }
  
  
  
  private void SetSurveyContentGridDataSource()
        {
            int totalRecord = 0;
            this.rgSurvey.DataSource = GetSearchBySurvey(ref totalRecord);
            this.rgSurvey.VirtualItemCount = totalRecord;
                   }
  
private List<GetSearchSurveyResult_Result> GetSearchBySurvey(ref int totalRecord)
        {
            string approvalstatus = string.Empty;
            SurveyQuestionBL oSurveyCategory = new SurveyQuestionBL();
            int pageSize = this.rgSurvey.PageSize;
            string sortExpression = GetSortedColumnName("SURVEY");
            string sortDirection = GetSortedDirection("SURVEY");
  
            foreach (ListItem li in cbApprovalStatus.Items)
            {
                if (li.Selected == true)
                {
                    approvalstatus += li.Value + ",";
                }
            }
            GetSearchSurveyResult_Result obj = new GetSearchSurveyResult_Result
            {
                SurveyTemplateID = txtSurveyID.Text.Length > 0 ? Convert.ToInt32(txtSurveyID.Text) : 0,
                SurveyName = txtSurveyTitle.Text,
                SurveyScopeID = Convert.ToInt32(rblScope.SelectedValue),
                ApprovalStatusID = approvalstatus,
                ClientID = Convert.ToInt32(rblScope.SelectedValue) ==(int) Scope.ClientSpecific ? (int?)Convert.ToInt32(ddlClientList.SelectedValue) : null
  
            };
            //int pageSize = this.rgSurvey.PageSize;
            var list = oSurveyCategory.GetAllSurveyResult(pageSize, obj, rgSurvey.CurrentPageIndex, ref totalRecord, sortExpression, sortDirection);
            oSurveyCategory = null;
            return list;
  
        }
  
protected void rgSurvey_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
            SurveyQuestionBL oReportingCategory = new SurveyQuestionBL();
            // int record;          
            GridDataItem parentItem = e.DetailTableView.ParentItem as GridDataItem;
            string surveyTemplateID = parentItem.GetDataKeyValue("SurveyTemplateID").ToString();
            this.rgSurvey.DataSource = oReportingCategory.GetNestedSurveyById(Convert.ToInt32(surveyTemplateID));
            //this.rgSurvey.AllowPaging = false;
  
  
        }
  
  protected void rgSurvey_PreRender(object sender, EventArgs e)
        {
            HideExpandColumnRecursive(rgSurvey.MasterTableView);
        }
        public void HideExpandColumnRecursive(GridTableView tableView)
        {
            GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);
            foreach (GridNestedViewItem nestedViewItem in nestedViewItems)
            {
                foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)
                {
                    if (nestedView.Items.Count == 0)
                    {
                        TableCell cell = nestedView.ParentItem["ExpandColumn"];
                        cell.Controls[0].Visible = false;
                        nestedViewItem.Visible = false;
                    }
                    if (nestedView.HasDetailTables)
                    {
                        HideExpandColumnRecursive(nestedView);
                    }
                }
            }
        }
  
 protected void rgSurvey_SortCommand(object source, GridSortCommandEventArgs e)
        {
            // if (rblSearchType.SelectedValue == "1")
            //{
            SetSortedColumnName("SURVEY", e.CommandArgument.ToString());
            SetSortedDirection("SURVEY", e.NewSortOrder.ToString());
            BindContentSurveyGrid();
}
  protected void rgSurvey_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            Int32 SurveyId, dbResult;
            int LockUserID, Edit;
            SurveyQuestionBL oReportingCategory;
            if (e.CommandName == "editcontent")
            {
  
                oReportingCategory = new SurveyQuestionBL();
                GridDataItem item = (GridDataItem)e.Item;
                SurveyId = Convert.ToInt32(item["SurveyTemplateID"].Text);
                LockUserID = Convert.ToInt32(item["LockUserID"].Text);
  
                if (LockUserID == 0 || LockUserID == base.UserID)
                {
                    dbResult = oReportingCategory.InsertSurveyForLockUnlock(base.UserID, SurveyId);
                    Edit = 1;
                }
                else
                {
                    Edit = 2;
                }
  
                Response.Redirect("~/Survey/AddSurvey.aspx?SID=" + SurveyId + "&Edit=" + Edit, true);
  
  
  
            }
            else if (e.CommandName == "UnlockSurvey")
            {
                oReportingCategory = new SurveyQuestionBL();
                GridDataItem item = (GridDataItem)e.Item;
                SurveyId = Convert.ToInt32(item["SurveyTemplateID"].Text);
                dbResult = oReportingCategory.InsertSurveyForLockUnlock(null, SurveyId);
                rgSurvey.Rebind();
  
  
            }
            else if (e.CommandName == "ChangePageSize")
            {
                rgSurvey.PageSize = ((Telerik.Web.UI.GridPageSizeChangedEventArgs)(e)).NewPageSize;
                rgSurvey.Rebind();
            }
        }


Please Provide The Solution ASAP.

Thanks & Regards
Ashish


Ashish
Top achievements
Rank 1
 answered on 31 Aug 2011
4 answers
188 views
I am trying to get the Demo code working in my project with the Grid / Scheduler drag and drop demo and I am getting an error from the java-script function rowDropping. This line is throwing the error:

$get("TargetSlotHiddenField").value = timeSlot.get_index();

The error I get is: "Microsoft JScript runtime error: Unable to set value of the property 'value' : object is null or undefined"

I am not sure what I am missing, I have looked through the demo code several times.

Thanks!
Clark

Plamen
Telerik team
 answered on 31 Aug 2011
1 answer
101 views
avatar

Posted 2 minutes ago (permalink)

I have web application which perfectly works fine when i run through my local asp.net development server , but the problem is none of the radcontrols are responding when i run the same application through IIS7 , can i know what exactly the problem is?, should i make any explicit settings to make radcontrols works fine when run through the IIS7
Slav
Telerik team
 answered on 31 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?