Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
296 views
I'm a little new at this- but I'm trying to update my MembershipUser via the built-in EditForm in the RadGrid, but it's not taking any of my edits. It doesn't produce any errors, it just updates the user with the same exact info as before, ignoring my changes. What am I doing wrong? I'd greatly appreciate any help or direction.

    protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
    { 
        // Get edited row 
        GridEditableItem editedItem = e.Item as GridEditableItem; 
         
        // Get primary key of editted item 
        object dataKey = editedItem.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ProviderUserKey"]; 
 
        //Locate the changed row in the data source 
        MembershipUser liveUser = membershipProvider.GetUser(dataKey, false); 
 
        // Check if user still exists in data source 
        if (liveUser == null) 
        { 
            statusLabel.Text += "Unable to locate the user for updating."; 
            e.Canceled = true; 
            return; 
        } 
 
        // Update new values 
        Hashtable newValues = new Hashtable(); 
 
        // The GridTableView will fill the values from all editable columns in the hash 
        editedItem.OwnerTableView.ExtractValuesFromItem(newValues, editedItem); 
 
        try 
        { 
            // Update user object with form data 
            liveUser.Email = (string)newValues["Email"]; 
 
            membershipProvider.UpdateUser(liveUser); 
            statusLabel.Text += "User " + liveUser.UserName + " updated."; 
        } 
        catch (Exception ex) 
        { 
            statusLabel.Text += "Unable to update user. Reason: " + ex.Message + "."; 
            e.Canceled = true; 
        } 
 
        // Refresh grid view data 
        RadGrid1.Rebind(); 
    } 

bemara57
Top achievements
Rank 1
 answered on 16 Apr 2008
3 answers
221 views

I am attempting to use the ResourceView of the RadScheduler to show me the Appointments for specific resources. I have specified that the ForeignKey for the ResourceMapping is the ResourceID field which is a CustomAttribute of the Appointment object. I have verified that the data for the ResourceID field is being correctly populated in the Appointment and I have also verified that the resources are being bound to the control. My question is this: when I try to use the ResourceView, I can see the resources, but none of the Appoinments that use those Resources. Am I missing something for the relationship between these two to make this work? Below is the code(s) I am using to establish the relationship:

<ResourceTypes> 
  <telerik:ResourceType   
    ForeignKeyField="ResourceID"   
    DataSourceID="odsResources"       
    Name="Route" 
    KeyField="Id"    
    TextField="RouteName" /> 
 </ResourceTypes> 

The code that populates the Appoinment object is below:

appts = new List<TelerikAppointment>();  
 
foreach (Schedule s in schedules)  
{                         
  temp = new Appointment();  
  temp.Attributes["ResourceID"] = s.Route.Id.ToString();  
  temp.Attributes["MobilityID"] = s.Appointment.Mobility.Id.ToString();  
  temp.Attributes["FromID"]     = s.Appointment.FromAddress.Id.ToString();  
  temp.Attributes["ToID"]       = s.Appointment.ToAddress.Id.ToString();  
  temp.End                      = s.EndTime;  
  temp.ID                       = s.Id;  
  temp.Start                    = s.StartTime;  
  temp.Subject                  = s.Description;  
 
  appts.Add(temp);  
}  
 
this.RadScheduler1.DataSource = appts; 

The RadScheduler control has defined the custom attributes and the group by in the control declaration. Below is the abbreviated control declaration:

CustomAttributeNames="ResourceID,MobilityID,FromID,ToID" 
DataEndField="End"   
DataKeyField="ID"   
DataStartField="Start"   
DataSubjectField="Subject" 
DayEndTime="22:00:00" 
DayStartTime="05:00:00" 
EnableCustomAttributeEditing="true" 
FirstDayOfWeek="Sunday" 
GroupBy="Route" 

Again, when I switch to the ResourceView, I can see the resources, there simply aren't any appointments assigned to the resources.

Thanks in advance!
shawn
Top achievements
Rank 1
 answered on 16 Apr 2008
1 answer
177 views

I am having the exact same problem as mentioned in this thread except I am having this problem with RadGrid "Prometheus":
http://www.telerik.com/community/forums/thread/b311D-hamem.aspx


"When I have a grid that requires horizontal scrolling, but does not have enough rows to require paging, dragging the scroll bar only moves the body of the grid, not the header or footer.

