Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
114 views
I'm trying to do something similar with the Schedular to what's done with the DataGrid in this .
http://www.telerik.com/help/aspnet-ajax/grdlinqtosqlbindingcrudoperations.html example.

// Something like this but on the Schedular
protected void RadGrid1_ItemUpdated(object source, GridUpdatedEventArgs e)
       {
           if (e.Exception != null)
           {
               e.ExceptionHandled = true;
               ShowErrorMessage();
           }
       }


Is there any way of catching exceptions thrown from the persisting classes. I have the following check done and like to catch the exception and show it for the user when editing an appointment.

private void CheckPermission(DataContext db)
    {
        if (db.Projects.Where(p => p.id == this.project).Single().ProjectUsers.Where(p => p.user == AdUser.UserNr && p.isAdmin == true).Count() == 0)
        {
            throw new Exception(String.Format("No permission ({0})!", AdUser.Name));
        }
    }

Is there any other way to solve this then implementing all the inserting/updating and deleting in AppointmentInsert, AppointmentUpdate, AppointmentDelete

Peter
Telerik team
 answered on 29 Jul 2010
1 answer
145 views
Hello,

I have a web page that has 2 nested GridViews.  The second GridView has a user control that contains 10 RadToolTips, 5 for Buttons and 5 for LinkButtons.  The Buttons and LinkButtons cause a window to popup using the javascript window.open.  When the window closes the parent is going to refresh the content of the 10 RadTooltips via javascript.  I cannot get a reference to any of these RadTooltips.  I am not using the RadToolTipManager.  I have no problem getting a refernce to the user control contaiining these 10 RadTooltips.

Can you please help.

Regards
Rick
Petio Petkov
Telerik team
 answered on 29 Jul 2010
2 answers
46 views
Hi all,

I have a SharePoint page-layout with mutiple RadHTMLField controls on a single page.

We are running SharePoint in muti-label mode. So have have multiple site collections running on a single farm.
Currently the ConfigFile.xml is selectedbased on site collection GUID.
ConfigFile{collectionGuid}.xml and this is working fine all the "sites" get there own toolbars.

But I want more.
I want for the second contorle on the same page a different toolbar.
The second field is not a FullHTML field so It should only have the text options like, Bold Italic etc. (kinda like this edit form)
and no images / tables nothing fancy.

How can I accomplish to have two RadHTMLField controls but both with different tool bars ?

PS De versions where are running on the server are:
RadEditorMOSS_5_8_0_Dev.zip & Telerik.Web.UI_2010_2_713_Dev.msi
Willem Kip
Top achievements
Rank 1
 answered on 29 Jul 2010
4 answers
152 views
<telerik:RadComboBox ID="radComboCustomer" Skin="Sunset" runat="server" Width="50%"
     CssClass="ComboBox" OnClientSelectedIndexChanged="setSelectedCustomerData" EnableLoadOnDemand="true"
   OnItemsRequested="radComboCustomer_ItemsRequested" ShowMoreResultsBox="true"
      EnableVirtualScrolling="true"></telerik:RadComboBox>


 protected void radComboCustomer_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
    {
        MIDAS.DAL.CompanyFactory objCustomerFactory = new MIDAS.DAL.CompanyFactory(SessionScope.FactoryScope);

        CompanyCollection allCustomer = new CompanyCollection();
        ICriteria criteria = objCustomerFactory.GetBasicCriteria();
        List<ICriterion> filters = new List<ICriterion>();
       

        if (!string.IsNullOrEmpty(e.Text))
        {
            filters.Add(Restrictions.Like("CompanyName", e.Text, MatchMode.Start));
        }

        
        foreach (ICriterion filter in filters)
        {
            criteria.Add(filter);
        }

        allCustomer = objCustomerFactory.GetAll(criteria, "CompanyName ASC");


        int itemOffset = e.NumberOfItems;
        int endOffset = Math.Min(itemOffset + 10, allCustomer.Count);
        e.EndOfItems = endOffset == allCustomer.Count;

        for (int i = itemOffset; i < endOffset; i++)
        {            
            radComboCustomer.Items.Add(new RadComboBoxItem(allCustomer[i].CompanyName.ToString()  ,                              
            allCustomer[i].CompanyId.ToString()));
        }

        e.Message = GetStatusMessage(endOffset, allCustomer.Count);
    }

 private static string GetStatusMessage(int offset, int total)
    {
        if (total <= 0)
            return "No matches";

        return String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", offset, total);
    }


