Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
86 views
Hi,

I've created a dynamic view event page for radschedular and need a way to display out the RecurrenceRule & RecurrenceParentID in a human readable form.
What is the best way to do this?
Are there any pre-built methods for accomplishing this?

Thanks in advance.

Regards,
Iry
Iry Lee
Top achievements
Rank 2
 asked on 31 Mar 2010
2 answers
593 views
New to Telerik, so forgive my ignorances but I am stuck on how to update data in my grid.

I have a grid that uses the NeedDataSource method to bind to a list of objects
<MasterTableView DataKeyNames="Id" Width="100%" AutoGenerateColumns="False"  
OnNeedDataSource="RadGrid1_NeedDataSource"> 


With my method like:
protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e){  
IList<FXGroup> FXData = new List<FXGroup>();  
RadGrid1.DataSource = FXData;  



This is properly populating my grid.

I have set up the grid so that a doubleclick event on a line runs a client side script:
        function GridRowDblClick(sender, eventArgs) {  
            editedRow = eventArgs.get_itemIndexHierarchical();  
            $find("<%= RadGrid1.MasterTableView.ClientID %>").editItem(editedRow);  
        }  

This in turn opens my grid with an edit control, as defined in my mark up:
<telerik:GridBoundColumn DataField="Quantity" HeaderText="Qty"  
SortExpression="Quantity" UniqueName="Quantity" ReadOnly="False" ColumnEditorID="GridQuantityEditor" EditFormColumnIndex="0" >    
</telerik:GridBoundColumn>   
... 
<telerik:GridNumericColumnEditor ID="GridQuantityEditor" runat="server" NumericTextBox-Width="50px" NumericTextBox-NumberFormat-DecimalDigits="0" /> 

What I can not figure out is now what?  I tried to add an event to the grid
OnUpdateCommand="RadGrid1_UpdateCommand" 

 And in here I am not sure what all I need to do.  In order to do what I need I must call a .Save() event on my Object that is contained in the grid, in order to persist back to a database. I would think that in my code I could just do something like:
protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
{ 
        GridEditableItem editedItem = e.Item as GridEditableItem; 
        GridEditManager editMan = editedItem.EditManager; 
    object item = GetObjectByID(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["Id"].ToString()); 
    item.Save(); 
} 

This of course doesn't do anything.  My edited values do not get passed back into the entity.  Do I need to actually do something to pass the edit control values into my object?  How can I account for the various data types that the object's properties contain?

As you can probably tell I am pretty confused.  All of the samples that I have found discuss updates only against grids with defined datasourceids using what appears to be automatic updates.  I would hope that with a grid bound the way I have it that the grid edits would update the object it is bound to and I would just need to do the final  object .Save event.  Doesn't seem to be the case.



Kris
Top achievements
Rank 1
 answered on 31 Mar 2010
7 answers
263 views
Hi


I am using Visual Studio 2008, ASP.NET 3.5 and ASP.NET AJAX.
My telerik version is Q1_2009_SP1
My problem is RadProgressArea works well with IE7 but  not working in FireFox on PC .

Please let me know what am i missing or do I need to add any code in order for the progress area to show?

Thanks In Advance




Jason
Top achievements
Rank 1
 answered on 31 Mar 2010
7 answers
857 views

Hi,

I want to be able to access a radGridthat is nested inside a radGrid then populate the nested radGrid from theOnEditCommand of the parent radGrid.

 

For example: radGrid1 containsradGrid2 within the EditFormSettings.FormTemplate. OnItemCommand, I want todisplay custom formatting for my edit form as well as a new radGrid with otherinformation. Is this possible?

 

I have tried using thee.item.findControl(“radGrid2”) from the GridCommandEventArgs, but null isreturned. In fact, any object I have within the EditFormSettings.FormTemplateseems to be inaccessible using this syntax. Since this didn’t work, I triediterating through the radGrid1’s items and searched for theGridItemType.EditFormItem and tried locating radGrid2 that way, but also wasunsuccessful.

protected void RadGrid1_OnEditCommand( object sender, GridCommandEventArgs e )  
        {  
            RadGrid masterGrid = (RadGrid) sender;  
            foreach ( GridItem gi in masterGrid.Items )  
            {  
                if ( gi.ItemType == GridItemType.EditFormItem )  
                {  
                    TextBox textBox1 = (TextBox) e.Item.FindControl( "txtCreditorName" );  
                    RadGrid radGrid2 = (RadGrid) e.Item.FindControl( "RadGrid2" );                      
                }  
            }  
        }  
 

 

 I looked into the thread whichis talking about <NestedViewTemplate> but that is different from what Iwanted to do.

Can you please take a look at it? Anyhelp would be greatly appreciated.

 

 Here is  my code in aspxpage.

            <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True" Width="100%"  
                AutoGenerateColumns="False" GridLines="None" Height="100%" onneeddatasource="RadGrid1_NeedDataSource" 
                onupdatecommand="RadGrid1_UpdateCommand"  oneditcommand="RadGrid1_EditCommand" onupdatecommand="RadGrid1_InsertCommand"> 
                 
            <PagerStyle Mode="NumericPages" AlwaysVisible="True" />                
            <MasterTableView CommandItemDisplay="Top" Width="100%" AllowMultiColumnSorting="True" EditMode="PopUp" 
                DataKeyNames="creditor_id" Name="creditor">    
                 
                 <Columns>                     
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"> 
                        <HeaderStyle Width="30px" /> 
                        <ItemStyle CssClass="MyImageButton" /> 
                    </telerik:GridEditCommandColumn> 
                    <telerik:GridBoundColumn SortExpression="creditor_id" HeaderButtonType="TextButton" DataField="creditor_id" 
                        HeaderText="Creditor Id" UniqueName="creditor_id" ReadOnly="true" Display="false"> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn SortExpression="Name" HeaderButtonType="TextButton" DataField="Name" HeaderText="Creditor Name" 
                        UniqueName="Name"> 
                    </telerik:GridBoundColumn> 
 
                </Columns>                  
                        
 
           <EditFormSettings EditFormType="Template" PopUpSettings-Height="300px" PopUpSettings-Width="450px"> 
                     
                    <EditColumn UniqueName="EditCommandColumn1"> 
 
                    </EditColumn> 
                    <FormTemplate> 
                        <table id="tblCreditor" cellspacing="5" cellpadding="1" width="450" border="0" rules="none"> 
                            <tr> 
                                <td> 
                                    Creditor Name: 
                                </td> 
                                <td> 
                                    <asp:TextBox ID="txtCreditorName" runat="server" Text='<%# Bind( "Name") %>'> </asp:TextBox> 
                                </td> 
                            </tr> 
 
                            <tr> 
                                <td> 
                                     
                                   <telerik:RadGrid ID="RadGrid2" runat="server" Width="100%"> 
 
                                    <PagerStyle Mode="NumericPages" AlwaysVisible="True" />                
                                    <MasterTableView CommandItemDisplay="Top" Width="100%" AllowMultiColumnSorting="True"  
                                        DataKeyNames="person_id" Name="contact"> 
 
                                         <Columns> 
                                            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn2"> 
                                                <HeaderStyle Width="30px" /> 
                                                <ItemStyle CssClass="MyImageButton" /> 
                                            </telerik:GridEditCommandColumn> 
                                            <telerik:GridBoundColumn SortExpression="person_id" HeaderText="Person Id" HeaderButtonType="TextButton" 
                                                DataField="person_id" UniqueName="person_id" ReadOnly="true" Display="false"> 
                                            </telerik:GridBoundColumn> 
                                            <telerik:GridBoundColumn SortExpression="Name" HeaderText="Contact Name" HeaderButtonType="TextButton" 
                                                DataField="Name" UniqueName="Name"> 
                                            </telerik:GridBoundColumn> 
                                            <telerik:GridBoundColumn SortExpression="Description" HeaderText="Description" HeaderButtonType="TextButton" 
                                                DataField="Description" UniqueName="Description"> 
                                            </telerik:GridBoundColumn> 
                                        </Columns> 
                    
                                    </MasterTableView> 
                                  </telerik:RadGrid>                    
                                                  
                             </td> 
                            </tr> 
                            <tr> 
                                <td align="center" colspan="2"> 
                                    <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' 
                                        runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' 
                                        ValidationGroup="creditor" TabIndex="7"></asp:Button>&nbsp; 
                                    <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel" 
                                        TabIndex="8"> 
                                    </asp:Button> 
                                </td> 
                            </tr> 
                        </table> 
                    </FormTemplate> 
 
                   <PopUpSettings Height="300px" Width="450px"></PopUpSettings> 
                     
                </EditFormSettings> 
            </MasterTableView> 
            </telerik:RadGrid> 
 



Pavlina
Telerik team
 answered on 31 Mar 2010
1 answer
191 views
Hi There,

I am having an issue where everytime I switch back and forth from html view and design view, empty <p> tags are being added.  The first time I switch back and forth it adds <p>&nbsp;</p> and everytime after that it adds <p></p>.  So if I switch back and forth 4 times I get.

<p>&nbsp;</p>
<p></p>
<p></p> 
<p></p>

Does anyone know why this is happening and how to fix it?

Thanks.
Rumen
Telerik team
 answered on 31 Mar 2010
1 answer
138 views
I've found that if I set a paragraph style like so in my toolsfile that it doesn't even apply it.

<paragraph name="Clear Formatting" value="&lt;span&gt;" />

Why is that, if I change it to the "<P>" element it works, but if it's not some sort of block element it doesn't work. Also, I tried to set it to "<body>", like the demo's on the site show, but they don't work.

The reason I want to use span is because I want to remove the header tags applied to the text and turn them into inline elements, is it just not possible or is this some issue with the RadEditor control. I'm using version 2009.3.1314.20.

Thanks.
Rumen
Telerik team
 answered on 31 Mar 2010
3 answers
157 views
In my timepicker whenever I edit values manually and try to save the changes and check it on the client side,  it does not take the changed value and adheres to the previous value...
Am I missing some property here? 

I am currently using this time picker:

<

 

Rad:RadTimePicker ID="RadTimeClaimReported" EnableViewState="false" runat="server"

 

 

Width="85px" TabIndex="8" MinDate="1000-01-01" OnValueChanged="onDateTimeSelected" >

 

 

<DateInput runat="server" DateFormat="hh:mm tt" TabIndex="8" Width="80px" />

 

 

<ClientEvents OnPopupClosing="onDateTimeSelected" />

 

 

<TimeView runat="server" TimeFormat="hh:mm tt" TabIndex="8" />

 

 

<TimePopupButton TabIndex="8" />

 

 

</Rad:RadTimePicker>

onDateTimeSelected(sender, e)
{

 

 

var textbox = sender.get_dateInput();

 

 

if(textbox.get_enabled())

 

textbox.focus();

}


Regards
Arun


 

Radoslav
Telerik team
 answered on 31 Mar 2010
1 answer
110 views
Hi,

I ran into this problem wherein my RadEditor does not render properly and the text area remains disabled.

I have two usercontrols : UC1 and UC2 on my page. When my page initially loads, only UC1 is visible. UC2, which has the RadEditor control, remains invisible when the page first loads. Upon clicking a button UC2 is set to visible via an Ajax callback, which is set via AjaxSettings with RadAjaxManager.
Whether the ajaxSettings are set in design mode or programmatically, it didn't make any difference in the behaviour of RadEditor. The RadEditor loads, toolbar loads, but the content is never displayed and remains disabled. When I check the html rendered using Firebug, I can see that the iFrame portion of the RadEditor is missing when ajaxSettings are present on the page. However, if the AjaxSettings are removed, everything works fine except that the controls are no longer ajaxified but have to postback to get/update the data.

I tried it in IE as well without any luck :( . Tried setting the AjaxSettings in PreRender ..no luck though. Tried loading/adding RadEditor programmatically and met the same luck.

Any suggestions would be appreciated.

Thanks,
Pravs
Rumen
Telerik team
 answered on 31 Mar 2010
1 answer
67 views
Hi,

I ran into this problem wherein my RadEditor (used from RadControls_for_ASP.NET_AJAX_2008_1_619_dev) does not render properly and the text area remains disabled.

I have two usercontrols : UC1 and UC2 on my page. When my page initially loads, only UC1 is visible. UC2, which has the RadEditor control, remains invisible when the page first loads. Upon clicking a button UC2 is set to visible via an Ajax callback, which is set via AjaxSettings with RadAjaxManager.
Whether the ajaxSettings are set in design mode or programmatically, it didn't make any difference in the behaviour of RadEditor. The RadEditor loads, toolbar loads, but the content is never displayed and remains disabled. When I check the html rendered using Firebug, I can see that the iFrame portion of the RadEditor is missing when ajaxSettings are present on the page. However, if the AjaxSettings are removed, everything works fine except that the controls are no longer ajaxified but have to postback to get/update the data.

I tried it in IE as well without any luck :( . Tried setting the AjaxSettings in PreRender ..no luck though. Tried loading/adding RadEditor programmatically and met the same luck.

Any suggestions would be appreciated.

Thanks
Rumen
Telerik team
 answered on 31 Mar 2010
1 answer
219 views
I tried the following in my Page_Load event based on search in forum:
protected void Page_Load(object sender, EventArgs e)
{
    ...
    // make call to get data
    List<QMarkRow> qmarkRows = qmd.getData(
        sessFilter,
        sessSort,
        pageSize);

    // set datasource
    grdList.DataSource = qmarkRows;
    grdList.VirtualItemCount = qmd.Count;
    grdList.PageSize = pageSize;
    grdList.CurrentPageIndex = qmd.PageIndex;
    grdList.DataBind();
    // tried below in GrdList_PreRender event still error
    if (sessSort != null && sessSort.Length > 0)
    {
        // create GridSortExpression and add to grid
        // format of sessSort: Sort<Coln> <ASC|DESC>
        GridSortExpression gse = new GridSortExpression();
        int index = sessSort.IndexOf(" ");
        gse.FieldName = sessSort.Substring(4, index - 4);
        gse.SortOrder = sessSort.Substring(index + 1).Equals("ASC") ? GridSortOrder.Ascending : GridSortOrder.Descending;
        grdList.MasterTableView.SortExpressions.Add(gse);
        grdList.MasterTableView.Rebind();
    }
...
}
I get error on Rebind() call:
IndexOutOfRangeException was unhandled by user code
cannot find column Col1

Col1 is defined in grid:
<telerik:RadGrid
        ID="grdList" runat="server"
        EnableViewState="false"
        Height="328px"
        AllowPaging="true"
        AllowCustomPaging="true"
        AllowSorting="true"
        AllowFilteringByColumn="true"
        AutoGenerateColumns="False"
        PageSize="12"
        Skin="WebBlue" OnPreRender="GrdList_PreRender">
    <MasterTableView
            ClientDataKeyNames="Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8,Col9,Col10"
            EnableViewState="False">
        <Columns>
            <telerik:GridBoundColumn DataField="Col1" UniqueName="Col1"
                DataType="System.String"
                HeaderText="COL1" Visible="false" DataFormatString="<nobr>{0}</nobr>" >
                <HeaderStyle Width="80px" HorizontalAlign="left"  />
                <ItemStyle Width="80px" HorizontalAlign="left" />
            </telerik:GridBoundColumn>                        
...

This grid is defined in user control and everything else works except setting sortExpression.
Pavlina
Telerik team
 answered on 31 Mar 2010
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?