If there are enough rows for there to be paging and virtual scrolling then everything works fine."

Basically, the summary is that when the vertical scroll is NOT present and the horizontal scroll is present this problem happens. When both horizontal and vertical scrolls are present, this problem does not happen.

The data is bound at runtime in the needdatasource event.

I am using the most recent Prometheus 2007-3-1425 hotfix.

Here is the grid definition:
<telerik:RadGrid ID="RadGrid1" runat="server"
            PageSize="50" AllowSorting="True" Skin="Office2007" AllowPaging="True"
            ShowGroupPanel="True"  GridLines="None" AllowFilteringByColumn="True" OnNeedDataSource="RadGrid1_NeedDataSource" OnColumnCreated="RadGrid1_ColumnCreated" OnItemCreated="RadGrid1_ItemCreated" OnItemDataBound="RadGrid1_ItemDataBound"  >
            <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>                                  
                <MasterTableView CommandItemDisplay="Bottom" CurrentResetPageIndexAction="SetPageIndexToFirst"
                     Dir="LTR" Frame="Border"  TableLayout="Fixed" GroupLoadMode="Server">                   
                    <ExpandCollapseColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
                        Resizable="True" Visible="False">
                    </ExpandCollapseColumn>  
                    <CommandItemTemplate>                           
                           <asp:Button ID="btnExcel" Width="150px" Text="Export Excel" OnClick="btnExcel_Click"
                                runat="server" BackColor="AliceBlue" BorderColor="AliceBlue" Font-Bold="true" />                           
                            <asp:Button ID="btnCSV" Width="150px" Text="Export CSV" OnClick="btnCSV_Click"
                                runat="server" BackColor="AliceBlue" BorderColor="AliceBlue" Font-Bold="true" />
                    </CommandItemTemplate>
                    <Columns>
                     <telerik:GridTemplateColumn AllowFiltering="False" HeaderText="TemplateColumn" UniqueName="TemplateColumn">
                                <ItemTemplate>
                                    <asp:Button ID="Button1" runat="server" CommandName="MyCustomAction" Text="Do action"
                                        OnClick="Button1_Click" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                    </Columns>                                                     
                </MasterTableView>
            <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True"
                AllowColumnsReorder="True"   >                               
                <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true"     />
                <Resizing AllowColumnResize = "true" ClipCellContentOnResize="true"  EnableRealTimeResize="true" ResizeGridOnColumnResize="true"  />               
            </ClientSettings>
<ExportSettings>
<Csv ColumnDelimiter="Comma" RowDelimiter="NewLine" />
<Pdf FontType="Subset" PaperSize="Letter" />
<Excel Format="Html" />
 </ExportSettings>
</telerik:RadGrid>

Regards,
Talha

RR
Top achievements
Rank 1
 answered on 16 Apr 2008
8 answers
342 views
Is there any way to increase the size of the radEditor dialogs?

I mean, for example, the image or the template managers.

Shaun Peet
Top achievements
Rank 2
 answered on 16 Apr 2008
1 answer
204 views
I have a RadGrid with columns that are created at runtime.
Data cells contain values like A6754 (NB).
I want to set a backcolor for the cells that depends on the letters between the brackets NB in this example.

How do I loop through all the cells in the grid and change the backcolor of the cells? I think the solution will be very easy, but I cannot find it.

Thanks for any advice.
plamen
Top achievements
Rank 1
 answered on 16 Apr 2008
2 answers
115 views
Hi,

I try to make a custom skin for radcalendar control.  I did'nt found a ImagesPath property  like in other controls. So some images (fastNavLeft.gif for example) are not displayed correctly.

How  I can avoid that without put images at the root of my site ?

Regards,
Richard
Top achievements
Rank 1
 answered on 16 Apr 2008
0 answers
315 views

To get familiar in a fast and pretty straight-forward manner with our panelbar control, I suggest that you visit the online resources linked below:

Online examples

Online documentation

KB articles

Code library

Of course, you can browse the public forum as well to find a specific information/code sample concerning an aspect of the panelbar object model/ features. There are numerous threads which can get you started/assist you through the development process.

Finally, we will appreciate your feedback on the structure/content of the online resources - our goal is to continue enriching them, thus facilitating our customers even more.