When match mode is with MatchMode.Start then records are displyaing with search and all but when MatchMode.Anywhere
which is property of Nhibernate then records are coming from db and are assigning to Radcombo by RadComboBoxItem
property but i cant see the records in combo.But i can see count properly.
But it works fine with MatchMode.Start 



Simon
Telerik team
 answered on 29 Jul 2010
2 answers
73 views
Hi,

I have two RadGrids. The first grid presents a list of items and with a push of a button selected items are transferred to the second grid (in addition to whatever might already be in the second grid). So on button's Click event (server side) I go through all items in the second grid to see what has already been added. However, the value of GridDataItem.Text is wrong (contains only &nbsp;):

foreach (GridDataItem dataItem in rgTaskDevice.Items)

 

{

 

 

 

 

Device device = new Device();

 

device.Id =

 

Convert.ToInt64(dataItem["Id"].Text); // this causes Exception because .Text = "&nbsp;"
//same for all other columns
...
}


Does anyone have an idea of what went wrong?

Kind regards,
Andreja

 

 


 

Andreja Zitnik
Top achievements
Rank 1
 answered on 29 Jul 2010
1 answer
238 views
Hi!
I'm facing a problem skinning my website.
I'm trying to minimize http calls so i've decide to use a custom skin called GuSkin that i build using a different project.
This project customize FormDecorator, Menu, Grid, Window and ComboBox widgets.
I'm using RadStyleSheetManager to combine all css I produced:
<telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" EnableStyleSheetCombine="false">
    <StyleSheets>
        <telerik:StyleSheetReference Name="GuTelerikSkins.FormDecorator.css" Assembly="GuTelerikSkins" />
        <telerik:StyleSheetReference Name="GuTelerikSkins.Menu.css" Assembly="GuTelerikSkins" />
        <telerik:StyleSheetReference Name="GuTelerikSkins.Grid.css" Assembly="GuTelerikSkins" />
        <telerik:StyleSheetReference Name="GuTelerikSkins.Window.css" Assembly="GuTelerikSkins" />
        <telerik:StyleSheetReference Name="GuTelerikSkins.ComboBox.css" Assembly="GuTelerikSkins" />
    </StyleSheets>
</telerik:RadStyleSheetManager>
As you can see the Assembly is named GuTelerikSkins, but the skin itself is named GuSkin.
The main problem comes from base css styles that telerik use. I'm trying to change font-family of a label tag as
Helvetica, Arial, sans-serif
But the base css of Telerik send a css property that override my font family (which must be common through all the website):
font-family: "Segoe  UI",Arial,Verdana,sans-serif;

For example my decorated form labels are different from the rest of the website.
I've attached 2 screenshots that describe the current styles of labels and the target styles i want to apply so that labels in editon mode are the same as readonly mode on my pages...

Is there a tip to customize base css of Telerik inside a skin project?

Thanks in advance

Pascal
Bozhidar
Telerik team
 answered on 29 Jul 2010
1 answer
94 views
There are cases where we need to set the RadAjaxManager with a lot of controls in order to get the right dynamic updates. Consider the following code:
RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(fShiftQty , fBalance , Progress1);
RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(fShiftQty , fHours , Progress1);
RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(fHours , fShiftQty , Progress1);
RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(fHours , fBalance , Progress1); RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(fCrewSize , fCrewTotal , Progress1);
RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(fCrewSize , fCrewTemps , Progress1);
RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(fCrewSize , fCrewPeople , Progress1);
RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(btnSave2 , btnSave2 , Progress1);
(RAMPUC=RadAjaxManagerProxy for UserControl)
It's basic and effective, but wordy and redundant, right? And a complex page can have a lot more of those lines. So here's an alternative:
SetAjaxUpdates( new Control[ , ] {
        {fShiftQty, fBalance},
        {fShiftQty, fHours},
        {fHours , fShiftQty},
        {fHours , fBalance} , 
        {fCrewSize , fCrewTotal} ,
        {fCrewSize , fCrewTemps} ,
        {fCrewSize , fCrewPeople },
        {btnSave2 , btnSave2}
    }
);

And here's the method:
void SetAjaxUpdates( Control[ , ] controls )
{
    for ( int i = 0 ; i <= controls.GetUpperBound(0) ; i++ )
        RAMPUCScheduleEdit.AjaxSettings.AddAjaxSetting(
             controls[ i , 0 ] , controls[ i , 1 ] , Progress1);
}