Telerik Admin
Top achievements
Rank 1
Iron
 asked on 16 Apr 2008
1 answer
153 views
Hello,

I've seen, that there are the new releases available. But which of them is the new RadControls ASP.NET and successor of Prometheus?

In The Free Trials Section there are 2 different items:
"RadControls Prometheus" and "RadControls for ASP.NET"

BOTH with release date 4/15/2008. I thought only the (formerly) Prometheus would change in to Q1-2008?

Sorry, but I'm a bit confused.

With kind regards

Philip

Edit: ok, I now understand it. I thought ASP.NET should be replaced by Prometheus/ASP.NET AJAX, not that they will coexist. Sorry!
Ivo
Telerik team
 answered on 16 Apr 2008
1 answer
213 views
Dear Telerik Team,

I'm not able to filter the appointments in scheduler based on the selection in combo.
I have done all that i found in telerik demos but does not work.

Could you please tell me whats wrong in my code
Anything more needs to be done apart from this?

Here is the code:

<

asp:DropDownList runat="server" ID="UserDropDown" AutoPostBack="true" DataSourceID="SqlDataSource1" DataTextField="TaskType" DataValueField="ID" OnDataBound="UserDropDown_DataBound">
</asp:DropDownList>

<telerik:radscheduler runat="server" id="RadScheduler1" width="100%" daystarttime="08:00:00" dayendtime="08:01:00" readonly="true" allowdelete="True" allowedit="True" allowinsert="True" dataendfield="End" datakeyfield="ID" onappointmentinsert="RadScheduler1_AppointmentInsert"
datarecurrencefield
="RecurrenceRule" datarecurrenceparentkeyfield="RecurrenceParentId"
datastartfield="Start" datasubjectfield="Subject" firstdayofweek="Monday" lastdayofweek="Sunday"
overflowbehavior="Expand" monthvisibleappointmentsperday="6" skin="Web20" showfooter="False"
showhourscolumn="False" GroupBy="TaskType">

<ResourceTypes>
<telerik:ResourceType KeyField="ID" Name="TaskType" TextField="TaskType"
ForeignKeyField
="ID" DataSourceID="SqlDataSource1"/>
</ResourceTypes>

<appointmenttemplate>
<asp:hyperlink id="id" runat="server" text='<%# Eval("Subject")%>'>
</asp:hyperlink>
</appointmenttemplate>
</telerik:radscheduler>

And i tried in Serverside also:

Private

Sub InitializeResources()
Dim resType As New ResourceType("TaskType")
resType.DataSourceID =
"SqlDataSource1"
resType.ForeignKeyField = "ID"
resType.KeyField = "ID"
resType.TextField = "TaskType"
RadScheduler1.ResourceTypes.Add(resType)
RadScheduler1.Resources.Add(
New Resource("TaskType", 1, "Expert"))RadScheduler1.Resources.Add(New Resource("TaskType", 9001, "Meeting"))RadScheduler1.Resources.Add(New Resource("TaskType", 90, "Staff"))RadScheduler1.Resources.Add(New Resource("TaskType", 92, "National Expert"))
End Sub

The types that i'm filling with the combo are 5 types. Appointment should be one of the 5 types.

Peter
Telerik team
 answered on 16 Apr 2008
13 answers
602 views
I have a RadGrid that I am trying to use to build a shopping cart. I am having a hard time with formatting the column that will hold the items cost.

This is what I have for that column:

<telerik:GridBoundColumn   
   DataField="Price"   
   HeaderText="Price" 
   DataFormatString="${0:###,###.##}"   
   FooterText="Sub-Total: $" 
   Aggregate="sum">   
</telerik:GridBoundColumn> 

The problem I am having is this: If the item cost is $50.00 it only display's $51. Is it possible to have it display the .00? If I set the DataFormatString to "${0}" I get $51.0000. How can I control the amount of decimal places? The data is being pulled from a SQL table and that column data type is MONEY.

Also I would like to display the sub-total of all my items. It formats the sum as $123.0000 as well. How do I control the amount of decimals here? The footer format doesn't seem to be controlled by the DataFormatString.

I'm sure RadGrid has been used many times for this purpose so I suspect there is an easy solution?

Thanks!

Paul
Josh Winkler
Top achievements
Rank 1
 answered on 16 Apr 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?