Assuming that in this case I do want Progress1 to be active for all updates, from a readability perspective do other people here find the alternative preferable to the original? Or am I just adding more code where it's not necessary and abstracting/refactoring into even more complexity?

More importantly, this is what I came up with to try to streamline the code a bit, and make adding new trigger/update relationships easier, but is there a better, or more elegant way to do what I'm doing here?

Opinions?  Thanks!
Maria Ilieva
Telerik team
 answered on 29 Jul 2010
5 answers
169 views

 

 

<telerik:RadGrid runat="server" ID="grdDetails"

 

 

 

 

Skin="Vista" EnableAJAX="true" Height="100%" BorderWidth="0"

 

 

 

 

AllowSorting="true" Style="outline: none" ShowGroupPanel="true"

 

 

 

 

Width="100%" oncancelcommand="cancleGrdetails" oneditcommand="bindGrdetails1"

 

 

 

 

onupdatecommand="updategrdetails">

 

 

  

 

 

<MasterTableView AutoGenerateColumns="false" EditMode="PopUp">

 

 

 

 

 

<Columns>

 

 

 

 

 

<telerik:GridBoundColumn UniqueName="Name" HeaderText="Name"></telerik:GridBoundColumn>

 

 

 

 

 

<telerik:GridBoundColumn UniqueName="EntityId" HeaderText="EntityId"></telerik:GridBoundColumn>

 

 

 

 

 

<telerik:GridBoundColumn UniqueName="Jurisdiction" HeaderText="Jurisdiction"></telerik:GridBoundColumn>

 

 

 

 

 

<telerik:GridBoundColumn UniqueName="EventType" HeaderText="EventType"></telerik:GridBoundColumn>

 

 

 

 

 

<telerik:GridBoundColumn UniqueName="StartDate" HeaderText="StartDate"></telerik:GridBoundColumn>

 

 

 

 

 

<telerik:GridBoundColumn UniqueName="EndDate" HeaderText="EndDate"></telerik:GridBoundColumn>

 

 

 

 

 

<telerik:GridEditCommandColumn HeaderText="Edit" UniqueName="Editrow"></telerik:GridEditCommandColumn>

 

 

 

 

 

</Columns>

 

 

 

 

 

</MasterTableView>

 

 

 

 

 

<clientsettings>

 

 

 

 

 

<Selecting AllowRowSelect="true" />

 

 

 

 

 

</clientsettings>

 

 

 

 

</telerik:RadGrid>

 

 

 

 

 

protected void bindGrdetails(object sender, EventArgs e)

 

{

 

 

//grdDetails.DataSource = null;

 

 

grdDetails.DataSource =

 

 

"edit".Split();

 

 grdDetails.DataBind();

grdDetails.Visible =

 

true;

 

 

}

 

 

 

protected void bindGrdetails1(object source, GridCommandEventArgs e)

 

 {

grdDetails.Visible =

 

true;

 

 bindGrdetails(source, e);

  

}

 

 

 

protected void updategrdetails(object source, EventArgs e)

 

{

bindGrdetails(source, e);

}

 

 

 

protected void cancleGrdetails(object source, EventArgs e)

 

{

bindGrdetails(source, e);

}

 




In the above when i click on edit i get an error "Specified argument was out of the range of valid values"(In case of in place edit mode)

When edit mode is popup....the form fields are not editable...they are readonly......
I tried a lot but couldn't find the solution....

Ashish Gupta
Ashish
Top achievements
Rank 1
 answered on 29 Jul 2010
5 answers
418 views
Hi all,

i have a grid with an object DataSource.
This DataSource read a table with date write in integer format like that: 20100721.
I want to know if is possible to display in DateTime format 21/07/2010 and edit with a RadDateTimePicher.

Thanks in advance.

Riccardo Fanetti
Tsvetoslav
Telerik team
 answered on 29 Jul 2010
3 answers
3.6K+ views
Hello,

I'm sure there is a very simple solution to my probleme that I am overlooking, but any help would be greatly appreciated.  Basically, I am using the RadDatePicker on a form.  When the form loads it is set to the current date (DateTime.Now), but there is no visual indication of this on the control. I need the RadDatePicker.DateInput.Text to display from the get go and it would be even better if the selected date would be highlighted in the popup calendar as well.  As is, the text only fills in after the user goes in and changes the date(same with the highlight on the calendar date. Is there some property that allows the date to be displayed before the date changes?
 
Thanks in advance,

Morgan
Muthusamy V
Top achievements
Rank 1
 answered on 29 Jul 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?